Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6 → Rev 1

/branches/Scribus/Scribus/ChangeLogCVS
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/scribus.lsm
===================================================================
--- Scribus/Scribus/scribus.lsm (revision 6)
+++ Scribus/Scribus/scribus.lsm (nonexistent)
@@ -1,14 +0,0 @@
-Begin3
-Title: Scribus
-Version: 0.4
-Entered-date:
-Description:
-Keywords:
-Author: Franz Schmid <Franz.Schmid@altmuehlnet.de>
-Maintained-by: Franz Schmid <Franz.Schmid@altmuehlnet.de>
-Primary-site:
-Home-page: http://web2.altmuehlnet.de/fschmid
-Original-site:
-Platforms: Linux and other Unices
-Copying-policy: GNU Public License
-End
/Scribus/Scribus/scribus.lsm
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/TODO
===================================================================
--- Scribus/Scribus/TODO (revision 6)
+++ Scribus/Scribus/TODO (nonexistent)
@@ -1,5 +0,0 @@
-Plans for the next Release:
-
- - Integrate a Spellchecker
- - Provide an alternative Fontselector
- - enhanche the Display
/Scribus/Scribus/TODO
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/INSTALL
===================================================================
--- Scribus/Scribus/INSTALL (revision 6)
+++ Scribus/Scribus/INSTALL (nonexistent)
@@ -1,167 +0,0 @@
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes a while. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Type `make install' to install the programs and any data files and
- documentation.
-
- 4. You can remove the program binaries and object files from the
- source code directory by typing `make clean'.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made.
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
-
/Scribus/Scribus/INSTALL
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/tree.h
===================================================================
--- Scribus/Scribus/scribus/tree.h (revision 6)
+++ Scribus/Scribus/scribus/tree.h (nonexistent)
@@ -1,46 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'tree.ui'
-**
-** Created: Thu May 24 10:46:08 2001
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef TREE_H
-#define TREE_H
-
-#include <qdialog.h>
-#include <qptrlist.h>
-#include "scribusview.h"
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QListView;
-class QListViewItem;
-
-class Tree : public QDialog
-{
- Q_OBJECT
-
-public:
- Tree( QWidget* parent, WFlags fl );
- ~Tree() {};
-
- QListView* ListView1;
- QPtrList<QListViewItem> Seiten;
- QPtrList<QListViewItem> Elemente;
- void closeEvent(QCloseEvent *ce);
- void resizeEvent(QResizeEvent *r);
-
-public slots:
- virtual void slotSelect(QListViewItem* ite);
- void BuildTree(ScribusView *view);
-
-signals:
- void Schliessen();
- void SelectElement(int, int);
- void SelectSeite(int);
-
-};
-
-#endif // TREE_H
/Scribus/Scribus/scribus/tree.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/cmykfw.h
===================================================================
--- Scribus/Scribus/scribus/cmykfw.h (revision 6)
+++ Scribus/Scribus/scribus/cmykfw.h (nonexistent)
@@ -1,99 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'CMY.ui'
-**
-** Created: Thu Sep 6 22:13:03 2001
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef CMYKFARBEN_H
-#define CMYKFARBEN_H
-
-#include <qdialog.h>
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qframe.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include "cmykcolor.h"
-#include "colorchart.h"
-
-class CMYKChoose : public QDialog
-{
- Q_OBJECT
-
-public:
- CMYKChoose( QWidget* parent, CMYKColor orig, QString name );
- ~CMYKChoose() {};
- virtual void mouseReleaseEvent(QMouseEvent *m);
- QColor CMYK2RGB(int c, int m, int y, int k);
- QLabel* TextLabel1;
- QLabel* Farbname;
- QLabel* TextLabel3;
- QComboBox* ComboBox1;
- QCheckBox* Separations;
- QLabel* TextLabel5_2;
- QLabel* OldC;
- QLabel* TextLabel5;
- QLabel* NewC;
- QPushButton* Cancel;
- QPushButton* Cancel_2;
- QFrame* Frame4;
- QFrame* Frame5;
- ColorChart* ColorMap;
- QLabel* CyanP;
- QLabel* CyanT;
- QSlider* CyanSL;
- QSpinBox* CyanSp;
- QLabel* MagentaP;
- QLabel* MagentaT;
- QSlider* MagentaSL;
- QSpinBox* MagentaSp;
- QLabel* YellowP;
- QLabel* YellowT;
- QSlider* YellowSL;
- QSpinBox* YellowSp;
- QLabel* BlackP;
- QLabel* BlackT;
- QSlider* BlackSL;
- QSpinBox* BlackSp;
- QPixmap imageA;
- QPixmap imageN;
- CMYKColor Farbe;
- bool CMYKmode;
- bool Wsave;
- bool dynamic;
- int BlackComp;
-public slots:
- void ToggleSL();
- QPixmap SliderPix(int farbe);
- QPixmap SliderBlack();
- void SelModel(const QString& mod);
- void setColor();
- void setColor2(int h, int s, bool ende);
- void setValues();
-
-protected:
- QHBoxLayout* CMYKFarbenLayout;
- QVBoxLayout* Layout23;
- QGridLayout* Layout2;
- QHBoxLayout* Layout21;
- QVBoxLayout* Frame4Layout;
- QHBoxLayout* Frame5Layout;
- QHBoxLayout* Cyan;
- QVBoxLayout* Layout1_2;
- QHBoxLayout* Magenta;
- QVBoxLayout* Layout1_2_2;
- QHBoxLayout* Yellow;
- QVBoxLayout* Layout1_2_3;
- QHBoxLayout* Black;
- QVBoxLayout* Layout1_2_4;
-};
-
-#endif // CMYKFARBEN_H
/Scribus/Scribus/scribus/cmykfw.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/linecombo.cpp
===================================================================
--- Scribus/Scribus/scribus/linecombo.cpp (revision 6)
+++ Scribus/Scribus/scribus/linecombo.cpp (nonexistent)
@@ -1,30 +0,0 @@
-/***************************************************************************
- linecombo.cpp - description
- -------------------
- begin : Thu Jul 12 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 "linecombo.h"
-#include "icons5.h"
-
-LineCombo::LineCombo(QWidget* pa) : QComboBox(true, pa)
-{
- setEditable(false);
- insertItem(QPixmap(solidL));
- insertItem(QPixmap(dashL));
- insertItem(QPixmap(dotL));
- insertItem(QPixmap(dashdotL));
- insertItem(QPixmap(dashdotdotL));
-}
-
/Scribus/Scribus/scribus/linecombo.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/serializer.cpp
===================================================================
--- Scribus/Scribus/scribus/serializer.cpp (revision 6)
+++ Scribus/Scribus/scribus/serializer.cpp (nonexistent)
@@ -1,135 +0,0 @@
-/***************************************************************************
- serializer.cpp - 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. *
- * *
- ***************************************************************************/
-
-#include "serializer.h"
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qtextcodec.h>
-extern bool loadText(QString nam, QString *Buffer);
-Serializer::Serializer(QString name)
-{
- Filename = name;
- Objekt = "";
-}
-
-QString Serializer::GetObjekt()
-{
- return Objekt;
-}
-
-void Serializer::PutText(PageItem *Item)
-{
- uint a;
- bool Uni = false;
- QString Dat = "";
- QPtrList<Pti> y = Item->Ptext;
- for (a=0; a<y.count(); ++a)
- {
- QString b = y.at(a)->ch;
- if (b == QChar(13))
- b = "\n";
- if (b[0].unicode() > 255)
- Uni = true;
- Dat += b;
- }
- if (Uni)
- Objekt = Dat.utf8();
- else
- Objekt = Dat;
-}
-
-void Serializer::GetText(PageItem *Item, int Absatz, bool Append)
-{
- struct Pti *hg;
- PageItem *nb;
- uint a;
- if (!Append)
- {
- if (Item->NextBox != 0)
- {
- nb = Item->NextBox;
- while (nb != 0)
- {
- nb->Ptext.clear();
- nb->CPos = 0;
- nb->Dirty = true;
- nb = nb->NextBox;
- }
- }
- Item->Ptext.clear();
- Item->CPos = 0;
- }
- for (a=0; a<Objekt.length(); ++a)
- {
- hg = new Pti;
- hg->ch = Objekt.at(a);
- if (hg->ch == QChar(10)) { hg->ch = QChar(13); }
- if (hg->ch == QChar(5)) { hg->ch = QChar(13); }
- if (hg->ch == QChar(9)) { hg->ch = " "; }
- hg->cfont = Item->IFont;
- hg->csize = Item->ISize;
- hg->ccolor = Item->Pcolor2;
- hg->cextra = 0;
- hg->cshade = Item->Shade2;
- hg->cselect = false;
- hg->cstyle = 0;
- hg->cab = Absatz;
- hg->xp = 0;
- hg->yp = 0;
- hg->PRot = 0;
- hg->PtransX = 0;
- hg->PtransY = 0;
- if (Append)
- Item->Ptext.insert(Item->CPos, hg);
- else
- Item->Ptext.append(hg);
- Item->CPos += 1;
- }
-}
-
-bool Serializer::Write()
-{
- QFile f(Filename);
- bool ret = false;
- if (f.open(IO_WriteOnly))
- {
- QTextStream t(&f);
- t.writeRawBytes(Objekt, Objekt.length());
- f.close();
- ret = true;
- }
- else
- {
- ret = false;
- }
- return ret;
-}
-
-bool Serializer::Read()
-{
- bool tmp = loadText(Filename, &Objekt);
- QTextCodec* codec = QTextCodec::codecForContent(Objekt, Objekt.length());
- if (codec)
- {
- if (QString(codec->name()) == "UTF-8")
- {
- QString dec = QString::fromUtf8(Objekt);
- Objekt = dec;
- }
- }
- return tmp;
-}
/Scribus/Scribus/scribus/serializer.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/bookpalette.cpp
===================================================================
--- Scribus/Scribus/scribus/bookpalette.cpp (revision 6)
+++ Scribus/Scribus/scribus/bookpalette.cpp (nonexistent)
@@ -1,36 +0,0 @@
-/***************************************************************************
- bookpalette.cpp - 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. *
- * *
- ***************************************************************************/
-
-#include "bookpalette.h"
-#include "bookpalette.moc"
-extern QPixmap loadIcon(QString nam);
-
-BookPalette::BookPalette(QWidget* parent) : QDialog( parent, "Books", false, Qt::WStyle_Customize | Qt::WStyle_Title | Qt::WStyle_Tool )
-{
- setIcon(loadIcon("AppIcon.xpm"));
- setCaption( tr( "Bookmarks" ) );
- PaletteLayout = new QVBoxLayout( this, 0, 0, "PaletteLayout");
- BView = new BookMView(this);
- BView->setMinimumSize(QSize(100,150));
- PaletteLayout->addWidget( BView );
-}
-
-void BookPalette::closeEvent(QCloseEvent *ce)
-{
- emit Schliessen();
- ce->accept();
-}
/Scribus/Scribus/scribus/bookpalette.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/scribus.cpp
===================================================================
--- Scribus/Scribus/scribus/scribus.cpp (revision 6)
+++ Scribus/Scribus/scribus/scribus.cpp (nonexistent)
@@ -1,6313 +0,0 @@
-/***************************************************************************
- scribus.cpp - description
- -------------------
- begin : Fre Apr 6 21:09:31 CEST 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 <qaccel.h>
-#include <qapplication.h>
-#include <qcolordialog.h>
-#include <qcolor.h>
-#include <qiconset.h>
-#include <qtextstream.h>
-#include <qstylefactory.h>
-#include <qregexp.h>
-#include <qtextcodec.h>
-#include <qcursor.h>
-#include <qvbox.h>
-#include <cstdio>
-#include <cstdlib>
-#include <dlfcn.h>
-#include <iostream>
-#include "scribus.h"
-#include "scribus.moc"
-#include "newfile.h"
-#include "page.h"
-#include "query.h"
-#include "mdup.h"
-#include "docinfo.h"
-#include "reformdoc.h"
-#include "serializer.h"
-#include "align.h"
-#include "fmitem.h"
-#include "fontprefs.h"
-#include "libprefs/prefs.h"
-#include "pdfopts.h"
-#include "inspage.h"
-#include "delpages.h"
-#include "movepage.h"
-#include "helpbrowser.h"
-#include "scribusXml.h"
-#include "libabout/about.h"
-#include "druck.h"
-#include "editformats.h"
-#include "muster.h"
-#include "applytemplate.h"
-#include "picstatus.h"
-#include "customfdialog.h"
-#include "cmsprefs.h"
-#include "annot.h"
-#include "annota.h"
-#include "javadocs.h"
-#include "config.h"
-#include "fpoint.h"
-#include "fpointarray.h"
-#include "hysettings.h"
-#include "guidemanager.h"
-#include "mergedoc.h"
-extern QPixmap loadIcon(QString nam);
-
-using namespace std;
-
-#ifdef HAVE_CMS
-cmsHPROFILE CMSoutputProf;
-cmsHPROFILE CMSprinterProf;
-cmsHTRANSFORM stdTrans;
-cmsHTRANSFORM stdProof;
-cmsHTRANSFORM stdTransImg;
-cmsHTRANSFORM stdProofImg;
-bool SoftProofing;
-bool Gamut;
-bool CMSuse;
-int IntentMonitor;
-int IntentPrinter;
-#endif
-bool CMSavail;
-ProfilesL InputProfiles;
-int PolyC;
-int PolyFd;
-float PolyF;
-bool PolyS;
-float PolyR;
-float UmReFaktor;
-QString DocDir;
-
-ScribusApp::ScribusApp()
-{
- setCaption(tr("Scribus " VERSION));
- setIcon(loadIcon("AppIcon.xpm"));
- initMenuBar();
- initStatusBar();
- WerkTools2 = new QToolBar(tr("File"), this);
- DatNeu = new QToolButton(loadIcon("DateiNeu.xpm"), tr("Creates a new Document"), QString::null, this, SLOT(slotFileNew()), WerkTools2);
- DatOpe = new QToolButton(loadIcon("DateiOpen.xpm"), tr("Opens a Document"), QString::null, this, SLOT(slotDocOpen()), WerkTools2);
- DatSav = new QToolButton(loadIcon("DateiSave.xpm"), tr("Saves the current Document"), QString::null, this, SLOT(slotFileSave()), WerkTools2);
- DatClo = new QToolButton(loadIcon("DateiClos.xpm"), tr("Closes the current Document"), QString::null, this, SLOT(slotFileClose()), WerkTools2);
- DatPri = new QToolButton(loadIcon("DateiPrint.xpm"), tr("Prints the current Document"), QString::null, this, SLOT(slotFilePrint()), WerkTools2);
- DatPDF = new QToolButton(loadIcon("acrobat.png"), tr("Saves the current Document as PDF"), QString::null, this, SLOT(SaveAsPDF()), WerkTools2);
- DatSav->setEnabled(false);
- DatClo->setEnabled(false);
- DatPri->setEnabled(false);
- DatPDF->setEnabled(false);
- DatOpe->setPopup(recentMenu);
- WerkTools = new WerkToolB(this);
- setDockEnabled(WerkTools, DockLeft, false);
- setDockEnabled(WerkTools, DockRight, false);
- WerkTools->setEnabled(false);
- QString Pff = QString(getenv("HOME"))+"/.scribus";
- QFileInfo Pffi = QFileInfo(Pff);
- if (Pffi.exists())
- {
- if (Pffi.isDir())
- PrefsPfad = Pff;
- else
- PrefsPfad = QString(getenv("HOME"));
- }
- else
- {
- QDir di = QDir();
- di.mkdir(Pff);
- PrefsPfad = Pff;
- QString OldPR = QString(getenv("HOME"))+"/.scribus.rc";
- QFileInfo OldPi = QFileInfo(OldPR);
- if (OldPi.exists())
- {
- system("mv " + OldPR + " " + Pff+"/scribus.rc");
- }
- QString OldPR2 = QString(getenv("HOME"))+"/.scribusfont.rc";
- QFileInfo OldPi2 = QFileInfo(OldPR2);
- if (OldPi2.exists())
- {
- system("mv " + OldPR2 + " " + Pff+"/scribusfont.rc");
- }
- QString OldPR3 = QString(getenv("HOME"))+"/.scribusscrap.scs";
- QFileInfo OldPi3 = QFileInfo(OldPR3);
- if (OldPi3.exists())
- {
- system("mv " + OldPR3 + " " + Pff+"/scrap.scs");
- }
- }
- /** Erstelle Fontliste */
- NoFonts = false;
- BuFromApp = false;
- GetAllFonts();
- if (NoFonts)
- {
- QString mess = tr("There are no Postscript-Fonts on your System");
- mess += "\n" + tr("Exiting now");
- QMessageBox::critical(this, tr("Fatal Error"), mess, 1, 0, 0);
- }
- else
- {
- HaveDoc = 0;
- BuildFontMenu();
- SCFontsIterator it(Prefs.AvailFonts);
- Prefs.DefFont = it.currentKey();
- Prefs.DefSize = 12;
- Prefs.AppFontSize = 12;
- /** Default Farbenliste */
- Prefs.DColors.clear();
- Prefs.DColors.insert("White", CMYKColor(0, 0, 0, 0));
- Prefs.DColors.insert("Black", CMYKColor(0, 0, 0, 255));
- Prefs.DColors.insert("Blue", CMYKColor(255, 255, 0, 0));
- Prefs.DColors.insert("Cyan", CMYKColor(255, 0, 0, 0));
- Prefs.DColors.insert("Green", CMYKColor(255, 0, 255, 0));
- Prefs.DColors.insert("Red", CMYKColor(0, 255, 255, 0));
- Prefs.DColors.insert("Yellow", CMYKColor(0, 0, 255, 0));
- Prefs.DColors.insert("Magenta", CMYKColor(0, 255, 0, 0));
- DispX = 10;
- DispY = 10;
- Prefs.Wheelval = 40;
- Prefs.GrabRad = 4;
- Prefs.GuideRad = 10;
- Prefs.DminGrid = 20;
- Prefs.DmajGrid = 100;
- DocNr = 1;
- Prefs.DminColor = QColor(green);
- Prefs.DmajColor = QColor(green);
- Prefs.DpapColor = QColor(white);
- Prefs.DmargColor = QColor(blue);
- Prefs.guideColor = QColor(darkBlue);
- Prefs.DVHoch = 33;
- Prefs.DVHochSc = 100;
- Prefs.DVTief = 33;
- Prefs.DVTiefSc = 100;
- Prefs.DVKapit = 75;
- Prefs.GUI = "Default";
- Prefs.Dpen = "Black";
- Prefs.Dbrush = "Black";
- Prefs.Dshade = 100;
- Prefs.Dshade2 = 100;
- Prefs.DLineArt = SolidLine;
- Prefs.Dwidth = 1;
- Prefs.DpenLine = "Black";
- Prefs.DpenText = "Black";
- Prefs.DshadeLine = 100;
- Prefs.DLstyleLine = SolidLine;
- Prefs.DwidthLine = 1;
- Prefs.MagMin = 10;
- Prefs.MagMax = 800;
- Prefs.MagStep = 25;
- Prefs.DbrushPict = "White";
- Prefs.ShadePict = 100;
- Prefs.ScaleX = 1;
- Prefs.ScaleY = 1;
- Prefs.Before = true;
- Prefs.Einheit = 0;
- UmReFaktor = 1.0;
- PolyC = 4;
- PolyF = 0.5;
- PolyS = false;
- PolyFd = 0;
- PolyR = 0;
- Prefs.PolyC = PolyC;
- Prefs.PolyF = PolyF;
- Prefs.PolyFd = PolyFd;
- Prefs.PolyS = PolyS;
- Prefs.PolyR = PolyR;
- Prefs.Werkv = true;
- Prefs.Mpalv = false;
- Prefs.Tpalv = false;
- Prefs.SCpalv = false;
- Prefs.Lpalv = false;
- Prefs.Bopalv = false;
- Prefs.PSize = 40;
- Prefs.SaveAtQ = true;
- Prefs.ShFrames = true;
- Prefs.PagesSbS = true;
- Prefs.RecentDocs.clear();
- Prefs.RecentDCount = 5;
- Prefs.RandFarbig = false;
- Prefs.AutoLine = 20;
- Prefs.PageFormat = 4;
- Prefs.Ausrichtung = 0;
- Prefs.PageBreite = 595;
- Prefs.PageHoehe = 842;
- Prefs.RandOben = 9;
- Prefs.RandUnten = 40;
- Prefs.RandLinks = 9;
- Prefs.RandRechts = 9;
- Prefs.DoppelSeiten = false;
- Prefs.ErsteLinks = false;
- Prefs.ScaleType = true;
- Prefs.AspectRatio = true;
- Prefs.MinWordLen = 3;
- Prefs.Language = "";
- Prefs.Automatic = true;
- Prefs.AutoCheck = false;
- Prefs.PDFTransparency = false;
- Prefs.AutoSave = false;
- Prefs.AutoSaveTime = 600000;
- Prefs.DocDir = QString(getenv("HOME"));
- PDFavailable = true;
- PDef.Pname = "";
- PDef.Dname = "";
- PDef.Command = "";
- PrinterUsed = false;
- resize(610, 600);
- QVBox* vb = new QVBox( this );
- vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
- wsp = new QWorkspace( vb );
- setCentralWidget( vb );
- connect(wsp, SIGNAL(windowActivated(QWidget *)), this, SLOT(newActWin(QWidget *)));
- Tpal = new Tree(this, WStyle_Customize | WStyle_DialogBorder);
- Mpal = new Mpalette(this, FontMenu);
- Mpal->Cpal->SetColors(Prefs.DColors);
- Npal = new NodePalette(this);
- Lpal = new LayerPalette(this);
- ScBook = new Biblio(this, Prefs.AvailFonts, &Prefs);
- Sepal = new SeitenPal(this);
- BookPal = new BookPalette(this);
- CMSavail = false;
- Prefs.DCMSset.DefaultMonitorProfile = "";
- Prefs.DCMSset.DefaultPrinterProfile = "";
- Prefs.DCMSset.DefaultInputProfile = "";
- Prefs.DCMSset.DefaultInputProfile2 = "";
- Prefs.DCMSset.CMSinUse = false;
- Prefs.DCMSset.SoftProofOn = false;
- Prefs.DCMSset.GamutCheck = false;
- Prefs.DCMSset.DefaultIntentMonitor = 1;
- Prefs.DCMSset.DefaultIntentMonitor2 = 1;
- Prefs.DCMSset.DefaultIntentPrinter = 0;
- Prefs.GFontSub.clear();
- SetKeyEntry(56, tr("Smart Hyphen"), 0, ALT+Key_Minus);
- SetKeyEntry(57, tr("Align Left"), 0, CTRL+Key_L);
- SetKeyEntry(58, tr("Align Right"), 0, CTRL+Key_R);
- SetKeyEntry(59, tr("Align Center"), 0, CTRL+Key_E);
- SetKeyEntry(60, tr("Insert Pagenumber"), 0, ALT+Key_NumberSign);
- SetKeyEntry(61, tr("Attach Text to Path"), PfadT, 0);
- SetKeyEntry(62, tr("Show Layers"), viewLpal, 0);
- SetKeyEntry(63, tr("JavaScripts..."), jman, 0);
- SetKeyEntry(64, tr("Undo"), edUndo, CTRL+Key_Z);
- SetKeyEntry(65, tr("Show Page Palette"), viewSepal, 0);
- SetKeyEntry(66, tr("Lock/Unlock"), LockOb, CTRL+Key_H);
- GetCMSProfiles();
- InitHyphenator();
- ReadPrefs();
- Mpal->Cpal->UseTrans(Prefs.PDFTransparency);
- DocDir = Prefs.DocDir;
- SetShortCut();
- if (CMSavail)
- {
- hymen->insertItem(tr("Color Management..."), this , SLOT(SetCMSPrefs()));
- ProfilesL::Iterator ip;
- if ((Prefs.DCMSset.DefaultInputProfile == "") || (!InputProfiles.contains(Prefs.DCMSset.DefaultInputProfile)))
- {
- ip = InputProfiles.begin();
- Prefs.DCMSset.DefaultInputProfile = ip.key();
- }
- if ((Prefs.DCMSset.DefaultInputProfile2 == "") || (!InputProfiles.contains(Prefs.DCMSset.DefaultInputProfile2)))
- {
- ip = InputProfiles.begin();
- Prefs.DCMSset.DefaultInputProfile2 = ip.key();
- }
- if ((Prefs.DCMSset.DefaultMonitorProfile == "") || (!MonitorProfiles.contains(Prefs.DCMSset.DefaultMonitorProfile)))
- {
- ip = MonitorProfiles.begin();
- Prefs.DCMSset.DefaultMonitorProfile = ip.key();
- }
- if ((Prefs.DCMSset.DefaultPrinterProfile == "") || (!PrinterProfiles.contains(Prefs.DCMSset.DefaultPrinterProfile)))
- {
- ip = PrinterProfiles.begin();
- Prefs.DCMSset.DefaultPrinterProfile = ip.key();
- }
-#ifdef HAVE_CMS
- SoftProofing = Prefs.DCMSset.SoftProofOn;
- CMSuse = false;
- IntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- IntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
-#endif
- }
- QString SCf = PrefsPfad+"/scrap.scs";
- QFileInfo SCfi = QFileInfo(SCf);
- if (SCfi.exists())
- {
- ScBook->BibWin->ReadContents(SCf);
- ScBook->ScFilename = SCf;
- }
- ScBook->AdjustMenu();
- HaveGS = system("gs -h > /dev/null 2>&1");
- InitPlugs();
- ClipB = QApplication::clipboard();
- connect(WerkTools, SIGNAL(NewMode(int)), this, SLOT(ModeFromTB(int)));
- connect(WerkTools, SIGNAL(Schliessen()), this, SLOT(ToggleTools()));
- connect(Mpal, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
- connect(Mpal, SIGNAL(NewAbStyle(int)), this, SLOT(setNewAbStyle(int)));
- connect(Mpal, SIGNAL(BackHome()), this, SLOT(Aktiv()));
- connect(Mpal, SIGNAL(Stellung(int)), this, SLOT(setItemHoch(int)));
- connect(Mpal, SIGNAL(Schliessen()), this, SLOT(ToggleMpal()));
- connect(Mpal, SIGNAL(EditCL()), this, SLOT(ToggleFrameEdit()));
- connect(Mpal->Cpal, SIGNAL(NewPen(QString)), this, SLOT(setPenFarbe(QString)));
- connect(Mpal->Cpal, SIGNAL(NewBrush(QString)), this, SLOT(setBrushFarbe(QString)));
- connect(Mpal->Cpal, SIGNAL(NewPenShade(int)), this, SLOT(setPenShade(int)));
- connect(Mpal->Cpal, SIGNAL(NewBrushShade(int)), this, SLOT(setBrushShade(int)));
- connect(Mpal->Cpal, SIGNAL(NewTrans(float)), this, SLOT(SetTranspar(float)));
- connect(Mpal->Cpal, SIGNAL(NewGradient(int, QString, int, QString, int)), this, SLOT(setGradFill(int, QString, int, QString, int)));
- connect(Mpal->Cpal, SIGNAL(QueryItem()), this, SLOT(GetBrushPen()));
- connect(Tpal, SIGNAL(Schliessen()), this, SLOT(ToggleTpal()));
- connect(Tpal, SIGNAL(SelectElement(int, int)), this, SLOT(SelectFromOutl(int, int)));
- connect(Tpal, SIGNAL(SelectSeite(int)), this, SLOT(SelectFromOutlS(int)));
- connect(Mpal->Spal, SIGNAL(NewStyle(int)), this, SLOT(setNewAbStyle(int)));
- connect(Mpal->Spal, SIGNAL(EditSt()), this, SLOT(slotEditStyles()));
- connect(Npal, SIGNAL(Schliessen()), this, SLOT(NoFrameEdit()));
- connect(Lpal, SIGNAL(LayerActivated(int)), this, SLOT(changeLayer(int)));
- connect(Lpal, SIGNAL(LayerRemoved(int)), this, SLOT(LayerRemove(int)));
- connect(Lpal, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
- connect(Lpal, SIGNAL(Schliessen()), this, SLOT(ToggleLpal()));
- connect(Sepal, SIGNAL(Schliessen()), this, SLOT(ToggleSepal()));
- connect(ScBook, SIGNAL(Schliessen()), this, SLOT(ToggleBpal()));
- connect(Sepal, SIGNAL(EditTemp(QString)), this, SLOT(ManageTemp(QString)));
- connect(Sepal->PageView, SIGNAL(UseTemp(QString, int)), this, SLOT(Apply_Temp(QString, int)));
- connect(Sepal->PageView, SIGNAL(NewPage(int, QString)), this, SLOT(slotNewPageP(int, QString)));
- connect(Sepal->Trash, SIGNAL(DelPage(int)), this, SLOT(DeletePage2(int)));
- connect(Sepal, SIGNAL(GotoSeite(int)), this, SLOT(SelectFromOutlS(int)));
- connect(BookPal->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks()));
- connect(BookPal->BView, SIGNAL(ChangeBMNr(int, int, int)), this, SLOT(ChBookmarks(int, int, int)));
- connect(BookPal, SIGNAL(Schliessen()), this, SLOT(ToggleBookpal()));
- connect(recentMenu, SIGNAL(activated(int)), this, SLOT(LoadRecent(int)));
- connect(ColorMenu, SIGNAL(activated(int)), this, SLOT(setItemFarbe(int)));
- connect(ShadeMenu, SIGNAL(activated(int)), this, SLOT(setItemShade(int)));
- connect(FontMenu, SIGNAL(activated(int)), this, SLOT(setItemFont(int)));
- connect(SizeTMenu, SIGNAL(activated(int)), this, SLOT(setItemFSize(int)));
- connect(TypeStyleMenu, SIGNAL(activated(int)), this, SLOT(setItemTypeStyle(int)));
- connect(AliMenu, SIGNAL(activated(int)), this, SLOT(setItemTextAli(int)));
- connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString)));
- connect(this, SIGNAL(TextISize(int)), this, SLOT(setFSizeMenu(int)));
- connect(this, SIGNAL(TextISize(int)), Mpal, SLOT(setSize(int)));
- connect(this, SIGNAL(TextUSval(float)), Mpal, SLOT(setExtra(float)));
- connect(this, SIGNAL(TextStil(int)), Mpal, SLOT(setStil(int)));
- connect(this, SIGNAL(TextFarben(QString, QString, int, int)), Mpal->Cpal, SLOT(setActFarben(QString, QString, int, int)));
- connect(ClipB, SIGNAL(dataChanged()), this, SLOT(ClipChange()));
- }
-}
-
-void ScribusApp::initMenuBar()
-{
- int a;
- int MenID;
- QFont tmp;
- recentMenu = new QPopupMenu();
- RecentDocs.clear();
- fileMenu=new QPopupMenu();
- fid12 = fileMenu->insertItem(loadIcon("DateiNeu16.png"), tr("New"), this, SLOT(slotFileNew()), CTRL+Key_N);
- fid13 = fileMenu->insertItem(loadIcon("DateiOpen16.png"), tr("Open..."), this, SLOT(slotDocOpen()), CTRL+Key_O);
- fid14 = fileMenu->insertItem(tr("Recent Documents"), recentMenu);
- SetKeyEntry(0, tr("New"), fid12, CTRL+Key_N);
- SetKeyEntry(1, tr("Open..."), fid13, CTRL+Key_O);
- fileMenu->insertSeparator();
- fid1 = fileMenu->insertItem(loadIcon("DateiClos16.png"), tr("Close"), this, SLOT(slotFileClose()), CTRL+Key_W);
- SetKeyEntry(2, tr("Close"), fid1, CTRL+Key_W);
- fileMenu->setItemEnabled(fid1, 0);
- fid4 = fileMenu->insertItem(loadIcon("DateiSave16.png"), tr("Save"), this, SLOT(slotFileSave()), CTRL+Key_S);
- SetKeyEntry(3, tr("Save"), fid4, CTRL+Key_S);
- fileMenu->setItemEnabled(fid4, 0);
- fid5 = fileMenu->insertItem(tr("Save as..."), this, SLOT(slotFileSaveAs()));
- SetKeyEntry(4, tr("Save as..."), fid5, 0);
- fileMenu->setItemEnabled(fid5, 0);
- fid51 = fileMenu->insertItem(tr("Collect for Output..."), this, SLOT(Collect()));
- fileMenu->setItemEnabled(fid51, 0);
- fileMenu->insertSeparator();
- importMenu = new QPopupMenu();
- fid2 = importMenu->insertItem(tr("Get Text/Picture..."), this, SLOT(slotFileOpen()));
- importMenu->setItemEnabled(fid2, 0);
- fid2a = importMenu->insertItem(tr("Insert Page..."), this, SLOT(slotDocMerge()));
- importMenu->setItemEnabled(fid2a, 0);
- fileMenu->insertItem(tr("Import..."), importMenu);
- exportMenu = new QPopupMenu();
- fid3 = exportMenu->insertItem(tr("Save Text..."), this, SLOT(SaveText()));
- exportMenu->setItemEnabled(fid3, 0);
- fid8 = exportMenu->insertItem(tr("Save Page as EPS..."), this, SLOT(SaveAsEps()));
- exportMenu->setItemEnabled(fid8, 0);
- fid10 = exportMenu->insertItem(tr("Save as PDF..."), this, SLOT(SaveAsPDF()));
- exportMenu->setItemEnabled(fid10, 0);
- fid11 = fileMenu->insertItem(tr("Export..."), exportMenu);
- fileMenu->setItemEnabled(fid11, 0);
- fileMenu->insertSeparator();
- fid6 = fileMenu->insertItem(tr("Document Info..."), this, SLOT(InfoDoc()), CTRL+Key_I);
- fileMenu->setItemEnabled(fid6, 0);
- SetKeyEntry(5, tr("Document Info..."), fid6, CTRL+Key_I);
- fid7 = fileMenu->insertItem(tr("Document Setup..."), this, SLOT(SetupDoc()));
- fileMenu->setItemEnabled(fid7, 0);
- SetKeyEntry(6, tr("Document Setup..."), fid7, 0);
- fid9 = fileMenu->insertItem(loadIcon("DateiPrint16.png"), tr("Print..."), this, SLOT(slotFilePrint()), CTRL+Key_P);
- fileMenu->setItemEnabled(fid9, 0);
- SetKeyEntry(7, tr("Print..."), fid9, CTRL+Key_P);
- fileMenu->insertSeparator();
- MenID = fileMenu->insertItem(loadIcon("exit.png"), tr("Quit"), this, SLOT(slotFileQuit()), CTRL+Key_Q);
- SetKeyEntry(8, tr("Quit"), MenID, CTRL+Key_Q);
- editMenu = new QPopupMenu();
- edUndo = editMenu->insertItem(tr("Undo"), this, SLOT(UnDoAction()), CTRL+Key_Z);
- editMenu->insertSeparator();
- edid1 = editMenu->insertItem(loadIcon("editcut.png"), tr("Cut"), this , SLOT(slotEditCut()), CTRL+Key_X);
- edid2 = editMenu->insertItem(loadIcon("editcopy.png"), tr("Copy"), this , SLOT(slotEditCopy()), CTRL+Key_C);
- edid3 = editMenu->insertItem(loadIcon("editpaste.png"), tr("Paste"), this , SLOT(slotEditPaste()), CTRL+Key_V);
- edid4 = editMenu->insertItem(loadIcon("editdelete.png"), tr("Clear"), this, SLOT(DeleteText()));
- edid5 = editMenu->insertItem(tr("Select all"), this, SLOT(SelectAll()), CTRL+Key_A);
- SetKeyEntry(9, tr("Cut"), edid1, CTRL+Key_X);
- SetKeyEntry(10, tr("Copy"), edid2, CTRL+Key_C);
- SetKeyEntry(11, tr("Paste"), edid3, CTRL+Key_V);
- SetKeyEntry(12, tr("Clear"), edid4, 0);
- SetKeyEntry(13, tr("Select all"), edid5, CTRL+Key_A);
- editMenu->insertSeparator();
- MenID = editMenu->insertItem(tr("Colors..."), this , SLOT(slotEditColors()));
- SetKeyEntry(14, tr("Colors..."), MenID, 0);
- edid6 = editMenu->insertItem(tr("Styles..."), this , SLOT(slotEditStyles()));
- SetKeyEntry(15, tr("Styles..."), edid6, 0);
- tman = editMenu->insertItem(tr("Templates..."), this, SLOT(ManageTemp()));
- SetKeyEntry(16, tr("Templates..."), tman, 0);
- jman = editMenu->insertItem(tr("JavaScripts..."), this, SLOT(ManageJava()));
- hymen = new QPopupMenu();
- MenID = hymen->insertItem(tr("General..."), this , SLOT(slotPrefsOrg()));
- SetKeyEntry(18, tr("Preferences..."), MenID, 0);
- MenID = hymen->insertItem(tr("Fonts..."), this , SLOT(slotFontOrg()));
- SetKeyEntry(17, tr("Fonts..."), MenID, 0);
- hymen->insertItem(tr("Hyphenator..."), this, SLOT(configHyphenator()));
- editMenu->insertItem(tr("Preferences"), hymen);
- editMenu->setItemEnabled(edUndo, 0);
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid3, 0);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- editMenu->setItemEnabled(edid6, 0);
- editMenu->setItemEnabled(tman, 0);
- editMenu->setItemEnabled(jman, 0);
- StilMenu = new QPopupMenu();
- ObjMenu = new QPopupMenu();
- MenID = ObjMenu->insertItem(tr("Modify..."), this, SLOT(ModifyObject()), CTRL+Key_M);
- SetKeyEntry(19, tr("Modify..."), MenID, CTRL+Key_M);
- MenID = ObjMenu->insertItem(tr("Duplicate"), this, SLOT(ObjektDup()), CTRL+Key_D);
- SetKeyEntry(20, tr("Duplicate"), MenID, CTRL+Key_D);
- MenID = ObjMenu->insertItem(tr("Multiple Duplicate"), this, SLOT(ObjektDupM()));
- SetKeyEntry(21, tr("Multiple Duplicate"), MenID, 0);
- Loesch = ObjMenu->insertItem(tr("Delete"), this, SLOT(DeleteObjekt()), CTRL+Key_K);
- SetKeyEntry(22, tr("Delete"), Loesch, CTRL+Key_K);
- ObjMenu->insertSeparator();
- Gr = ObjMenu->insertItem(tr("Group"), this, SLOT(GroupObj()), CTRL+Key_G);
- SetKeyEntry(23, tr("Group"), Gr, CTRL+Key_G);
- UnGr = ObjMenu->insertItem(tr("Ungroup"), this, SLOT(UnGroupObj()), CTRL+Key_U);
- SetKeyEntry(24, tr("Ungroup"), UnGr, CTRL+Key_U);
- LockOb = ObjMenu->insertItem(tr("Lock"), this, SLOT(ToggleObjLock()), CTRL+Key_H);
- ObjMenu->insertSeparator();
- OBack = ObjMenu->insertItem(tr("Send to Back"), this, SLOT(Objekt2Back()));
- SetKeyEntry(25, tr("Send to Back"), OBack, 0);
- OFront = ObjMenu->insertItem(tr("Bring to Front"), this, SLOT(Objekt2Front()));
- SetKeyEntry(26, tr("Bring to Front"), OFront, 0);
- OLower = ObjMenu->insertItem(tr("Lower"), this, SLOT(ObjektLower()));
- SetKeyEntry(27, tr("Lower"), OLower, 0);
- ORaise = ObjMenu->insertItem(tr("Raise"), this, SLOT(ObjektRaise()));
- SetKeyEntry(28, tr("Raise"), ORaise, 0);
- DistM = ObjMenu->insertItem(tr("Distribute/Align..."), this, SLOT(ObjektAlign()));
- SetKeyEntry(29, tr("Distribute/Align..."), DistM, 0);
- ObjMenu->insertSeparator();
- ShapeMenu = new QPopupMenu();
- ShapeMenu->insertItem(tr("Rectangle"), this, SLOT(RectFrame()));
- ShapeMenu->insertItem(tr("Rounded Rectangle"), this, SLOT(RoundedFrame()));
- ShapeMenu->insertItem(tr("Oval"), this, SLOT(OvalFrame()));
- ShapeEdit = ShapeMenu->insertItem(tr("Edit Frame"), this, SLOT(ToggleFrameEdit()));
- ShapeM = ObjMenu->insertItem(tr("Shape"), ShapeMenu);
- PfadT = ObjMenu->insertItem(tr("Attach Text to Path"), this, SLOT(Pfadtext()));
- PfadV = ObjMenu->insertItem(tr("Combine Polygons"), this, SLOT(UniteOb()));
- PfadS = ObjMenu->insertItem(tr("Split Polygon"), this, SLOT(SplitUniteOb()));
-#ifdef HAVE_FREETYPE
- PfadTP = ObjMenu->insertItem(tr("Convert to Polygon"), this, SLOT(TraceText()));
-#endif
- ObjMenu->setItemEnabled(ShapeM, 0);
- ObjMenu->setItemEnabled(DistM, 0);
- ObjMenu->setItemEnabled(Gr, 0);
- ObjMenu->setItemEnabled(UnGr, 0);
- ObjMenu->setItemEnabled(PfadT, 0);
- ObjMenu->setItemEnabled(PfadV, 0);
- ObjMenu->setItemEnabled(PfadS, 0);
- ObjMenu->setItemEnabled(LockOb, 0);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- pageMenu = new QPopupMenu();
- MenID = pageMenu->insertItem(tr("Insert..."), this, SLOT(slotNewPageM()));
- SetKeyEntry(30, tr("Insert..."), MenID, 0);
- pgmd = pageMenu->insertItem(tr("Delete..."), this, SLOT(DeletePage()));
- SetKeyEntry(31, tr("Delete..."), pgmd, 0);
- MenID = pageMenu->insertItem(tr("Copy")+"...", this, SLOT(CopyPage()));
- SetKeyEntry(61, tr("Copy")+"...", MenID, 0);
- pgmv = pageMenu->insertItem(tr("Move..."), this, SLOT(MovePage()));
- SetKeyEntry(32, tr("Move..."), pgmv, 0);
- MenID = pageMenu->insertItem(tr("Apply Template..."), this, SLOT(ApplyTemp()));
- SetKeyEntry(33, tr("Apply Template..."), MenID, 0);
- MenID = pageMenu->insertItem(tr("Manage Guides..."), this, SLOT(ManageGuides()));
- SetKeyEntry(49, tr("Manage Guides..."), MenID, 0);
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- viewMenu=new QPopupMenu();
- MenID = viewMenu->insertItem(tr("Fit in Window"), this, SLOT(slotZoomFit()), CTRL+Key_0);
- SetKeyEntry(34, tr("Fit in Window"), MenID, CTRL+Key_0);
- MenID = viewMenu->insertItem("50%", this, SLOT(slotZoom50()));
- SetKeyEntry(35, tr("50%"), MenID, 0);
- MenID = viewMenu->insertItem("75%", this, SLOT(slotZoom75()));
- SetKeyEntry(36, tr("75%"), MenID, 0);
- MenID = viewMenu->insertItem(tr("Actual Size"), this, SLOT(slotZoom100()), CTRL+Key_1);
- SetKeyEntry(37, tr("Actual Size"), MenID, CTRL+Key_1);
- MenID = viewMenu->insertItem("200%", this, SLOT(slotZoom200()));
- SetKeyEntry(38, tr("200%"), MenID, 0);
- MenID = viewMenu->insertItem(tr("Thumbnails"), this, SLOT(slotZoom20()));
- SetKeyEntry(39, tr("Thumbnails"), MenID, 0);
- viewMenu->insertSeparator();
- Markers = viewMenu->insertItem(tr("Hide Margins"), this, SLOT(ToggleMarks()));
- SetKeyEntry(40, tr("Hide Margins"), Markers, 0);
- FrameDr = viewMenu->insertItem(tr("Hide Frames"), this, SLOT(ToggleFrames()));
- SetKeyEntry(41, tr("Hide Frames"), FrameDr, 0);
- Bilder = viewMenu->insertItem(tr("Hide Images"), this, SLOT(TogglePics()));
- SetKeyEntry(42, tr("Hide Images"), Bilder, 0);
- Ras = viewMenu->insertItem(tr("Show Grid"), this, SLOT(ToggleRaster()));
- SetKeyEntry(43, tr("Show Grid"), Ras, 0);
- uRas = viewMenu->insertItem(tr("Snap to Grid"), this, SLOT(ToggleURaster()));
- SetKeyEntry(44, tr("Snap to Grid"), uRas, 0);
- Guide = viewMenu->insertItem(tr("Hide Guides"), this, SLOT(ToggleGuides()));
- uGuide = viewMenu->insertItem(tr("Snap to Guides"), this, SLOT(ToggleUGuides()));
- for (a=0; a<6; ++a)
- {
- viewMenu->setItemEnabled(viewMenu->idAt(a), 0);
- }
- viewMenu->setItemEnabled(Markers, 0);
- viewMenu->setItemEnabled(FrameDr, 0);
- viewMenu->setItemEnabled(Bilder, 0);
- viewMenu->setItemEnabled(Ras, 0);
- viewMenu->setItemEnabled(uRas, 0);
- viewMenu->setItemEnabled(Guide, 0);
- viewMenu->setItemEnabled(uGuide, 0);
- toolMenu=new QPopupMenu();
- viewTools = toolMenu->insertItem(tr("Hide Tools"), this, SLOT(ToggleTools()));
- SetKeyEntry(45, tr("Hide Tools"), viewTools, 0);
- viewMpal = toolMenu->insertItem(tr("Show Measurements"), this, SLOT(ToggleMpal()));
- SetKeyEntry(46, tr("Show Measurements"), viewMpal, 0);
- viewTpal = toolMenu->insertItem(tr("Show Outline"), this, SLOT(ToggleTpal()));
- SetKeyEntry(47, tr("Show Outline"), viewTpal, 0);
- viewBpal = toolMenu->insertItem(tr("Show Scrapbook"), this, SLOT(ToggleBpal()));
- SetKeyEntry(48, tr("Show Scrapbook"), viewBpal, 0);
- viewLpal = toolMenu->insertItem(tr("Show Layers"), this, SLOT(ToggleLpal()));
- viewSepal = toolMenu->insertItem(tr("Show Page Palette"), this, SLOT(ToggleSepal()));
- viewBopal = toolMenu->insertItem(tr("Show Bookmarks"), this, SLOT(ToggleBookpal()));
- extraMenu=new QPopupMenu();
- MenID = extraMenu->insertItem(tr("Manage Pictures"), this, SLOT(StatusPic()));
- SetKeyEntry(51, tr("Manage Pictures"), MenID, 0);
- hyph = extraMenu->insertItem(tr("Hyphenate Text"), this, SLOT(doHyphenate()));
- extraMenu->setItemEnabled(hyph, 0);
- SetKeyEntry(50, tr("Hyphenate Text"), hyph, 0);
- windowsMenu = new QPopupMenu();
- windowsMenu->setCheckable( true );
- connect(windowsMenu, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow()));
- helpMenu=new QPopupMenu();
- MenID = helpMenu->insertItem(tr("About Scribus"), this, SLOT(slotHelpAbout()));
- SetKeyEntry(52, tr("About Scribus"), MenID, 0);
- MenID = helpMenu->insertItem(tr("About Qt"), this, SLOT(slotHelpAboutQt()));
- SetKeyEntry(53, tr("About Qt"), MenID, 0);
- helpMenu->insertSeparator();
- MenID = helpMenu->insertItem(tr("Online-Help..."), this, SLOT(slotOnlineHelp()));
- SetKeyEntry(54, tr("Online-Help..."), MenID, 0);
- tip = helpMenu->insertItem(tr("Tool-Tips"), this, SLOT(ToggleTips()));
- SetKeyEntry(55, tr("Tool-Tips"), tip, 0);
- tipsOn = true;
- helpMenu->setItemChecked(tip, tipsOn);
-// helpMenu->insertItem(tr("Test"), this, SLOT(slotTest()));
-// helpMenu->insertItem(tr("Test2"), this, SLOT(slotTest2()));
- menuBar()->insertItem(tr("File"), fileMenu);
- menuBar()->insertItem(tr("Edit"), editMenu);
- Stm = menuBar()->insertItem(tr("Style"), StilMenu);
- Obm = menuBar()->insertItem(tr("Item"), ObjMenu);
- pgmm = menuBar()->insertItem(tr("Page"), pageMenu);
- menuBar()->setItemEnabled(Obm, 0);
- menuBar()->setItemEnabled(pgmm, 0);
- menuBar()->insertItem(tr("View"), viewMenu);
- menuBar()->insertItem(tr("Tools"), toolMenu);
- exmn = menuBar()->insertItem(tr("Extras"), extraMenu);
- menuBar()->setItemEnabled(exmn, 0);
- menuBar()->insertItem( tr("Windows"), windowsMenu );
- menuBar()->insertSeparator();
- menuBar()->insertItem(tr("Help"), helpMenu);
- AliMenu = new QPopupMenu();
- AliMenu->insertItem(tr("Left"));
- AliMenu->insertItem(tr("Center"));
- AliMenu->insertItem(tr("Right"));
- AliMenu->insertItem(tr("Block"));
- AliMenu->insertItem(tr("Forced"));
- ColorMenu = new QPopupMenu();
- SizeTMenu = new QPopupMenu();
- SizeTMenu->insertItem(tr("Other..."));
- SizeTMenu->insertItem(" 7 pt");
- SizeTMenu->insertItem(" 9 pt");
- SizeTMenu->insertItem("10 pt");
- SizeTMenu->insertItem("12 pt");
- SizeTMenu->insertItem("14 pt");
- SizeTMenu->insertItem("18 pt");
- SizeTMenu->insertItem("24 pt");
- SizeTMenu->insertItem("36 pt");
- SizeTMenu->insertItem("48 pt");
- SizeTMenu->insertItem("60 pt");
- SizeTMenu->insertItem("72 pt");
- ShadeMenu = new QPopupMenu();
- ShadeMenu->insertItem(tr("Other..."));
- ShadeMenu->insertItem("0 %");
- ShadeMenu->insertItem("10 %");
- ShadeMenu->insertItem("20 %");
- ShadeMenu->insertItem("30 %");
- ShadeMenu->insertItem("40 %");
- ShadeMenu->insertItem("50 %");
- ShadeMenu->insertItem("60 %");
- ShadeMenu->insertItem("70 %");
- ShadeMenu->insertItem("80 %");
- ShadeMenu->insertItem("90 %");
- ShadeMenu->insertItem("100 %");
- FStyleMenu = new QPopupMenu();
- FontMenu = new QPopupMenu();
- TypeStyleMenu = new QPopupMenu();
- TypeStyleMenu->insertItem(tr("Normal"));
- tmp = qApp->font();
- tmp = qApp->font();
- tmp.setUnderline(true);
- TypeStyleMenu->insertItem(new FmItem(tr("Underline"), tmp));
- tmp = qApp->font();
- tmp.setStrikeOut(true);
- TypeStyleMenu->insertItem(new FmItem(tr("Strikethru"), tmp));
- TypeStyleMenu->insertItem(tr("Small Caps"));
- TypeStyleMenu->insertItem(tr("Superscript"));
- TypeStyleMenu->insertItem(tr("Subscript"));
-}
-
-void ScribusApp::initStatusBar()
-{
- FMess = new QLabel(statusBar(), "ft");
- FMess->setText(" ");
- statusBar()->addWidget(FMess, 3, true);
- FProg = new QProgressBar(statusBar(), "p");
- FProg->setCenterIndicator(true);
- FProg->setFixedWidth( 100 );
- statusBar()->addWidget(FProg, 0, true);
- FProg->reset();
- XMess = new QLabel(statusBar(), "xt");
- XMess->setText(tr("X-Pos:"));
- statusBar()->addWidget(XMess, 0, true);
- XDat = new QLabel(statusBar(), "dt");
- statusBar()->addWidget(XDat, 1, true);
- XDat->setText(" ");
- YMess = new QLabel(statusBar(), "yt");
- YMess->setText(tr("Y-Pos:"));
- statusBar()->addWidget(YMess, 0, true);
- YDat = new QLabel(statusBar(), "ydt");
- statusBar()->addWidget(YDat, 1, true);
- YDat->setText(" ");
-}
-
-void ScribusApp::ReportMP(float xp, float yp)
-{
- QString tmp, tmp2;
- switch (doc->Einheit)
- {
- case 0:
- tmp2 = " pt";
- break;
- case 1:
- tmp2 = " mm";
- break;
- case 2:
- tmp2 = " in";
- break;
- case 3:
- tmp2 = " p";
- break;
- }
- XDat->setText(tmp.setNum(qRound(xp*UmReFaktor * 100) / 100.0, 'f', 2)+tmp2);
- YDat->setText(tmp.setNum(qRound(yp*UmReFaktor * 100) / 100.0, 'f', 2)+tmp2);
-}
-
-void ScribusApp::SetKeyEntry(int Nr, QString text, int Men, int KeyC)
-{
- Keys ke;
- ke.Name = text;
- ke.MenuID = Men;
- ke.KeyID = KeyC;
- Prefs.KeyActions.insert(Nr, ke);
-}
-
-void ScribusApp::DeleteSel(PageItem *b)
-{
- Pti *it;
- for (it = b->Ptext.first(); it != 0; it = b->Ptext.next())
- {
- if (it->cselect)
- {
- b->Ptext.remove();
- it = b->Ptext.prev();
- if (it == 0)
- {
- it = b->Ptext.first();
- }
- }
- }
- if (b->Ptext.count() != 0)
- {
- if (b->Ptext.first()->cselect)
- {
- b->Ptext.remove();
- b->CPos = 0;
- }
- else
- b->CPos = QMIN(b->CPos, doc->ActPage->oldCp);
- }
- else
- b->CPos = 0;
- b->HasSel = false;
- DisableTxEdit();
-}
-
-void ScribusApp::setTBvals(PageItem *b)
-{
- if (b->Ptext.count() != 0)
- {
- emit TextIFont(b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cfont);
- emit TextISize(b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->csize);
- emit TextUSval(b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cextra);
- emit TextStil(b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cstyle & 127);
- doc->CurrentStyle = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cstyle & 127;
- doc->CurrentABStil = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cab;
- setAbsValue(doc->CurrentABStil);
- Mpal->setAli(doc->CurrentABStil);
- b->IFont = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cfont;
- b->ISize = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->csize;
- emit TextFarben(b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->ccolor,
- b->Pcolor,
- b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cshade,
- b->Shade);
- b->Pcolor2 = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->ccolor;
- b->Shade2 = b->Ptext.at(QMIN(b->CPos, static_cast<int>(b->Ptext.count()-1)))->cshade;
- }
-}
-
-void ScribusApp::wheelEvent(QWheelEvent *w)
-{
- if (HaveDoc)
- {
- if (w->delta() < 0)
- view->scrollBy(0, Prefs.Wheelval);
- else
- view->scrollBy(0, -Prefs.Wheelval);
- w->accept();
- }
-}
-
-void ScribusApp::keyPressEvent(QKeyEvent *k)
-{
- struct Pti *hg;
- int kk = k->key();
- int as = k->ascii();
- float altx, alty;
- QString uc = k->text();
- QString cr, Tcha, Twort;
- uint Tcoun;
- switch (k->state())
- {
- case ShiftButton:
- KeyMod = 0x00200000;
- break;
- case AltButton:
- KeyMod = 0x00800000;
- break;
- case ControlButton:
- KeyMod = 0x00400000;
- break;
- default:
- KeyMod = 0;
- }
- if ((HaveDoc) && (!view->LE->hasFocus()))
- {
- switch (kk)
- {
- case Key_Prior:
- view->scrollBy(0, -Prefs.Wheelval);
- return;
- break;
- case Key_Next:
- view->scrollBy(0, Prefs.Wheelval);
- return;
- break;
- }
- if (doc->ActPage->SelItem.count() != 0)
- {
- PageItem *b = doc->ActPage->SelItem.at(0);
- switch (doc->AppMode)
- {
- case 1:
- switch (kk)
- {
- case Key_Delete:
- if (!doc->EditClip)
- {
- if (!b->Locked)
- doc->ActPage->DeleteItem();
- }
- break;
- case Key_Left:
- if (!k->isAutoRepeat())
- {
- doc->ActPage->storeUndoInf(b);
- doc->UnData.UnCode = 1;
- doc->UnDoValid = true;
- CanUndo();
- }
- if (!b->Locked)
- doc->ActPage->moveGroup(-1, 0);
- break;
- case Key_Right:
- if (!k->isAutoRepeat())
- {
- doc->ActPage->storeUndoInf(b);
- doc->UnData.UnCode = 1;
- doc->UnDoValid = true;
- CanUndo();
- }
- if (!b->Locked)
- doc->ActPage->moveGroup(1, 0);
- break;
- case Key_Up:
- if (!k->isAutoRepeat())
- {
- doc->ActPage->storeUndoInf(b);
- doc->UnData.UnCode = 1;
- doc->UnDoValid = true;
- CanUndo();
- }
- if (!b->Locked)
- doc->ActPage->moveGroup(0, -1);
- break;
- case Key_Down:
- if (!k->isAutoRepeat())
- {
- doc->ActPage->storeUndoInf(b);
- doc->UnData.UnCode = 1;
- doc->UnDoValid = true;
- CanUndo();
- }
- if (!b->Locked)
- doc->ActPage->moveGroup(0, 1);
- default:
- if (b->PType == 4)
- {
- if ((kk + KeyMod) == Prefs.KeyActions[59].KeyID)
- {
- setNewAbStyle(1);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- }
- if ((kk + KeyMod) == Prefs.KeyActions[58].KeyID)
- {
- setNewAbStyle(2);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- }
- if ((kk + KeyMod) == Prefs.KeyActions[57].KeyID)
- {
- setNewAbStyle(0);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- }
- }
- break;
- }
- slotDocCh();
- break;
- case 7:
- if (b->PType == 4)
- {
- doc->ActPage->slotDoCurs(false);
- switch (kk)
- {
- case Key_Down:
- if (b->CPos != static_cast<int>(b->Ptext.count()))
- {
- alty = b->Ptext.at(b->CPos)->yp;
- altx = b->Ptext.at(b->CPos)->xp;
- do
- {
- b->CPos += 1;
- if (b->CPos == static_cast<int>(b->Ptext.count()))
- break;
- if (b->Ptext.at(b->CPos)->yp > alty)
- {
- if (b->Ptext.at(b->CPos)->xp >= altx)
- break;
- }
- }
- while (b->CPos < static_cast<int>(b->Ptext.count()));
- if (b->CPos == static_cast<int>(b->Ptext.count()))
- if (b->NextBox != 0)
- {
- if (b->NextBox->Ptext.count() != 0)
- {
- b->OwnPage->Deselect(true);
- b->NextBox->CPos = 0;
- doc->ActPage = b->NextBox->OwnPage;
- b->NextBox->OwnPage->SelectItemNr(b->NextBox->ItemNr);
- b = b->NextBox;
- }
- }
- }
- else
- {
- if (b->NextBox != 0)
- {
- if (b->NextBox->Ptext.count() != 0)
- {
- b->OwnPage->Deselect(true);
- b->NextBox->CPos = 0;
- doc->ActPage = b->NextBox->OwnPage;
- b->NextBox->OwnPage->SelectItemNr(b->NextBox->ItemNr);
- b = b->NextBox;
- }
- }
- }
- setTBvals(b);
- break;
- case Key_Up:
- if (b->CPos > 0)
- {
- if (b->CPos == static_cast<int>(b->Ptext.count()))
- b->CPos -= 1;
- alty = b->Ptext.at(b->CPos)->yp;
- altx = b->Ptext.at(b->CPos)->xp;
- if (b->CPos > 0)
- {
- do
- {
- b->CPos -= 1;
- if (b->CPos == 0)
- break;
- if (b->Ptext.at(b->CPos)->yp < alty)
- {
- if (b->Ptext.at(b->CPos)->xp <= altx)
- break;
- }
- }
- while (b->CPos > 0);
- }
- if (b->CPos == 0)
- {
- if (b->BackBox != 0)
- {
- b->OwnPage->Deselect(true);
- b->BackBox->CPos = b->BackBox->Ptext.count();
- doc->ActPage = b->BackBox->OwnPage;
- b->BackBox->OwnPage->SelectItemNr(b->BackBox->ItemNr);
- b = b->BackBox;
- }
- }
- }
- else
- {
- b->CPos = 0;
- if (b->BackBox != 0)
- {
- b->OwnPage->Deselect(true);
- b->BackBox->CPos = b->BackBox->Ptext.count();
- doc->ActPage = b->BackBox->OwnPage;
- b->BackBox->OwnPage->SelectItemNr(b->BackBox->ItemNr);
- b = b->BackBox;
- }
- }
- setTBvals(b);
- break;
- case Key_Home:
- b->CPos = 0;
- setTBvals(b);
- break;
- case Key_End:
- b->CPos = static_cast<int>(b->Ptext.count());
- setTBvals(b);
- break;
- case Key_Left:
- b->CPos -= 1;
- if (b->CPos < 0)
- {
- b->CPos = 0;
- if (b->BackBox != 0)
- {
- b->OwnPage->Deselect(true);
- b->BackBox->CPos = b->BackBox->Ptext.count();
- doc->ActPage = b->BackBox->OwnPage;
- b->BackBox->OwnPage->SelectItemNr(b->BackBox->ItemNr);
- b = b->BackBox;
- }
- }
- setTBvals(b);
- break;
- case Key_Right:
- b->CPos += 1;
- if (b->CPos > static_cast<int>(b->Ptext.count()))
- {
- b->CPos -= 1;
- if (b->NextBox != 0)
- {
- if (b->NextBox->Ptext.count() != 0)
- {
- b->OwnPage->Deselect(true);
- b->NextBox->CPos = 0;
- doc->ActPage = b->NextBox->OwnPage;
- b->NextBox->OwnPage->SelectItemNr(b->NextBox->ItemNr);
- b = b->NextBox;
- }
- }
- }
- setTBvals(b);
- break;
- case Key_Delete:
- if (b->CPos == static_cast<int>(b->Ptext.count())) { return; }
- if (b->Ptext.count() == 0) { return; }
- cr = b->Ptext.at(b->CPos)->ch;
- if (b->HasSel)
- {
- DeleteSel(b);
- }
- else
- {
- b->Ptext.remove(b->CPos);
- }
- b->Tinput = false;
- if ((cr == QChar(13)) && (b->Ptext.count() != 0))
- {
- doc->ActPage->chAbStyle(b, b->Ptext.at(QMAX(b->CPos-1,0))->cab);
- b->Tinput = false;
- }
- setTBvals(b);
- b->Dirty = true;
- b->paintObj();
- break;
- case Key_Backspace:
- if (b->CPos == 0)
- return;
- if (b->Ptext.count() == 0) { return; }
- cr = b->Ptext.at(QMAX(b->CPos-1,0))->ch;
- if (b->HasSel)
- {
- DeleteSel(b);
- }
- else
- {
- b->CPos -= 1;
- b->Ptext.remove(b->CPos);
- }
- b->Tinput = false;
- if ((cr == QChar(13)) && (b->Ptext.count() != 0))
- {
- doc->ActPage->chAbStyle(b, b->Ptext.at(QMAX(b->CPos-1,0))->cab);
- b->Tinput = false;
- }
- setTBvals(b);
- b->Dirty = true;
- b->paintObj();
- break;
- default:
- if ((b->HasSel) && (kk < 0x1000))
- {
- DeleteSel(b);
- b->Dirty = true;
- b->paintObj();
- }
- if ((kk + KeyMod) == Prefs.KeyActions[60].KeyID)
- {
- hg = new Pti;
- hg->ch = QString(QChar(30));
- hg->cfont = b->IFont;
- hg->csize = b->ISize;
- hg->ccolor = b->Pcolor2;
- hg->cextra = 0;
- hg->cshade = b->Shade2;
- hg->cselect = false;
- hg->cstyle = doc->CurrentStyle;
- hg->cab = doc->CurrentABStil;
- if (doc->Vorlagen[doc->CurrentABStil].Font != "")
- {
- hg->cfont = doc->Vorlagen[doc->CurrentABStil].Font;
- hg->csize = doc->Vorlagen[doc->CurrentABStil].FontSize;
- }
- hg->xp = 0;
- hg->yp = 0;
- hg->PRot = 0;
- hg->PtransX = 0;
- hg->PtransY = 0;
- b->Ptext.insert(b->CPos, hg);
- b->CPos += 1;
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- break;
- }
- if ((kk + KeyMod) == Prefs.KeyActions[56].KeyID)
- {
- b->Ptext.at(QMAX(b->CPos-1,0))->cstyle ^= 128;
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- break;
- }
- if ((kk + KeyMod) == Prefs.KeyActions[59].KeyID)
- {
- setNewAbStyle(1);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- break;
- }
- if ((kk + KeyMod) == Prefs.KeyActions[57].KeyID)
- {
- setNewAbStyle(0);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- break;
- }
- if ((kk + KeyMod) == Prefs.KeyActions[58].KeyID)
- {
- setNewAbStyle(2);
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- break;
- }
-#ifdef HAVE_FREETYPE
- if (((uc[0] > QChar(31)) || (as == 13) || (as == 30)) && ((*doc->AllFonts)[b->IFont]->CharWidth.contains(uc[0].unicode())))
-#else
- if ((uc[0] > QChar(31)) || (as == 13) || (as == 30))
-#endif
- {
- hg = new Pti;
- hg->ch = uc;
- hg->cfont = b->IFont;
- hg->csize = b->ISize;
- hg->ccolor = b->Pcolor2;
- hg->cextra = 0;
- hg->cshade = b->Shade2;
- hg->cselect = false;
- hg->cstyle = doc->CurrentStyle;
- hg->cab = doc->CurrentABStil;
- if (doc->Vorlagen[doc->CurrentABStil].Font != "")
- {
- hg->cfont = doc->Vorlagen[doc->CurrentABStil].Font;
- hg->csize = doc->Vorlagen[doc->CurrentABStil].FontSize;
- }
- hg->xp = 0;
- hg->yp = 0;
- hg->PRot = 0;
- hg->PtransX = 0;
- hg->PtransY = 0;
- b->Ptext.insert(b->CPos, hg);
- b->CPos += 1;
- if ((doc->Trenner->AutoCheck) && (b->CPos > 1))
- {
- Twort = "";
- Tcoun = 0;
- for (int hych = b->CPos-1; hych > -1; hych--)
- {
- Tcha = b->Ptext.at(hych)->ch;
- if (Tcha == " ")
- {
- Tcoun = hych+1;
- break;
- }
- Twort.prepend(Tcha);
- }
- if (Twort != "")
- {
- doc->Trenner->slotHyphenateWord(b, Twort, Tcoun);
- b->Dirty = true;
- }
- }
- if ((b->CPos < static_cast<int>(b->Ptext.count())) || (as == 30))
- b->Dirty = true;
- b->Tinput = true;
- b->paintObj();
- }
- break;
- }
- if (b->Ptext.count() != 0)
- if (b->Ptext.at(QMAX(b->CPos-1, 0))->yp != 0)
- doc->ActPage->slotDoCurs(true);
- if ((kk == Key_Left) || (kk == Key_Right) || (kk == Key_Up) || (kk == Key_Down))
- return;
- }
- slotDocCh(false);
- break;
- }
- }
- }
-}
-
-void ScribusApp::closeEvent(QCloseEvent *ce)
-{
- QWidgetList windows = wsp->windowList();
- ScribusWin* tw;
- if (!windows.isEmpty())
- {
- for ( int i = 0; i < static_cast<int>(windows.count()); ++i )
- {
- newActWin(windows.at(i));
- tw = ActWin;
- ActWin->close();
- if (tw == ActWin)
- {
- ce->ignore();
- return;
- }
- }
- SavePrefs();
- if (Prefs.SaveAtQ)
- {
- if (ScBook->ScFilename.isEmpty())
- ScBook->ScFilename = PrefsPfad+"/scrap.scs";
- ScBook->Save();
- }
- if (ScBook->BibWin->Objekte.count() == 0)
- system("rm -f " + PrefsPfad+"/scrap.scs");
- Prefs.AvailFonts.~SCFonts();
- FinalizePlugs();
- exit(0);
- }
- else
- {
- SavePrefs();
- if (Prefs.SaveAtQ)
- {
- if (ScBook->ScFilename.isEmpty())
- ScBook->ScFilename = PrefsPfad+"/scrap.scs";
- ScBook->Save();
- }
- if (ScBook->BibWin->Objekte.count() == 0)
- system("rm -f " + PrefsPfad+"/scrap.scs");
- qApp->setOverrideCursor(QCursor(ArrowCursor), true);
- Prefs.AvailFonts.~SCFonts();
- FinalizePlugs();
- exit(0);
- }
-}
-
-/////////////////////////////////////////////////////////////////////
-// SLOT IMPLEMENTATION
-/////////////////////////////////////////////////////////////////////
-float ScribusApp::mm2pts(int mm)
-{
- return mm / 25.4 * 72;
-}
-
-float ScribusApp::pts2mm(float pts)
-{
- return pts / 72 * 25.4;
-}
-
-bool ScribusApp::slotFileNew()
-{
- float b, h, tpr, lr, rr, br, sp, ab;
- bool fp, atf, ret;
- NewDoc* dia = new NewDoc(this, &Prefs);
- if (dia->exec())
- {
- tpr = dia->Top;
- lr = dia->Left;
- rr = dia->Right;
- br = dia->Bottom;
- ab = dia->Dist;
- b = dia->Pagebr;
- h = dia->Pageho;
- sp = dia->SpinBox10->value();
- atf = dia->AutoFrame->isChecked();
- fp = dia->Doppelseiten->isChecked();
- if (dia->ComboBox3->currentItem() == 1)
- {
- b = mm2pts(qRound(pts2mm(dia->Pagebr)));
- h = mm2pts(qRound(pts2mm(dia->Pageho)));
- }
- ret = doFileNew(b, h, tpr, lr, rr, br, ab, sp, atf, fp, dia->ComboBox3->currentItem(),
- dia->ErsteSeite->isChecked(), dia->Orient, dia->PgNr->value());
- FMess->setText(tr("Ready"));
- }
- else
- ret = false;
- delete dia;
- return ret;
-}
-
-bool ScribusApp::doFileNew(float b, float h, float tpr, float lr, float rr, float br, float ab, float sp,
- bool atf, bool fp, int einh, bool firstleft, int Ori, int SNr)
-{
- QString cc;
- doc = new ScribusDoc();
- doc->Einheit = einh;
- if (fp)
- doc->FirstPageLeft = firstleft;
- doc->PageOri = Ori;
- doc->FirstPnum = SNr;
- doc->AllFonts = &Prefs.AvailFonts;
- doc->AddFont(Prefs.DefFont, Prefs.AvailFonts[Prefs.DefFont]->Font);
- doc->Dfont = Prefs.DefFont;
- doc->Dsize = Prefs.DefSize;
- doc->GrabRad = Prefs.GrabRad;
- doc->GuideRad = Prefs.GuideRad;
- doc->minorGrid = Prefs.DminGrid;
- doc->majorGrid = Prefs.DmajGrid;
- doc->minorColor = Prefs.DminColor;
- doc->majorColor = Prefs.DmajColor;
- doc->papColor = Prefs.DpapColor;
- doc->margColor = Prefs.DmargColor;
- doc->guideColor = Prefs.guideColor;
- doc->VHoch = Prefs.DVHoch;
- doc->VHochSc = Prefs.DVHochSc;
- doc->VTief = Prefs.DVTief;
- doc->VTiefSc = Prefs.DVTiefSc;
- doc->VKapit = Prefs.DVKapit;
- doc->Dpen = Prefs.Dpen;
- doc->DpenText = Prefs.DpenText;
- doc->Dbrush = Prefs.Dbrush;
- doc->Dshade = Prefs.Dshade;
- doc->Dshade2 = Prefs.Dshade2;
- doc->DLineArt = PenStyle(Prefs.DLineArt);
- doc->Dwidth = Prefs.Dwidth;
- doc->DpenLine = Prefs.DpenLine;
- doc->DshadeLine = Prefs.DshadeLine;
- doc->DLstyleLine = PenStyle(Prefs.DLstyleLine);
- doc->DwidthLine = Prefs.DwidthLine;
- doc->MagMin = Prefs.MagMin;
- doc->MagMax = Prefs.MagMax;
- doc->MagStep = Prefs.MagStep;
- doc->DbrushPict = Prefs.DbrushPict;
- doc->ShadePict = Prefs.ShadePict;
- doc->ScaleX = Prefs.ScaleX;
- doc->ScaleY = Prefs.ScaleY;
- doc->ScaleType = Prefs.ScaleType;
- doc->AspectRatio = Prefs.AspectRatio;
- doc->Before = Prefs.Before;
- doc->PagesSbS = Prefs.PagesSbS;
- doc->ShFrames = Prefs.ShFrames;
- doc->RandFarbig = Prefs.RandFarbig;
- doc->AutoLine = Prefs.AutoLine;
- doc->DocName = doc->DocName+cc.setNum(DocNr);
- doc->HasCMS = true;
- doc->CMSSettings.DefaultInputProfile = Prefs.DCMSset.DefaultInputProfile;
- doc->CMSSettings.DefaultInputProfile2 = Prefs.DCMSset.DefaultInputProfile2;
- doc->CMSSettings.DefaultMonitorProfile = Prefs.DCMSset.DefaultMonitorProfile;
- doc->CMSSettings.DefaultPrinterProfile = Prefs.DCMSset.DefaultPrinterProfile;
- doc->CMSSettings.DefaultIntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- doc->CMSSettings.DefaultIntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
- doc->CMSSettings.DefaultIntentMonitor2 = Prefs.DCMSset.DefaultIntentMonitor2;
- doc->CMSSettings.SoftProofOn = Prefs.DCMSset.SoftProofOn;
- doc->CMSSettings.GamutCheck = Prefs.DCMSset.GamutCheck;
- doc->CMSSettings.CMSinUse = Prefs.DCMSset.CMSinUse;
- doc->PDF_Optionen.SolidProf = doc->CMSSettings.DefaultInputProfile2;
- doc->PDF_Optionen.ImageProf = doc->CMSSettings.DefaultInputProfile;
- doc->PDF_Optionen.PrintProf = doc->CMSSettings.DefaultPrinterProfile;
- doc->PDF_Optionen.Intent = doc->CMSSettings.DefaultIntentMonitor;
- doc->PDF_Optionen.Intent2 = doc->CMSSettings.DefaultIntentMonitor2;
- doc->ActiveLayer = 0;
- HaveDoc++;
- DocNr++;
- doc->Scale = 1.0;
- doc->AppMode = 1;
- doc->Language = Prefs.Language;
- doc->MinWordLen = Prefs.MinWordLen;
- doc->Automatic = Prefs.Automatic;
- doc->AutoCheck = Prefs.AutoCheck;
- doc->PageColors = Prefs.DColors;
- ScribusWin* w = new ScribusWin(wsp, doc);
- view = new ScribusView(w, doc, &Prefs);
- w->setView(view);
- ActWin = w;
- w->setCentralWidget(view);
- connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
- connect(w, SIGNAL(SaveAndClose()), this, SLOT(DoSaveClose()));
- if (CMSavail)
- {
-#ifdef HAVE_CMS
- w->SoftProofing = Prefs.DCMSset.SoftProofOn;
- w->Gamut = Prefs.DCMSset.GamutCheck;
- CMSuse = Prefs.DCMSset.CMSinUse;
- w->IntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- w->IntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
- SoftProofing = Prefs.DCMSset.SoftProofOn;
- Gamut = Prefs.DCMSset.GamutCheck;
- IntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- IntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
- w->OpenCMSProfiles(InputProfiles, MonitorProfiles, PrinterProfiles);
- stdProof = w->stdProof;
- stdTrans = w->stdTrans;
- stdProofImg = w->stdProofImg;
- stdTransImg = w->stdTransImg;
- CMSoutputProf = doc->DocOutputProf;
- CMSprinterProf = doc->DocPrinterProf;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsInput2 = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsPrinter = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsPrinter = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsPrinter = 3;
- doc->PDF_Optionen.SComp = doc->CMSSettings.ComponentsInput2;
-#endif
- if (Prefs.DCMSset.CMSinUse)
- RecalcColors();
- }
- doc->setPage(b, h, tpr, lr, rr, br, sp, ab, atf, fp);
- slotNewPage(0);
- HaveNewDoc();
- view->Pages.at(0)->parentWidget()->hide();
- view->DocPages = view->Pages;
- view->Pages = view->MasterPages;
- doc->PageC = view->MasterPages.count();
- bool atfb = doc->PageAT;
- doc->PageAT = false;
- slotNewPage(0);
- doc->PageAT = atfb;
- view->MasterNames["Normal"] = 0;
- view->Pages.at(0)->PageNam = "Normal";
- view->Pages.at(0)->parentWidget()->hide();
- view->MasterPages = view->Pages;
- doc->PageC = view->DocPages.count();
- view->Pages = view->DocPages;
- doc->MasterP = false;
- view->Pages.at(0)->MPageNam = "Normal";
- view->Pages.at(0)->parentWidget()->show();
- doc->setUnModified();
- doc->loading = false;
- doc->ActPage = view->Pages.at(0);
- Tpal->BuildTree(view);
- Sepal->Rebuild();
- BookPal->BView->clear();
- if ( wsp->windowList().isEmpty() )
- w->showMaximized();
- else
- w->show();
- view->show();
- connect(doc->ASaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
- doc->AutoSave = Prefs.AutoSave;
- if (doc->AutoSave)
- doc->ASaveTimer->start(Prefs.AutoSaveTime);
- return true;
-}
-
-void ScribusApp::DoSaveClose()
-{
- slotFileSaveAs();
- DoFileClose();
-}
-
-void ScribusApp::windowsMenuAboutToShow()
-{
- windowsMenu->clear();
- int cascadeId = windowsMenu->insertItem(tr("Cascade"), wsp, SLOT(cascade() ) );
- int tileId = windowsMenu->insertItem(tr("Tile"), wsp, SLOT(tile() ) );
- if ( wsp->windowList().isEmpty() )
- {
- windowsMenu->setItemEnabled( cascadeId, false );
- windowsMenu->setItemEnabled( tileId, false );
- }
- windowsMenu->insertSeparator();
- QWidgetList windows = wsp->windowList();
- for ( int i = 0; i < static_cast<int>(windows.count()); ++i )
- {
- int id = windowsMenu->insertItem(windows.at(i)->caption(), this, SLOT(windowsMenuActivated(int)));
- windowsMenu->setItemParameter( id, i );
- windowsMenu->setItemChecked( id, wsp->activeWindow() == windows.at(i) );
- }
-}
-
-void ScribusApp::newActWin(QWidget *w)
-{
- ScribusWin* swin;
- if (w == NULL)
- {
- ActWin = NULL;
- return;
- }
- ActWin = (ScribusWin*)w;
- doc = ActWin->doc;
- view = ActWin->view;
- Sepal->SetView(view);
- if (!doc->loading)
- {
- SwitchWin();
- QWidgetList windows = wsp->windowList();
- for ( int i = 0; i < static_cast<int>(windows.count()); ++i )
- {
- swin = (ScribusWin*)windows.at(i);
- if (swin->muster != NULL)
- swin->muster->hide();
- }
- if (doc->TemplateMode)
- ActWin->muster->show();
- setAppMode(doc->AppMode);
- }
- w->setFocus();
- if (w->isMaximized())
- wsp->setScrollBarsEnabled(false);
- else
- wsp->setScrollBarsEnabled(true);
- Sepal->Rebuild();
- Tpal->BuildTree(view);
- BookPal->BView->NrItems = ActWin->NrItems;
- BookPal->BView->First = ActWin->First;
- BookPal->BView->Last = ActWin->Last;
- RestoreBookMarks();
-}
-
-void ScribusApp::windowsMenuActivated( int id )
-{
- QWidget* w = wsp->windowList().at( id );
- if ( w )
- w->showNormal();
- newActWin(w);
-}
-
-bool ScribusApp::SetupDoc()
-{
- float tpr = doc->PageM.Top;
- float lr = doc->PageM.Left;
- float rr = doc->PageM.Right;
- float br = doc->PageM.Bottom;
- bool fp = doc->PageFP;
- bool fpe = doc->FirstPageLeft;
- float tpr2, lr2, rr2, br2;
- bool ret = false;
- ReformDoc* dia = new ReformDoc(this, tpr, lr, rr, br, fp, fpe, doc->Einheit);
- if (dia->exec())
- {
- tpr2 = dia->TopR->value() / UmReFaktor / 100.0;
- lr2 = dia->LeftR->value() / UmReFaktor / 100.0;
- rr2 = dia->RightR->value() / UmReFaktor / 100.0;
- br2 = dia->BottomR->value() / UmReFaktor / 100.0;
- fp = dia->Doppelseiten->isChecked();
- if (fp)
- doc->FirstPageLeft = dia->ErsteSeite->isChecked();
- doc->resetPage(tpr2, lr2, rr2, br2, fp);
- view->reformPages();
- doc->setModified();
- view->GotoPage(doc->ActPage->PageNr);
- view->DrawNew();
- Sepal->RebuildPage();
- ret = true;
- doc->PDF_Optionen.BleedBottom = doc->PageM.Bottom;
- doc->PDF_Optionen.BleedTop = doc->PageM.Top;
- doc->PDF_Optionen.BleedLeft = doc->PageM.Left;
- doc->PDF_Optionen.BleedRight = doc->PageM.Right;
- }
- delete dia;
- return ret;
-}
-
-void ScribusApp::SwitchWin()
-{
- int a;
- CListe::Iterator it;
- QPixmap pm = QPixmap(15, 15);
- a = 0;
- ColorMenu->clear();
- ColorMenu->insertItem(tr("None"));
- for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
- {
- pm.fill(doc->PageColors[it.key()].getRGBColor());
- ColorMenu->insertItem(QIconSet(pm), it.key());
- if (it.key() == doc->Dbrush)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), true);
- }
- a++;
- }
- BuildFontMenu();
-#ifdef HAVE_CMS
- SoftProofing = ActWin->SoftProofing;
- Gamut = ActWin->Gamut;
- IntentPrinter = ActWin->IntentPrinter;
- IntentMonitor = ActWin->IntentMonitor;
- stdProof = ActWin->stdProof;
- stdTrans = ActWin->stdTrans;
- stdProofImg = ActWin->stdProofImg;
- stdTransImg = ActWin->stdTransImg;
- CMSoutputProf = doc->DocOutputProf;
- CMSprinterProf = doc->DocPrinterProf;
-#endif
- Mpal->Cpal->SetColors(doc->PageColors);
- Mpal->Cpal->ChooseGrad(0);
- ActWin->setCaption(tr(doc->DocName));
- ShadeMenu->setItemChecked(ShadeMenu->idAt(11), true);
- Mpal->SetDoc(doc);
- Sepal->SetView(view);
- Mpal->Spal->SetFormats(doc);
- Lpal->setLayers(&doc->Layers, &doc->ActiveLayer);
- view->LaMenu();
- view->setLayMenTxt(doc->ActiveLayer);
- doc->CurrentABStil = 0;
- slotChangeUnit(doc->Einheit);
- if (doc->EditClip)
- {
- doc->EditClip = !doc->EditClip;
- ToggleFrameEdit();
- }
- if (doc->ShFrames)
- viewMenu->changeItem(FrameDr, tr("Hide Frames"));
- else
- viewMenu->changeItem(FrameDr, tr("Show Frames"));
- DatClo->setEnabled(true);
- if (doc->TemplateMode)
- {
- menuBar()->setItemEnabled(pgmm, 0);
- editMenu->setItemEnabled(tman, 0);
- DatNeu->setEnabled(false);
- DatSav->setEnabled(false);
- DatOpe->setEnabled(false);
- DatClo->setEnabled(false);
- fileMenu->setItemEnabled(fid1, 0);
- fileMenu->setItemEnabled(fid4, 0);
- fileMenu->setItemEnabled(fid5, 0);
- fileMenu->setItemEnabled(fid51, 0);
- fileMenu->setItemEnabled(fid12, 0);
- fileMenu->setItemEnabled(fid13, 0);
- fileMenu->setItemEnabled(fid14, 0);
- Sepal->DisablePal();
- }
- else
- {
- menuBar()->setItemEnabled(pgmm, 1);
- editMenu->setItemEnabled(tman, 1);
- DatNeu->setEnabled(true);
- DatOpe->setEnabled(true);
- DatClo->setEnabled(true);
- fileMenu->setItemEnabled(fid1, 1);
- fileMenu->setItemEnabled(fid4, ActWin->MenuStat[2]);
- fileMenu->setItemEnabled(fid5, ActWin->MenuStat[3]);
- fileMenu->setItemEnabled(fid51, ActWin->MenuStat[3]);
- fileMenu->setItemEnabled(fid12, 1);
- fileMenu->setItemEnabled(fid13, 1);
- fileMenu->setItemEnabled(fid14, 1);
- if (view->Pages.count() > 1)
- {
- pageMenu->setItemEnabled(pgmd, 1);
- pageMenu->setItemEnabled(pgmv, 1);
- }
- else
- {
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- }
- if (doc->isModified())
- slotDocCh();
- else
- {
- fileMenu->setItemEnabled(fid4, 0);
- DatSav->setEnabled(false);
- }
- fileMenu->setItemEnabled(fid5, 1);
- fileMenu->setItemEnabled(fid51, 1);
- Sepal->EnablePal();
- }
-}
-
-void ScribusApp::HaveNewDoc()
-{
- int a;
- DatPri->setEnabled(true);
- DatPDF->setEnabled(true);
- fileMenu->setItemEnabled(fid1, 1);
- fileMenu->setItemEnabled(fid4, 0);
- fileMenu->setItemEnabled(fid5, 1);
- fileMenu->setItemEnabled(fid51, 1);
- fileMenu->setItemEnabled(fid6, 1);
- fileMenu->setItemEnabled(fid7, 1);
- exportMenu->setItemEnabled(fid8, 1);
- importMenu->setItemEnabled(fid2a, 1);
- fileMenu->setItemEnabled(fid9, 1);
- if (PDFavailable)
- exportMenu->setItemEnabled(fid10, 1);
- fileMenu->setItemEnabled(fid11, 1);
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid3, 0);
- editMenu->setItemEnabled(edid6, 1);
- for (a=0; a<6; ++a)
- {
- viewMenu->setItemEnabled(viewMenu->idAt(a), 1);
- }
- viewMenu->setItemEnabled(Markers, 1);
- viewMenu->setItemEnabled(FrameDr, 1);
- viewMenu->setItemEnabled(Bilder, 1);
- viewMenu->setItemEnabled(Ras, 1);
- viewMenu->setItemEnabled(uRas, 1);
- viewMenu->setItemChecked(uRas, doc->useRaster);
- viewMenu->setItemEnabled(Guide, 1);
- viewMenu->setItemEnabled(uGuide, 1);
- viewMenu->setItemChecked(uGuide, doc->SnapGuides);
- menuBar()->setItemEnabled(pgmm, 1);
- menuBar()->setItemEnabled(exmn, 1);
- WerkTools->setEnabled(true);
- if (view->Pages.count() > 1)
- {
- pageMenu->setItemEnabled(pgmd, 1);
- pageMenu->setItemEnabled(pgmv, 1);
- }
- else
- {
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- }
- editMenu->setItemEnabled(tman, 1);
- editMenu->setItemEnabled(jman, 1);
- CListe::Iterator it;
- QPixmap pm = QPixmap(15, 15);
- a = 0;
- ColorMenu->clear();
- ColorMenu->insertItem(tr("None"));
- for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
- {
- pm.fill(doc->PageColors[it.key()].getRGBColor());
- ColorMenu->insertItem(QIconSet(pm), it.key());
- if (it.key() == doc->Dbrush)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), true);
- }
- a++;
- }
- Mpal->Cpal->SetColors(doc->PageColors);
- Mpal->Cpal->ChooseGrad(0);
- ActWin->setCaption(tr(doc->DocName));
- ShadeMenu->setItemChecked(ShadeMenu->idAt(11), true);
- Mpal->SetDoc(doc);
- Sepal->SetView(view);
- Mpal->Spal->SetFormats(doc);
- Lpal->setLayers(&doc->Layers, &doc->ActiveLayer);
- view->LaMenu();
- view->setLayMenTxt(doc->ActiveLayer);
- doc->CurrentABStil = 0;
- slotChangeUnit(doc->Einheit);
- doc->Trenner = new Hyphenator(this, doc, this);
- BuildFontMenu();
- connect(view, SIGNAL(changeUN(int)), this, SLOT(slotChangeUnit(int)));
- connect(view, SIGNAL(changeLA(int)), Lpal, SLOT(MarkActiveLayer(int)));
- doc->PDF_Optionen.BleedBottom = doc->PageM.Bottom;
- doc->PDF_Optionen.BleedTop = doc->PageM.Top;
- doc->PDF_Optionen.BleedLeft = doc->PageM.Left;
- doc->PDF_Optionen.BleedRight = doc->PageM.Right;
-}
-
-void ScribusApp::HaveNewSel(int Nr)
-{
- PageItem *b;
- switch (Nr)
- {
- case -1:
- importMenu->changeItem(fid2, tr("Get Text/Picture..."));
- importMenu->setItemEnabled(fid2, 0);
- exportMenu->setItemEnabled(fid3, 0);
- menuBar()->setItemEnabled(Obm, 0);
- ObjMenu->setItemEnabled(ShapeM, 0);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- ObjMenu->setItemEnabled(LockOb, 0);
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- extraMenu->setItemEnabled(hyph, 0);
- StilMenu->clear();
- WerkTools->KetteAus->setEnabled(false);
- WerkTools->KetteEin->setEnabled(false);
- WerkTools->Textedit->setEnabled(false);
- WerkTools->Rotiere->setEnabled(false);
- Mpal->Cpal->GradCombo->setCurrentItem(0);
- Mpal->Cpal->ChooseGrad(0);
- break;
- case 2:
- importMenu->changeItem(fid2, tr("Get Picture..."));
- importMenu->setItemEnabled(fid2, 1);
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- extraMenu->setItemEnabled(hyph, 0);
- menuBar()->setItemEnabled(Obm, 1);
- ObjMenu->setItemEnabled(ShapeM, 1);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- StilMenu->clear();
- StilMenu->insertItem(tr("Color"), ColorMenu);
- StilMenu->insertItem(tr("Invert"));
- WerkTools->KetteAus->setEnabled(false);
- WerkTools->KetteEin->setEnabled(false);
- WerkTools->Textedit->setEnabled(true);
- WerkTools->Rotiere->setEnabled(true);
- Mpal->SetCurItem(doc->ActPage->SelItem.at(0));
- break;
- case 4:
- importMenu->changeItem(fid2, tr("Get Text..."));
- importMenu->setItemEnabled(fid2, 1);
- exportMenu->setItemEnabled(fid3, 1);
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- extraMenu->setItemEnabled(hyph, 1);
- menuBar()->setItemEnabled(Obm, 1);
- ObjMenu->setItemEnabled(ShapeM, 1);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 1);
-#endif
- StilMenu->clear();
- StilMenu->insertItem(tr("Font"), FontMenu);
- StilMenu->insertItem(tr("Size"), SizeTMenu);
- StilMenu->insertItem(tr("Style"), TypeStyleMenu);
- StilMenu->insertItem(tr("Alignment"), AliMenu);
- StilMenu->insertItem(tr("Color"), ColorMenu);
- StilMenu->insertItem(tr("Shade"), ShadeMenu);
- WerkTools->Rotiere->setEnabled(true);
- b = doc->ActPage->SelItem.at(0);
- if ((b->NextBox != 0) || (b->BackBox != 0))
- {
- WerkTools->KetteAus->setEnabled(true);
- if ((b->BackBox != 0) && (b->Ptext.count() == 0))
- WerkTools->Textedit->setEnabled(false);
- else
- WerkTools->Textedit->setEnabled(true);
- }
- else
- WerkTools->Textedit->setEnabled(true);
- if (b->NextBox == 0)
- WerkTools->KetteEin->setEnabled(true);
- if (doc->MasterP)
- WerkTools->KetteEin->setEnabled(false);
- Mpal->SetCurItem(b);
- doc->CurrentStyle = 0;
- doc->Vorlagen[0].LineSpa = b->LineSp;
- doc->Vorlagen[0].Ausri = b->Ausrich;
- break;
- case 8:
- importMenu->changeItem(fid2, tr("Get Text..."));
- importMenu->setItemEnabled(fid2, 1);
- exportMenu->setItemEnabled(fid3, 1);
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- extraMenu->setItemEnabled(hyph, 0);
- menuBar()->setItemEnabled(Obm, 1);
- ObjMenu->setItemEnabled(ShapeM, 0);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- StilMenu->clear();
- StilMenu->insertItem(tr("Font"), FontMenu);
- StilMenu->insertItem(tr("Size"), SizeTMenu);
- StilMenu->insertItem(tr("Style"), TypeStyleMenu);
- StilMenu->insertItem(tr("Color"), ColorMenu);
- StilMenu->insertItem(tr("Shade"), ShadeMenu);
- WerkTools->Rotiere->setEnabled(true);
- WerkTools->Textedit->setEnabled(false);
- WerkTools->KetteEin->setEnabled(false);
- WerkTools->KetteAus->setEnabled(false);
- Mpal->SetCurItem(doc->ActPage->SelItem.at(0));
- doc->CurrentStyle = 0;
- break;
- default:
- importMenu->changeItem(fid2, tr("Get Text/Picture..."));
- importMenu->setItemEnabled(fid2, 0);
- exportMenu->setItemEnabled(fid3, 0);
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- extraMenu->setItemEnabled(hyph, 0);
- menuBar()->setItemEnabled(Obm, 1);
- StilMenu->clear();
- StilMenu->insertItem(tr("Color"), ColorMenu);
- StilMenu->insertItem(tr("Shade"), ShadeMenu);
- WerkTools->KetteAus->setEnabled(false);
- WerkTools->KetteEin->setEnabled(false);
- if (Nr != 5)
- WerkTools->Rotiere->setEnabled(true);
- else
- WerkTools->Rotiere->setEnabled(false);
- Mpal->SetCurItem(doc->ActPage->SelItem.at(0));
- break;
- }
- doc->CurrentSel = Nr;
- Mpal->RotationGroup->setButton(doc->RotMode);
- if (doc->ActPage->SelItem.count() > 1)
- {
- ObjMenu->setItemEnabled(DistM, 1);
- ObjMenu->setItemEnabled(Gr, 1);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- bool hPoly = false;
- if (doc->ActPage->SelItem.at(0)->Groups.count() == 0)
- hPoly = true;
- for (uint b=0; b<doc->ActPage->SelItem.count(); ++b)
- {
- if (doc->ActPage->SelItem.at(b)->PType != 6)
- hPoly = false;
- }
- ObjMenu->setItemEnabled(PfadV, hPoly);
- if (doc->ActPage->SelItem.count() == 2)
- {
- if (((doc->ActPage->SelItem.at(0)->PType == 4) || (doc->ActPage->SelItem.at(1)->PType == 4)) && ((doc->ActPage->SelItem.at(0)->PType == 7) || (doc->ActPage->SelItem.at(1)->PType == 7)))
- ObjMenu->setItemEnabled(PfadT, 1);
- }
- }
- else
- {
- ObjMenu->setItemEnabled(DistM, 0);
- ObjMenu->setItemEnabled(Gr, 0);
- ObjMenu->setItemEnabled(PfadT, 0);
- ObjMenu->setItemEnabled(PfadV, 0);
- }
- if (doc->ActPage->SelItem.count() != 0)
- {
- Mpal->Textflow->setChecked(doc->ActPage->SelItem.at(0)->Textflow);
- ObjMenu->setItemEnabled(LockOb, 1);
- if (doc->ActPage->SelItem.at(0)->Groups.count() != 0)
- ObjMenu->setItemEnabled(UnGr, 1);
- else
- {
- ObjMenu->setItemEnabled(UnGr, 0);
- if ((doc->ActPage->SelItem.at(0)->PType == 6) && (doc->ActPage->SelItem.at(0)->Segments.count() != 0))
- ObjMenu->setItemEnabled(PfadS, 1);
- else
- ObjMenu->setItemEnabled(PfadS, 0);
- }
- if (doc->ActPage->SelItem.at(0)->Locked)
- {
- ObjMenu->setItemEnabled(DistM, 0);
- ObjMenu->setItemEnabled(ShapeM, 0);
-#ifdef HAVE_FREETYPE
- ObjMenu->setItemEnabled(PfadTP, 0);
-#endif
- ObjMenu->setItemEnabled(PfadS, 0);
- ObjMenu->setItemEnabled(PfadT, 0);
- ObjMenu->setItemEnabled(PfadV, 0);
- ObjMenu->setItemEnabled(Loesch, 0);
- ObjMenu->setItemEnabled(OBack, 0);
- ObjMenu->setItemEnabled(OFront, 0);
- ObjMenu->setItemEnabled(ORaise, 0);
- ObjMenu->setItemEnabled(OLower, 0);
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid4, 0);
- WerkTools->Rotiere->setEnabled(false);
- ObjMenu->changeItem(LockOb, tr("Unlock"));
- }
- else
- {
- ObjMenu->changeItem(LockOb, tr("Lock"));
- ObjMenu->setItemEnabled(OBack, 1);
- ObjMenu->setItemEnabled(OFront, 1);
- ObjMenu->setItemEnabled(ORaise, 1);
- ObjMenu->setItemEnabled(OLower, 1);
- }
- }
-}
-
-void ScribusApp::slotDocCh(bool reb)
-{
- if (reb)
- Tpal->BuildTree(view);
- if (!doc->isModified())
- doc->setModified();
- ActWin->setCaption(tr(doc->DocName) + "*");
- if ((!doc->DocName.startsWith("Document")) && (!doc->TemplateMode))
- {
- fileMenu->setItemEnabled(fid4, 1);
- DatSav->setEnabled(true);
- DatClo->setEnabled(true);
- }
- else
- {
- fileMenu->setItemEnabled(fid4, 0);
- DatSav->setEnabled(false);
- }
- if (!doc->TemplateMode)
- {
- fileMenu->setItemEnabled(fid5, 1);
- fileMenu->setItemEnabled(fid51, 1);
- }
- ActWin->MenuStat[0] = DatSav->isEnabled();
- ActWin->MenuStat[1] = fileMenu->isItemEnabled(fid1);
- ActWin->MenuStat[2] = fileMenu->isItemEnabled(fid4);
- ActWin->MenuStat[3] = fileMenu->isItemEnabled(fid5);
-}
-
-void ScribusApp::UpdateRecent(QString fn)
-{
- recentMenu->clear();
- if (RecentDocs.findIndex(fn) == -1)
- RecentDocs.prepend(fn);
- else
- {
- RecentDocs.remove(fn);
- RecentDocs.prepend(fn);
- }
- uint max = QMIN(Prefs.RecentDCount, RecentDocs.count());
- for (uint m = 0; m < max; ++m)
- {
- recentMenu->insertItem(RecentDocs[m]);
- }
-}
-
-void ScribusApp::LoadRecent(int id)
-{
- QString fn = recentMenu->text(id);
- QFileInfo fd(fn);
- if (!fd.exists())
- {
- RecentDocs.remove(fn);
- recentMenu->clear();
- uint max = QMIN(Prefs.RecentDCount, RecentDocs.count());
- for (uint m = 0; m < max; ++m)
- {
- recentMenu->insertItem(RecentDocs[m]);
- }
- return;
- }
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- LadeDoc(recentMenu->text(id));
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
-}
-
-bool ScribusApp::slotDocOpen()
-{
- bool ret = false;
-#ifdef HAVE_LIBZ
- QString fileName = CFileDialog(tr("Open"),tr("Documents (*.sla *.sla.gz *.scd *.scd.gz);; All Files (*)"));
-#else
- QString fileName = CFileDialog(tr("Open"),tr("Documents (*.sla *.scd);; All Files (*)"));
-#endif
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- ret = LadeDoc(fileName);
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- return ret;
-}
-
-bool ScribusApp::slotDocMerge()
-{
- bool ret = false;
- MergeDoc *dia = new MergeDoc(this);
- if (dia->exec())
- {
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- ret = LadeSeite(dia->Filename->text(), dia->PageNr->value()-1);
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- ret = true;
- }
- delete dia;
- return ret;
-}
-
-bool ScribusApp::LadeSeite(QString fileName, int Nr)
-{
- bool ret = false;
- if (!fileName.isEmpty())
- {
- doc->loading = true;
- ScriXmlDoc *ss = new ScriXmlDoc();
- if(!ss->ReadPage(fileName, Prefs.AvailFonts, doc, view, Nr))
- {
- delete ss;
- doc->loading = false;
- return false;
- }
- delete ss;
- if (CMSavail)
- {
- if (doc->CMSSettings.CMSinUse)
- {
- RecalcColors();
- view->RecalcPictures(&InputProfiles);
- }
- }
- for (uint azz = 0; azz < doc->ActPage->Items.count(); ++azz)
- {
- PageItem *ite = doc->ActPage->Items.at(azz);
- if ((ite->PType == 4) && (ite->isBookmark))
- BookPal->BView->AddPageItem(ite);
- }
- Mpal->Cpal->SetColors(doc->PageColors);
- slotDocCh();
- doc->loading = false;
- ret = true;
- }
- Sepal->Rebuild();
- doc->ActPage->update();
- return ret;
-}
-
-bool ScribusApp::LadeDoc(QString fileName)
-{
- bool ret = false;
- if (!fileName.isEmpty())
- {
- QFileInfo fi(fileName);
- QDir::setCurrent(fi.dirPath(true));
- doc=new ScribusDoc();
- doc->AllFonts = &Prefs.AvailFonts;
- doc->Dsize = Prefs.DefSize;
- doc->GrabRad = Prefs.GrabRad;
- doc->GuideRad = Prefs.GuideRad;
- doc->minorGrid = Prefs.DminGrid;
- doc->majorGrid = Prefs.DmajGrid;
- doc->minorColor = Prefs.DminColor;
- doc->majorColor = Prefs.DmajColor;
- doc->papColor = Prefs.DpapColor;
- doc->margColor = Prefs.DmargColor;
- doc->guideColor = Prefs.guideColor;
- doc->Dpen = Prefs.Dpen;
- doc->DpenText = Prefs.DpenText;
- doc->Dbrush = Prefs.Dbrush;
- doc->Dshade = Prefs.Dshade;
- doc->Dshade2 = Prefs.Dshade2;
- doc->DLineArt = PenStyle(Prefs.DLineArt);
- doc->Dwidth = Prefs.Dwidth;
- doc->DpenLine = Prefs.DpenLine;
- doc->DshadeLine = Prefs.DshadeLine;
- doc->DLstyleLine = PenStyle(Prefs.DLstyleLine);
- doc->DwidthLine = Prefs.DwidthLine;
- doc->MagMin = Prefs.MagMin;
- doc->MagMax = Prefs.MagMax;
- doc->MagStep = Prefs.MagStep;
- doc->DbrushPict = Prefs.DbrushPict;
- doc->ShadePict = Prefs.ShadePict;
- doc->ScaleX = Prefs.ScaleX;
- doc->ScaleY = Prefs.ScaleY;
- doc->ScaleType = Prefs.ScaleType;
- doc->AspectRatio = Prefs.AspectRatio;
- doc->Before = Prefs.Before;
- doc->Einheit = Prefs.Einheit;
- doc->PagesSbS = Prefs.PagesSbS;
- doc->ShFrames = Prefs.ShFrames;
- doc->RandFarbig = Prefs.RandFarbig;
- doc->AutoLine = Prefs.AutoLine;
- doc->Scale = 1.0;
- doc->AppMode = 1;
- doc->HasCMS = false;
- doc->ActiveLayer = 0;
- doc->Language = Prefs.Language;
- doc->MinWordLen = Prefs.MinWordLen;
- doc->Automatic = Prefs.Automatic;
- doc->AutoCheck = Prefs.AutoCheck;
- doc->loading = true;
- FMess->setText(tr("Loading..."));
- FProg->reset();
- ScribusWin* w = new ScribusWin(wsp, doc);
- view = new ScribusView(w, doc, &Prefs);
- w->setView(view);
- ActWin = w;
- w->setCentralWidget(view);
- ScriXmlDoc *ss = new ScriXmlDoc();
- connect(ss, SIGNAL(NewPage(int)), this, SLOT(slotNewPage(int)));
-#ifdef HAVE_CMS
- w->SoftProofing = false;
- w->Gamut = false;
- bool cmsu = CMSuse;
- CMSuse = false;
-#endif
- if(!ss->ReadDoc(fileName, Prefs.AvailFonts, doc, view, FProg))
- {
-// w->close();
- view->close();
- disconnect(ss, SIGNAL(NewPage(int)), this, SLOT(slotNewPage(int)));
- delete ss;
- delete view;
- delete doc;
- delete w;
- FMess->setText("");
- FProg->reset();
- ActWin = NULL;
- return false;
- }
- delete ss;
- FMess->setText("");
- FProg->reset();
-#ifdef HAVE_CMS
- CMSuse = cmsu;
-#endif
- HaveDoc++;
- connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
- connect(w, SIGNAL(SaveAndClose()), this, SLOT(DoSaveClose()));
- if (!doc->HasCMS)
- {
- doc->CMSSettings.DefaultInputProfile = Prefs.DCMSset.DefaultInputProfile;
- doc->CMSSettings.DefaultInputProfile2 = Prefs.DCMSset.DefaultInputProfile2;
- doc->CMSSettings.DefaultMonitorProfile = Prefs.DCMSset.DefaultMonitorProfile;
- doc->CMSSettings.DefaultPrinterProfile = Prefs.DCMSset.DefaultPrinterProfile;
- doc->CMSSettings.DefaultIntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- doc->CMSSettings.DefaultIntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
- doc->CMSSettings.DefaultIntentMonitor2 = Prefs.DCMSset.DefaultIntentMonitor2;
- doc->CMSSettings.SoftProofOn = Prefs.DCMSset.SoftProofOn;
- doc->CMSSettings.GamutCheck = Prefs.DCMSset.GamutCheck;
- doc->CMSSettings.CMSinUse = false;
- }
- if (CMSavail)
- {
- if (!InputProfiles.contains(doc->CMSSettings.DefaultInputProfile))
- doc->CMSSettings.DefaultInputProfile = Prefs.DCMSset.DefaultInputProfile;
- if (!InputProfiles.contains(doc->CMSSettings.DefaultInputProfile2))
- doc->CMSSettings.DefaultInputProfile2 = Prefs.DCMSset.DefaultInputProfile2;
- if (!MonitorProfiles.contains(doc->CMSSettings.DefaultMonitorProfile))
- doc->CMSSettings.DefaultMonitorProfile = Prefs.DCMSset.DefaultMonitorProfile;
- if (!PrinterProfiles.contains(doc->CMSSettings.DefaultPrinterProfile))
- doc->CMSSettings.DefaultPrinterProfile = Prefs.DCMSset.DefaultPrinterProfile;
- if (!PrinterProfiles.contains(doc->PDF_Optionen.PrintProf))
- doc->PDF_Optionen.PrintProf = doc->CMSSettings.DefaultPrinterProfile;
- if (!InputProfiles.contains(doc->PDF_Optionen.ImageProf))
- doc->PDF_Optionen.ImageProf = doc->CMSSettings.DefaultInputProfile;
- if (!InputProfiles.contains(doc->PDF_Optionen.SolidProf))
- doc->PDF_Optionen.SolidProf = doc->CMSSettings.DefaultInputProfile2;
-#ifdef HAVE_CMS
- w->SoftProofing = doc->CMSSettings.SoftProofOn;
- w->Gamut = doc->CMSSettings.GamutCheck;
- CMSuse = doc->CMSSettings.CMSinUse;
- w->IntentPrinter = doc->CMSSettings.DefaultIntentPrinter;
- w->IntentMonitor = doc->CMSSettings.DefaultIntentMonitor;
- SoftProofing = doc->CMSSettings.SoftProofOn;
- Gamut = doc->CMSSettings.GamutCheck;
- IntentPrinter = doc->CMSSettings.DefaultIntentPrinter;
- IntentMonitor = doc->CMSSettings.DefaultIntentMonitor;
- w->OpenCMSProfiles(InputProfiles, MonitorProfiles, PrinterProfiles);
- stdProof = w->stdProof;
- stdTrans = w->stdTrans;
- stdProofImg = w->stdProofImg;
- stdTransImg = w->stdTransImg;
- CMSoutputProf = doc->DocOutputProf;
- CMSprinterProf = doc->DocPrinterProf;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsInput2 = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsPrinter = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsPrinter = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsPrinter = 3;
- doc->PDF_Optionen.SComp = doc->CMSSettings.ComponentsInput2;
-#endif
- if (doc->CMSSettings.CMSinUse)
- {
- RecalcColors();
- view->RecalcPictures(&InputProfiles);
- }
- }
- Mpal->Cpal->SetColors(doc->PageColors);
- Mpal->Cpal->ChooseGrad(0);
- doc->DocName = fileName;
- doc->MasterP = false;
- HaveNewDoc();
- doc->hasName = true;
- if (view->MasterPages.count() == 0)
- {
- for (uint ax=0; ax<view->Pages.count(); ++ax)
- {
- view->Pages.at(ax)->parentWidget()->hide();
- }
- view->DocPages = view->Pages;
- view->Pages = view->MasterPages;
- doc->PageC = view->MasterPages.count();
- bool atf = doc->PageAT;
- doc->PageAT = false;
- slotNewPage(0);
- doc->PageAT = atf;
- view->MasterNames["Normal"] = 0;
- view->Pages.at(0)->PageNam = "Normal";
- view->Pages.at(0)->parentWidget()->hide();
- view->MasterPages = view->Pages;
- doc->PageC = view->DocPages.count();
- view->Pages = view->DocPages;
- doc->MasterP = false;
- for (uint ay=0; ay<view->Pages.count(); ++ay)
- {
- view->Pages.at(ay)->parentWidget()->show();
- }
- }
- doc->setUnModified();
- doc->loading = false;
- view->GotoPage(0);
- doc->RePos = true;
- for (uint az=0; az<view->MasterPages.count(); az++)
- {
- for (uint azz=0; azz<view->MasterPages.at(az)->Items.count(); ++azz)
- {
- PageItem *ite = view->MasterPages.at(az)->Items.at(azz);
- if (ite->PType == 4)
- ite->paintObj();
- }
- }
- for (uint az=0; az<view->Pages.count(); az++)
- {
- for (uint azz=0; azz<view->Pages.at(az)->Items.count(); ++azz)
- {
- PageItem *ite = view->Pages.at(az)->Items.at(azz);
- if (ite->PType == 4)
- ite->paintObj();
- if (doc->OldBM)
- {
- if ((ite->PType == 4) && (ite->isBookmark))
- BookPal->BView->AddPageItem(ite);
- }
- else
- {
- if ((ite->PType == 4) && (ite->isBookmark))
- BookPal->BView->ChangeItem(ite->BMnr, ite->ItemNr);
- }
- }
- }
- if (doc->OldBM)
- StoreBookmarks();
- doc->RePos = false;
- UpdateRecent(fileName);
- FMess->setText(tr("Ready"));
- ret = true;
- if ((wsp->windowList().isEmpty()) || (wsp->windowList().count() == 1))
- w->showMaximized();
- else
- w->show();
- view->show();
- newActWin(w);
- connect(doc->ASaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
- doc->AutoSave = Prefs.AutoSave;
- if (doc->AutoSave)
- doc->ASaveTimer->start(Prefs.AutoSaveTime);
- }
- else
- {
- Sepal->Vie = 0;
- }
- Sepal->Rebuild();
- return ret;
-}
-
-void ScribusApp::slotFileOpen()
-{
- if (doc->ActPage->SelItem.count() != 0)
- {
- PageItem *b = doc->ActPage->SelItem.at(0);
- if (b->PType == 2)
- {
- QString formats = "";
- QString form = "";
- for ( uint i = 0; i < QImageIO::inputFormats().count(); ++i )
- {
- form = QString(QImageIO::inputFormats().at(i)).lower();
- if (form == "jpeg")
- form = "jpg";
- formats += "*."+form+" ";
- }
- formats += "*.tif";
- QString fileName = CFileDialog(tr("Open"),tr("Images")+" ("+formats+tr(");;Postscript (*.eps);;All Files (*)"), "", true);
- if (!fileName.isEmpty())
- {
- b->EmProfile = "";
- b->UseEmbedded = true;
- b->IProfile = doc->CMSSettings.DefaultInputProfile;
- b->IRender = doc->CMSSettings.DefaultIntentMonitor2;
- doc->ActPage->LoadPict(fileName, b->ItemNr);
- doc->ActPage->AdjustPictScale(b);
- doc->ActPage->AdjustPreview(b);
- doc->ActPage->update();
- Mpal->Cpal->SetColors(doc->PageColors);
- slotDocCh();
- }
- }
- if (b->PType == 4)
- {
- QString fileName = CFileDialog(tr("Open"),tr("Textfiles (*.txt);;All Files (*)"));
- if (!fileName.isEmpty())
- {
- Serializer *ss = new Serializer(fileName);
- if (ss->Read())
- {
- ss->GetText(b, doc->CurrentABStil);
- }
- delete ss;
- if (doc->Trenner->AutoCheck)
- doc->Trenner->slotHyphenate(b);
- doc->ActPage->update();
- slotDocCh();
- }
- }
- }
-}
-
-void ScribusApp::slotAutoSave()
-{
- if ((doc->hasName) && (doc->isModified()) && (!doc->TemplateMode))
- {
- system("mv -f " + doc->DocName + " " + doc->DocName+".bak");
- DoFileSave(doc->DocName);
- }
-}
-
-void ScribusApp::slotFileSave()
-{
- QString fn = doc->DocName;
- if (!DoFileSave(fn))
- QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
-}
-
-void ScribusApp::slotFileSaveAs()
-{
- QString fna;
- if (doc->hasName)
- {
- QFileInfo fi(doc->DocName);
- fna = fi.dirPath()+"/"+fi.baseName()+".sla";
- }
- else
- {
- QDir di = QDir();
- fna = di.currentDirPath()+"/"+doc->DocName+".sla";
- }
-#ifdef HAVE_LIBZ
- QString fn = CFileDialog(tr("Save as"), tr("Documents (*.sla *.sla.gz *.scd *scd.gz);; All Files (*)"), fna, false, false, true);
-#else
- QString fn = CFileDialog(tr("Save as"), tr("Documents (*.sla *.scd);; All Files (*)"), fna, false, false, false);
-#endif
- if (!fn.isEmpty())
- {
- QFile f(fn);
- if (f.exists())
- {
- int exit=QMessageBox::warning(this,
- tr("Warning"),
- tr("Do you really want to overwrite the File:\n%1 ?").arg(fn),
- tr("No"),
- tr("Yes"),
- 0, 0, 1);
- if (exit != 1)
- return;
- }
- if (!DoFileSave(fn))
- QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
- }
- FMess->setText(tr("Ready"));
-}
-
-bool ScribusApp::DoFileSave(QString fn)
-{
- bool ret = true;
- FMess->setText(tr("Saving..."));
- FProg->reset();
- QFileInfo fi(fn);
- QDir::setCurrent(fi.dirPath(true));
- ScriXmlDoc *ss = new ScriXmlDoc();
- qApp->processEvents();
- ret = ss->WriteDoc(fn, doc, view, FProg);
- delete ss;
- if (ret)
- {
- doc->setUnModified();
- ActWin->setCaption(fn);
- doc->DocName = fn;
- fileMenu->setItemEnabled(fid4, 0);
- DatSav->setEnabled(false);
- UpdateRecent(fn);
- }
- FMess->setText("");
- FProg->reset();
- return ret;
-}
-
-bool ScribusApp::slotFileClose()
-{
- ScribusWin* tw = ActWin;
- ActWin->close();
- if (tw == ActWin)
- return false;
- else
- return true;
-}
-
-bool ScribusApp::DoFileClose()
-{
- uint a;
- doc->ASaveTimer->stop();
- disconnect(doc->ASaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
- if ((doc->UnData.UnCode == 0) && (doc->UnDoValid))
- delete doc->UnData.Item;
- if (CMSavail)
- ActWin->CloseCMSProfiles();
- Mpal->NewSel(-1);
- Mpal->UnsetDoc();
- Sepal->Vie = 0;
- Sepal->Rebuild();
- Mpal->Spal->SetFormats(0);
- if (doc->EditClip)
- Npal->doc = 0;
- BookPal->BView->clear();
- BookPal->BView->NrItems = 0;
- BookPal->BView->First = 1;
- BookPal->BView->Last = 0;
- if ((wsp->windowList().isEmpty()) || (wsp->windowList().count() == 1))
- {
- fileMenu->setItemEnabled(fid1, 0);
- importMenu->setItemEnabled(fid2, 0);
- exportMenu->setItemEnabled(fid3, 0);
- fileMenu->setItemEnabled(fid4, 0);
- fileMenu->setItemEnabled(fid5, 0);
- fileMenu->setItemEnabled(fid51, 0);
- fileMenu->setItemEnabled(fid6, 0);
- fileMenu->setItemEnabled(fid7, 0);
- exportMenu->setItemEnabled(fid8, 0);
- importMenu->setItemEnabled(fid2a, 0);
- fileMenu->setItemEnabled(fid9, 0);
- exportMenu->setItemEnabled(fid10, 0);
- fileMenu->setItemEnabled(fid11, 0);
- editMenu->setItemEnabled(edUndo, 0);
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid3, 0);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- editMenu->setItemEnabled(edid6, 0);
- extraMenu->setItemEnabled(hyph, 0);
- for (int a=0; a<6; ++a)
- {
- viewMenu->setItemEnabled(viewMenu->idAt(a), 0);
- }
- viewMenu->setItemEnabled(Markers, 0);
- viewMenu->setItemEnabled(FrameDr, 0);
- viewMenu->setItemEnabled(Bilder, 0);
- viewMenu->setItemEnabled(Ras, 0);
- viewMenu->setItemEnabled(uRas, 0);
- viewMenu->setItemChecked(uRas, false);
- viewMenu->setItemEnabled(Guide, 0);
- viewMenu->setItemEnabled(uGuide, 0);
- viewMenu->setItemChecked(uGuide, false);
- viewMenu->changeItem(Markers, tr("Hide Margins"));
- viewMenu->changeItem(FrameDr, tr("Hide Frames"));
- viewMenu->changeItem(Bilder, tr("Hide Images"));
- viewMenu->changeItem(Ras, tr("Show Grid"));
- viewMenu->changeItem(Guide, tr("Hide Guides"));
- editMenu->setItemEnabled(tman, 0);
- editMenu->setItemEnabled(jman, 0);
- menuBar()->setItemEnabled(pgmm, 0);
- menuBar()->setItemEnabled(exmn, 0);
- menuBar()->setItemEnabled(Obm, 0);
- WerkTools->setEnabled(false);
- ColorMenu->clear();
- Mpal->Cpal->SetColors(Prefs.DColors);
- Mpal->Cpal->ChooseGrad(0);
- FMess->setText(tr("Ready"));
- Tpal->ListView1->clear();
- Lpal->ClearInhalt();
- DatPri->setEnabled(false);
- DatPDF->setEnabled(false);
- DatSav->setEnabled(false);
- DatClo->setEnabled(false);
- PrinterUsed = false;
-#ifdef HAVE_CMS
- CMSuse = false;
- SoftProofing = Prefs.DCMSset.SoftProofOn;
- IntentPrinter = Prefs.DCMSset.DefaultIntentPrinter;
- IntentMonitor = Prefs.DCMSset.DefaultIntentMonitor;
-#endif
- }
- view->close();
- for (a = 0; a<view->Pages.count(); ++a)
- {
- delete view->Pages.at(a);
- }
- HaveDoc--;
- view = NULL;
- delete doc;
- doc = NULL;
- ActWin = NULL;
- return true;
-}
-
-void ScribusApp::slotFilePrint()
-{
- QString fna, prn, cmd, scmd, cc, data, SepNam;
- int Anf, Ende, Nr;
- bool fil, sep, farbe, PSfile, mirrorH, mirrorV, useICC;
- PSfile = false;
- FMess->setText(tr("Printing..."));
- if (PrinterUsed)
- {
- prn = PDef.Pname;
- fna = PDef.Dname;
- }
- else
- {
- prn = "";
- if (!doc->DocName.startsWith("Document"))
- {
- QFileInfo fi(doc->DocName);
- fna = fi.dirPath()+"/"+fi.baseName()+".ps";
- }
- else
- {
- QDir di = QDir();
- fna = di.currentDirPath()+"/"+doc->DocName+".ps";
- }
- }
- scmd = PDef.Command;
- Druck *printer = new Druck(this, fna, prn, scmd);
- printer->setMinMax(1, view->Pages.count());
- printer->setFromTo(1, view->Pages.count());
- if (printer->exec())
- {
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- prn = printer->printerName();
- fna = printer->outputFileName();
- fil = printer->outputToFile();
- Anf = printer->fromPage();
- Ende = printer->toPage();
- Nr = printer->numCopies();
- sep = printer->outputSeparations();
- SepNam = printer->separationName();
- farbe = printer->color();
- mirrorH = printer->MirrorH;
- mirrorV = printer->MirrorV;
- useICC = printer->ICCinUse;
- PDef.Pname = prn;
- PDef.Dname = fna;
- if (printer->OtherCom->isChecked())
- PDef.Command = printer->Command->text();
- PrinterUsed = true;
- PSLib *dd = getPSDriver(true, Prefs.AvailFonts, doc->UsedFonts, doc->PageColors, false);
- if (dd != NULL)
- {
- if (fil)
- PSfile = dd->PS_set_file(fna);
- else
- PSfile = dd->PS_set_file(PrefsPfad+"/tmp.ps");
- if (PSfile)
- {
- if (printer->pageOrder() == 0)
- view->CreatePS(dd, Anf-1, Ende, 1, sep, SepNam, farbe, mirrorH, mirrorV, useICC);
- else
- view->CreatePS(dd, Ende-1, Anf-2, -1, sep, SepNam, farbe, mirrorH, mirrorV, useICC);
- if (!fil)
- {
- if (printer->OtherCom->isChecked())
- {
- cmd = printer->Command->text()+ " "+PrefsPfad+"/tmp.ps";
- system(cmd);
- }
- else
- {
- cmd = "lpr -P" + prn;
- if (Nr > 1)
- cmd += " -#" + cc.setNum(Nr);
-#ifdef HAVE_CUPS
- cmd += printer->PrinterOpts;
-#endif
- cmd += " "+PrefsPfad+"/tmp.ps";
- system(cmd);
- }
- system("rm -f "+PrefsPfad+"/tmp.ps");
- }
- }
- else
- QMessageBox::warning(this, tr("Warning"), tr("Printing failed!"), tr("OK"));
- delete dd;
- closePSDriver();
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- }
- }
- delete printer;
- FMess->setText(tr("Ready"));
-}
-
-void ScribusApp::slotFileQuit()
-{
- Mpal->UnsetDoc();
- close();
-}
-
-void ScribusApp::slotEditCut()
-{
- uint a;
- NoFrameEdit();
- QString BufferI = "";
- if ((HaveDoc) && (doc->ActPage->SelItem.count() != 0))
- {
- Buffer2 = "<SCRIBUSTEXT>";
- PageItem *b = doc->ActPage->SelItem.at(0);
- if ((doc->AppMode == 7) && (b->HasSel))
- {
- for (a = 0; a < b->Ptext.count(); ++a)
- {
- if (b->Ptext.at(a)->cselect)
- {
- if (b->Ptext.at(a)->ch == QChar(13))
- {
- Buffer2 += QChar(5);
- BufferI += QChar(10);
- }
- else
- {
- Buffer2 += b->Ptext.at(a)->ch;
- BufferI += b->Ptext.at(a)->ch;
- }
- Buffer2 += "\t";
- Buffer2 += b->Ptext.at(a)->cfont+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->csize)+"\t";
- Buffer2 += b->Ptext.at(a)->ccolor+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->cextra)+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->cshade)+'\t';
- Buffer2 += QString::number(b->Ptext.at(a)->cstyle)+'\t';
- Buffer2 += QString::number(b->Ptext.at(a)->cab)+'\n';
- }
- }
- DeleteSel(b);
- b->Dirty = true;
- b->paintObj();
- }
- else
- {
- ScriXmlDoc *ss = new ScriXmlDoc();
- Buffer2 = ss->WriteElem(&doc->ActPage->SelItem, doc);
- doc->ActPage->DeleteItem();
- }
- slotDocCh();
- editMenu->setItemEnabled(edid3, 1);
- ClipB->setText(BufferI);
- BuFromApp = true;
- }
-}
-
-void ScribusApp::slotEditCopy()
-{
- uint a;
- NoFrameEdit();
- QString BufferI = "";
- if ((HaveDoc) && (doc->ActPage->SelItem.count() != 0))
- {
- Buffer2 = "<SCRIBUSTEXT>";
- PageItem *b = doc->ActPage->SelItem.at(0);
- if ((doc->AppMode == 7) && (b->HasSel))
- {
- Buffer2 += "";
- for (a = 0; a < b->Ptext.count(); ++a)
- {
- if (b->Ptext.at(a)->cselect)
- {
- if (b->Ptext.at(a)->ch == QChar(13))
- {
- Buffer2 += QChar(5);
- BufferI += QChar(10);
- }
- else
- {
- Buffer2 += b->Ptext.at(a)->ch;
- BufferI += b->Ptext.at(a)->ch;
- }
- Buffer2 += "\t";
- Buffer2 += b->Ptext.at(a)->cfont+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->csize)+"\t";
- Buffer2 += b->Ptext.at(a)->ccolor+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->cextra)+"\t";
- Buffer2 += QString::number(b->Ptext.at(a)->cshade)+'\t';
- Buffer2 += QString::number(b->Ptext.at(a)->cstyle)+'\t';
- Buffer2 += QString::number(b->Ptext.at(a)->cab)+'\n';
- }
- }
- }
- else
- {
- ScriXmlDoc *ss = new ScriXmlDoc();
- Buffer2 = ss->WriteElem(&doc->ActPage->SelItem, doc);
- delete ss;
- }
- editMenu->setItemEnabled(edid3, 1);
- ClipB->setText(BufferI);
- BuFromApp = true;
- }
-}
-
-void ScribusApp::slotEditPaste()
-{
- struct Pti *hg;
- NoFrameEdit();
- if (HaveDoc)
- {
- if (!BuFromApp)
- Buffer2 = ClipB->text();
- if (Buffer2.isNull())
- return;
- if (doc->AppMode == 7)
- {
- PageItem *b = doc->ActPage->SelItem.at(0);
- if (Buffer2.startsWith("<SCRIBUSTEXT>"))
- {
- Buffer2.remove(0, 13);
- QTextStream t(&Buffer2, IO_ReadOnly);
- QString cc;
- while (!t.atEnd())
- {
- cc = t.readLine();
- QStringList wt;
- QStringList::Iterator it;
- wt = QStringList::split("\t", cc);
- it = wt.begin();
- hg = new Pti;
- hg->ch = (*it);
- if (hg->ch == QChar(5))
- hg->ch = QChar(13);
- it++;
- hg->cfont = *it;
- it++;
- hg->csize = (*it).toInt();
- it++;
- hg->ccolor = *it;
- it++;
- hg->cextra = (*it).toInt();
- it++;
- hg->cshade = (*it).toInt();
- hg->cselect = false;
- it++;
- hg->cstyle = (*it).toInt();
- it++;
- hg->cab = (*it).toInt();
- b->Ptext.insert(b->CPos, hg);
- b->CPos += 1;
- hg->PRot = 0;
- hg->PtransX = 0;
- hg->PtransY = 0;
- }
- }
- else
- {
- Serializer *ss = new Serializer("");
- ss->Objekt = Buffer2;
- ss->GetText(b, doc->CurrentABStil, true);
- delete ss;
- if (doc->Trenner->AutoCheck)
- doc->Trenner->slotHyphenate(b);
- }
- if (b->CPos < static_cast<int>(b->Ptext.count())) { b->Dirty = true; }
- b->paintObj();
- }
- else
- {
- if (Buffer2.startsWith("<SCRIBUSELEM"))
- {
- doc->ActPage->Deselect(true);
- slotElemRead(Buffer2, 0, 0, false, true, doc);
- doc->ActPage->SelectItemNr(doc->ActPage->Items.count()-1);
- PageItem *b = doc->ActPage->SelItem.at(0);
- b->AnName = tr("Copy of")+" "+b->AnName;
- }
- }
- slotDocCh(false);
- }
-}
-
-void ScribusApp::SelectAll()
-{
- uint a;
- PageItem *b = doc->ActPage->SelItem.at(0);
- for (a = 0; a < b->Ptext.count(); ++a)
- {
- b->Ptext.at(a)->cselect = true;
- }
- b->HasSel = true;
- b->Dirty = true;
- b->paintObj();
- EnableTxEdit();
-}
-
-void ScribusApp::ClipChange()
-{
- QString cc;
- cc = ClipB->text();
- editMenu->setItemEnabled(edid3, 0);
- if (!cc.isNull())
- {
- BuFromApp = false;
- if (cc.startsWith("<SCRIBUSELEM"))
- {
- if (doc->AppMode != 7)
- editMenu->setItemEnabled(edid3, 1);
- }
- else
- {
- if (doc->AppMode == 7)
- editMenu->setItemEnabled(edid3, 1);
- }
- }
-}
-
-void ScribusApp::DeleteText()
-{
- PageItem *b = doc->ActPage->SelItem.at(0);
- DeleteSel(b);
- b->Dirty = true;
- b->paintObj();
- slotDocCh();
-}
-
-void ScribusApp::EnableTxEdit()
-{
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 1);
-}
-
-void ScribusApp::DisableTxEdit()
-{
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid4, 0);
-}
-
-void ScribusApp::slotHelpAbout()
-{
- void *mo;
- char *error;
- typedef About* (*sdem)(QWidget *d);
- sdem demo;
- QString pfad = PREL;
- pfad += "/lib/scribus/libs/libabout.so";
- mo = dlopen(pfad, RTLD_LAZY);
- if (!mo)
- {
- std::cout << "Can't find Plugin" << endl;
- return;
- }
- dlerror();
- demo = (sdem)dlsym(mo, "Run");
- if ((error = dlerror()) != NULL)
- {
- std::cout << "Can't find Symbol" << endl;
- dlclose(mo);
- return;
- }
- About* dia = (*demo)(this);
- dia->exec();
- delete dia;
- dlclose(mo);
-}
-
-void ScribusApp::slotHelpAboutQt()
-{
- QMessageBox::aboutQt(this,tr("About Qt"));
-}
-
-void ScribusApp::slotOnlineHelp()
-{
- HelpBrowser *dia = new HelpBrowser(this, tr("Scribus Manual"));
- dia->show();
-}
-
-void ScribusApp::ToggleTips()
-{
- tipsOn = !tipsOn;
- helpMenu->setItemChecked(tip, tipsOn);
- QToolTip::setEnabled(tipsOn);
-}
-
-void ScribusApp::SaveText()
-{
- QString fn = CFileDialog(tr("Save as"), tr("Textfiles (*.txt);;All Files (*)"), "", false, false);
- if (!fn.isEmpty())
- {
- Serializer *se = new Serializer(fn);
- se->PutText(doc->ActPage->SelItem.at(0));
- se->Write();
- delete se;
- }
-}
-
-void ScribusApp::applyNewMaster(QString name)
-{
- Apply_Temp(name, doc->ActPage->PageNr);
-}
-
-void ScribusApp::slotNewPageP(int wo, QString templ)
-{
- NoFrameEdit();
- doc->ActPage->Deselect(true);
- doc->UnDoValid = false;
- CanUndo();
- slotNewPage(wo);
- applyNewMaster(templ);
- Sepal->RebuildPage();
-}
-
-/** Erzeugt eine neue Seite */
-void ScribusApp::slotNewPageM()
-{
- int wo, cc;
- NoFrameEdit();
- doc->ActPage->Deselect(true);
- InsPage *dia = new InsPage(this, view, doc->ActPage->PageNr, view->Pages.count(), doc->PageFP);
- if (dia->exec())
- {
- doc->UnDoValid = false;
- CanUndo();
- wo = dia->ActualPage->value();
- switch (dia->Where->currentItem())
- {
- case 0:
- wo -= 1;
- for (cc = 0; cc < dia->NumPages->value(); ++cc)
- {
- slotNewPage(wo);
- if (doc->PageFP)
- {
- if ((doc->ActPage->PageNr % 2 == 0) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 0) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- }
- else
- applyNewMaster(dia->Based->currentText());
- wo ++;
- }
- break;
- case 1:
- for (cc = 0; cc < dia->NumPages->value(); ++cc)
- {
- slotNewPage(wo);
- if (doc->PageFP)
- {
- if ((doc->ActPage->PageNr % 2 == 0) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 0) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- }
- else
- applyNewMaster(dia->Based->currentText());
- wo ++;
- }
- break;
- case 2:
- for (cc = 0; cc < dia->NumPages->value(); ++cc)
- {
- slotNewPage(view->Pages.count());
- if (doc->PageFP)
- {
- if ((doc->ActPage->PageNr % 2 == 0) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 0) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based2->currentText());
- if ((doc->ActPage->PageNr % 2 == 1) && (!doc->FirstPageLeft))
- applyNewMaster(dia->Based->currentText());
- }
- else
- applyNewMaster(dia->Based->currentText());
- }
- break;
- }
- Sepal->RebuildPage();
- }
- delete dia;
-}
-
-void ScribusApp::slotNewPageT(int w)
-{
- if (doc->TemplateMode)
- slotNewPage(w);
-}
-
-void ScribusApp::slotNewPage(int w)
-{
- view->addPage(w);
- if (view->Pages.count() > 1)
- {
- pageMenu->setItemEnabled(pgmd, 1);
- pageMenu->setItemEnabled(pgmv, 1);
- }
- AdjustBM();
- connect(doc->ActPage, SIGNAL(Amode(int)), this, SLOT(setAppMode(int)));
- connect(doc->ActPage, SIGNAL(PaintingDone()), this, SLOT(slotSelect()));
- connect(doc->ActPage, SIGNAL(HaveSel(int)), this, SLOT(HaveNewSel(int)));
- connect(doc->ActPage, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
- connect(doc->ActPage, SIGNAL(ClipPo(float, float)), Npal, SLOT(SetXY(float, float)));
- connect(doc->ActPage, SIGNAL(HavePoint(bool, bool)), Npal, SLOT(HaveNode(bool, bool)));
- connect(doc->ActPage, SIGNAL(PolyOpen()), Npal, SLOT(IsOpen()));
- connect(doc->ActPage, SIGNAL(PStatus(int, uint)), Npal, SLOT(PolyStatus(int, uint)));
- connect(doc->ActPage, SIGNAL(MousePos(float, float)), this, SLOT(ReportMP(float, float)));
- connect(doc->ActPage, SIGNAL(ItemPos(float, float)), Mpal, SLOT(setXY(float, float)));
- connect(doc->ActPage, SIGNAL(ItemGeom(float, float)), Mpal, SLOT(setBH(float, float)));
- connect(doc->ActPage, SIGNAL(SetAngle(float)), Mpal, SLOT(setR(float)));
- connect(doc->ActPage, SIGNAL(ItemRadius(float)), Mpal, SLOT(setRR(float)));
- connect(doc->ActPage, SIGNAL(ItemTextAttr(float)), Mpal, SLOT(setLsp(float)));
- connect(doc->ActPage, SIGNAL(ItemTextSize(int)), Mpal, SLOT(setSize(int)));
- connect(doc->ActPage, SIGNAL(ItemTextUSval(float)), Mpal, SLOT(setExtra(float)));
- connect(doc->ActPage, SIGNAL(HaveSel(int)), Mpal, SLOT(NewSel(int)));
- connect(doc->ActPage, SIGNAL(SetLocalValues(float, float, float, float)), Mpal, SLOT(setLvalue(float, float, float, float)));
- connect(doc->ActPage, SIGNAL(SetSizeValue(float)), Mpal, SLOT(setSvalue(float)));
- connect(doc->ActPage, SIGNAL(ItemTextStil(int)), Mpal, SLOT(setStil(int)));
- connect(doc->ActPage, SIGNAL(ItemTextAbs(int)), Mpal, SLOT(setAli(int)));
- connect(doc->ActPage, SIGNAL(RotMode(int)), Mpal, SLOT(setRM(int)));
- connect(doc->ActPage, SIGNAL(SetLineArt(PenStyle, PenCapStyle, PenJoinStyle)), Mpal, SLOT( setLIvalue(PenStyle, PenCapStyle, PenJoinStyle)));
- connect(doc->ActPage, SIGNAL(ItemFarben(QString, QString, int, int)), this, SLOT(setCSMenu(QString, QString, int, int)));
- connect(doc->ActPage, SIGNAL(ItemFarben(QString, QString, int, int)), Mpal->Cpal, SLOT(setActFarben(QString, QString, int, int)));
- connect(doc->ActPage, SIGNAL(ItemGradient(QString, QString, int, int, int)), Mpal->Cpal, SLOT(setActGradient(QString, QString, int, int, int)));
- connect(doc->ActPage, SIGNAL(ItemTrans(float)), Mpal->Cpal, SLOT(setActTrans(float)));
- connect(doc->ActPage, SIGNAL(ItemTextFont(QString)), this, SLOT(AdjustFontMenu(QString)));
- connect(doc->ActPage, SIGNAL(ItemTextSize(int)), this, SLOT(setFSizeMenu(int)));
- connect(doc->ActPage, SIGNAL(ItemTextStil(int)), this, SLOT(setStilvalue(int)));
- connect(doc->ActPage, SIGNAL(ItemTextAbs(int)), this, SLOT(setAbsValue(int)));
- connect(doc->ActPage, SIGNAL(HasTextSel()), this, SLOT(EnableTxEdit()));
- connect(doc->ActPage, SIGNAL(HasNoTextSel()), this, SLOT(DisableTxEdit()));
- connect(doc->ActPage, SIGNAL(CopyItem()), this, SLOT(slotEditCopy()));
- connect(doc->ActPage, SIGNAL(CutItem()), this, SLOT(slotEditCut()));
- connect(doc->ActPage, SIGNAL(LoadPic()), this, SLOT(slotFileOpen()));
- connect(doc->ActPage, SIGNAL(ModifyIt()), this, SLOT(ModifyObject()));
- connect(doc->ActPage, SIGNAL(AnnotProps()), this, SLOT(ModifyAnnot()));
- connect(doc->ActPage, SIGNAL(ToScrap(QString)), this, SLOT(PutScrap(QString)));
- connect(doc->ActPage, SIGNAL(UndoAvail()), this, SLOT(CanUndo()));
- connect(doc->ActPage, SIGNAL(EditGuides()), this, SLOT(ManageGuides()));
- connect(doc->ActPage, SIGNAL(LoadElem(QString, int ,int, bool, bool, ScribusDoc *)), this, SLOT(slotElemRead(QString, int, int, bool, bool, ScribusDoc *)));
- connect(doc->ActPage, SIGNAL(AddBM(PageItem *)), this, SLOT(AddBookMark(PageItem *)));
- connect(doc->ActPage, SIGNAL(DelBM(PageItem *)), this, SLOT(DelBookMark(PageItem *)));
- connect(doc->ActPage, SIGNAL(ChBMText(PageItem *)), this, SLOT(BookMarkTxT(PageItem *)));
- connect(doc->ActPage, SIGNAL(NewBMNr(int, int)), BookPal->BView, SLOT(ChangeItem(int, int)));
- slotDocCh(!doc->loading);
-}
-
-/** Ansicht absolut zoomen */
-void ScribusApp::slotZoomAbs(float z)
-{
- doc->Scale = z;
- view->slotDoZoom();
-}
-
-void ScribusApp::slotZoomFit()
-{
- float dx = (view->width()-50) / (doc->PageB+30);
- float dy = (view->height()-70) / (doc->PageH+30);
- if (dx > dy)
- {
- slotZoomAbs(dy);
- }
- else
- {
- slotZoomAbs(dx);
- }
-}
-
-/** Ansicht 20 % */
-void ScribusApp::slotZoom20()
-{
- slotZoomAbs(0.2);
-}
-
-/** Ansicht 50 % */
-void ScribusApp::slotZoom50()
-{
- slotZoomAbs(0.5);
-}
-
-/** Ansicht 75 % */
-void ScribusApp::slotZoom75()
-{
- slotZoomAbs(0.75);
-}
-
-/** Ansicht 100 % */
-void ScribusApp::slotZoom100()
-{
- slotZoomAbs(1.0);
-}
-
-/** Ansicht 200 % */
-void ScribusApp::slotZoom200()
-{
- slotZoomAbs(2.0);
-}
-
-void ScribusApp::ToggleMarks()
-{
- if (doc->Marks)
- {
- doc->Marks = false;
- viewMenu->changeItem(Markers, tr("Show Margins"));
- }
- else
- {
- doc->Marks = true;
- viewMenu->changeItem(Markers, tr("Hide Margins"));
- }
- view->DrawNew();
-}
-
-void ScribusApp::ToggleFrames()
-{
- if (doc->ShFrames)
- {
- doc->ShFrames = false;
- viewMenu->changeItem(FrameDr, tr("Show Frames"));
- }
- else
- {
- doc->ShFrames = true;
- viewMenu->changeItem(FrameDr, tr("Hide Frames"));
- }
- view->DrawNew();
-}
-
-void ScribusApp::ToggleMpal()
-{
- if (Mpal->isVisible())
- {
- Prefs.Mpalx = Mpal->pos().x();
- Prefs.Mpaly = Mpal->pos().y();
- Mpal->hide();
- toolMenu->changeItem(viewMpal, tr("Show Measurements"));
- }
- else
- {
- Mpal->show();
- Mpal->TabStack->raiseWidget(0);
- toolMenu->changeItem(viewMpal, tr("Hide Measurements"));
- }
-}
-
-void ScribusApp::ToggleTpal()
-{
- if (Tpal->isVisible())
- {
- Prefs.Tpalx = Tpal->pos().x();
- Prefs.Tpaly = Tpal->pos().y();
- Tpal->close();
- toolMenu->changeItem(viewTpal, tr("Show Outline"));
- }
- else
- {
- if (HaveDoc)
- Tpal->BuildTree(view);
- Tpal->show();
- toolMenu->changeItem(viewTpal, tr("Hide Outline"));
- }
-}
-
-void ScribusApp::ToggleBpal()
-{
- if (ScBook->isVisible())
- {
- Prefs.SCpalx = ScBook->pos().x();
- Prefs.SCpaly = ScBook->pos().y();
- Prefs.SCpalw = ScBook->size().width();
- Prefs.SCpalh = ScBook->size().height();
- ScBook->close();
- toolMenu->changeItem(viewBpal, tr("Show Scrapbook"));
- }
- else
- {
- ScBook->show();
- toolMenu->changeItem(viewBpal, tr("Hide Scrapbook"));
- }
-}
-
-void ScribusApp::ToggleLpal()
-{
- if (Lpal->isVisible())
- {
- Prefs.Lpalx = Lpal->pos().x();
- Prefs.Lpaly = Lpal->pos().y();
- Lpal->close();
- toolMenu->changeItem(viewLpal, tr("Show Layers"));
- }
- else
- {
- if (HaveDoc)
- Lpal->setLayers(&doc->Layers, &doc->ActiveLayer);
- Lpal->show();
- toolMenu->changeItem(viewLpal, tr("Hide Layers"));
- }
-}
-
-void ScribusApp::ToggleSepal()
-{
- if (Sepal->isVisible())
- {
- Prefs.Sepalx = Sepal->pos().x();
- Prefs.Sepaly = Sepal->pos().y();
- Prefs.SepalT = Sepal->TemplList->Thumb;
- Prefs.SepalN = Sepal->PageView->Namen;
- Sepal->close();
- toolMenu->changeItem(viewSepal, tr("Show Page Palette"));
- }
- else
- {
- Sepal->show();
- toolMenu->changeItem(viewSepal, tr("Hide Page Palette"));
- }
-}
-
-void ScribusApp::ToggleBookpal()
-{
- if (BookPal->isVisible())
- {
- Prefs.Bopalx = BookPal->pos().x();
- Prefs.Bopaly = BookPal->pos().y();
- BookPal->hide();
- toolMenu->changeItem(viewBopal, tr("Show Bookmarks"));
- }
- else
- {
- BookPal->show();
- toolMenu->changeItem(viewBopal, tr("Hide Bookmarks"));
- }
-}
-
-void ScribusApp::ToggleTools()
-{
- if (WerkTools->Sichtbar)
- {
- WerkTools->hide();
- WerkTools->Sichtbar = false;
- toolMenu->changeItem(viewTools, tr("Show Tools"));
- }
- else
- {
- WerkTools->show();
- WerkTools->Sichtbar = true;
- toolMenu->changeItem(viewTools, tr("Hide Tools"));
- }
-}
-
-void ScribusApp::TogglePics()
-{
- uint a, b;
- if (doc->ShowPic)
- {
- viewMenu->changeItem(Bilder, tr("Show Images"));
- doc->ShowPic = false;
- }
- else
- {
- viewMenu->changeItem(Bilder, tr("Hide Images"));
- doc->ShowPic = true;
- }
- for (a=0; a<view->Pages.count(); ++a)
- {
- for (b=0; b<view->Pages.at(a)->Items.count(); ++b)
- {
- if (view->Pages.at(a)->Items.at(b)->PType == 2)
- {
- view->Pages.at(a)->Items.at(b)->PicArt = doc->ShowPic;
- }
- }
- view->Pages.at(a)->update();
- }
-}
-
-void ScribusApp::ToggleRaster()
-{
- uint a;
- if (doc->Raster)
- {
- viewMenu->changeItem(Ras, tr("Show Grid"));
- doc->Raster = false;
- }
- else
- {
- viewMenu->changeItem(Ras, tr("Hide Grid"));
- doc->Raster = true;
- }
- for (a=0; a<view->Pages.count(); ++a)
- {
- view->Pages.at(a)->update();
- }
-}
-
-void ScribusApp::ToggleURaster()
-{
- doc->useRaster = !doc->useRaster;
- viewMenu->setItemChecked(uRas, doc->useRaster);
-}
-
-void ScribusApp::ToggleGuides()
-{
- uint a;
- if (doc->Guides)
- {
- viewMenu->changeItem(Guide, tr("Show Guides"));
- doc->Guides = false;
- }
- else
- {
- viewMenu->changeItem(Guide, tr("Hide Guides"));
- doc->Guides = true;
- }
- for (a=0; a<view->Pages.count(); ++a)
- {
- view->Pages.at(a)->update();
- }
-}
-
-void ScribusApp::ToggleUGuides()
-{
- doc->SnapGuides = !doc->SnapGuides;
- viewMenu->setItemChecked(uGuide, doc->SnapGuides);
-}
-
-void ScribusApp::ToggleFrameEdit()
-{
- if (doc->EditClip)
- {
- NoFrameEdit();
- }
- else
- {
- Npal->setDoc(doc);
- Npal->MoveN();
- Npal->HaveNode(false, false);
- Npal->MoveNode->setOn(true);
- Npal->show();
- doc->EditClipMode = 0;
- doc->EditClip = true;
- WerkTools->Select->setEnabled(false);
- WerkTools->Rotiere->setEnabled(false);
- WerkTools->Textedit->setEnabled(false);
- WerkTools->Zoom->setEnabled(false);
- WerkTools->Texte->setEnabled(false);
- WerkTools->BildB->setEnabled(false);
- WerkTools->Rechteck->setEnabled(false);
- WerkTools->Kreis->setEnabled(false);
- WerkTools->Linien->setEnabled(false);
- WerkTools->Polygon->setEnabled(false);
- WerkTools->PolyLin->setEnabled(false);
- WerkTools->KetteEin->setEnabled(false);
- WerkTools->KetteAus->setEnabled(false);
- WerkTools->PDFTool->setEnabled(false);
- WerkTools->PDFaTool->setEnabled(false);
- ObjMenu->setItemEnabled(Loesch, false);
- if (doc->ActPage->SelItem.count() != 0)
- {
- doc->ActPage->MarkClip(doc->ActPage->SelItem.at(0));
- Npal->PolyStatus(doc->ActPage->SelItem.at(0)->PType, doc->ActPage->SelItem.at(0)->PoLine.size());
- }
- }
- ShapeMenu->setItemChecked(ShapeEdit, doc->EditClip);
-}
-
-void ScribusApp::NoFrameEdit()
-{
- Prefs.Npalx = Npal->pos().x();
- Prefs.Npaly = Npal->pos().y();
- Npal->hide();
- WerkTools->Select->setEnabled(true);
- WerkTools->Select->setOn(true);
- WerkTools->Zoom->setEnabled(true);
- WerkTools->Texte->setEnabled(true);
- WerkTools->BildB->setEnabled(true);
- WerkTools->Rechteck->setEnabled(true);
- WerkTools->Kreis->setEnabled(true);
- WerkTools->Linien->setEnabled(true);
- WerkTools->Polygon->setEnabled(true);
- WerkTools->PolyLin->setEnabled(true);
- WerkTools->PDFTool->setEnabled(true);
- WerkTools->PDFaTool->setEnabled(true);
- WerkTools->Textedit->setOn(false);
- ObjMenu->setItemEnabled(Loesch, true);
- ShapeMenu->setItemChecked(ShapeEdit, false);
- if (HaveDoc)
- {
- doc->EditClip = false;
- if (doc->ActPage->SelItem.count() != 0)
- {
- HaveNewSel(doc->ActPage->SelItem.at(0)->PType);
- doc->ActPage->RefreshItem(doc->ActPage->SelItem.at(0));
- }
- else
- HaveNewSel(-1);
- }
-}
-
-void ScribusApp::slotSelect()
-{
- WerkTools->Select->setOn(true);
- WerkTools->Rotiere->setOn(false);
- WerkTools->Textedit->setOn(false);
- WerkTools->Zoom->setOn(false);
- WerkTools->Texte->setOn(false);
- WerkTools->BildB->setOn(false);
- WerkTools->Rechteck->setOn(false);
- WerkTools->Kreis->setOn(false);
- WerkTools->Linien->setOn(false);
- WerkTools->Polygon->setOn(false);
- WerkTools->PolyLin->setOn(false);
- WerkTools->KetteEin->setOn(false);
- WerkTools->KetteAus->setOn(false);
- WerkTools->PDFTool->setOn(false);
- WerkTools->PDFaTool->setOn(false);
- setAppMode(1);
-}
-
-void ScribusApp::ModeFromTB(int m)
-{
- if (m == 10)
- doc->ElemToLink = doc->ActPage->SelItem.at(0);
- if (doc->AppMode == 13)
- return;
- setAppMode(m);
-}
-
-void ScribusApp::setAppMode(int mode)
-{
- PageItem *b;
- setActiveWindow();
- if (HaveDoc)
- {
- if (doc->ActPage->SelItem.count() != 0)
- b = doc->ActPage->SelItem.at(0);
- else
- b = 0;
- int oldMode = doc->AppMode;
- doc->AppMode = mode;
- if (oldMode == 7)
- {
- disconnect(CurTimer, SIGNAL(timeout()), doc->ActPage, SLOT(BlinkCurs()));
- CurTimer->stop();
- delete CurTimer;
- menuBar()->setItemEnabled(Obm, 1);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 0);
- doc->ActPage->slotDoCurs(false);
- if (b != 0)
- doc->ActPage->RefreshItem(b);
- }
- if (mode == 7)
- {
- if (b != 0)
- {
- if ((b->PType == 6) || (b->PType == 7) || (b->PType == 8))
- {
- doc->AppMode = 1;
- ToggleFrameEdit();
- return;
- }
- }
- WerkTools->Select->setOn(false);
- WerkTools->Textedit->setOn(true);
- doc->ActPage->slotDoCurs(true);
- menuBar()->setItemEnabled(Obm, 0);
- CurTimer = new QTimer(doc->ActPage);
- connect(CurTimer, SIGNAL(timeout()), doc->ActPage, SLOT(BlinkCurs()));
- CurTimer->start(500);
- if (b != 0)
- {
- if (b->HasSel)
- {
- editMenu->setItemEnabled(edid1, 1);
- editMenu->setItemEnabled(edid2, 1);
- editMenu->setItemEnabled(edid4, 1);
- editMenu->setItemEnabled(edid5, 1);
- }
- else
- {
- editMenu->setItemEnabled(edid1, 0);
- editMenu->setItemEnabled(edid2, 0);
- editMenu->setItemEnabled(edid4, 0);
- editMenu->setItemEnabled(edid5, 1);
- }
- doc->ActPage->RefreshItem(b);
- }
- }
- if (mode == 13)
- {
- if (doc->ActPage->SelItem.count() != 0)
- doc->ActPage->Deselect(true);
- }
- if (mode == 6)
- qApp->setOverrideCursor(QCursor(loadIcon("LupeZ.xpm")), true);
- else
- qApp->setOverrideCursor(QCursor(ArrowCursor), true);
- }
-}
-
-void ScribusApp::Aktiv()
-{
- setActiveWindow();
- raise();
-}
-
-void ScribusApp::setItemTypeStyle(int id)
-{
- int a = TypeStyleMenu->indexOf(id);
- int b = 0;
- switch (a)
- {
- case 0:
- b = 4;
- break;
- case 1:
- b = 8;
- break;
- case 2:
- b = 16;
- break;
- case 3:
- b = 64;
- break;
- case 4:
- b = 1;
- break;
- case 5:
- b = 2;
- break;
- }
- setItemHoch(b);
-}
-
-void ScribusApp::setStilvalue(int s)
-{
- uint a;
- doc->CurrentStyle = s;
- for (a = 0; a < TypeStyleMenu->count(); ++a)
- {
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(a), false);
- }
- if (s & 4)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(0), true);
- if (s & 8)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(1), true);
- if (s & 16)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(2), true);
- if (s & 64)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(3), true);
- if (s & 1)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(4), true);
- if (s & 2)
- TypeStyleMenu->setItemChecked(TypeStyleMenu->idAt(5), true);
- emit TextStil(s);
-}
-
-void ScribusApp::setItemHoch(int h)
-{
- if (doc->ActPage->SelItem.count() != 0)
- {
- setActiveWindow();
- if (h == 0)
- doc->CurrentStyle = 0;
- else
- {
- doc->CurrentStyle = doc->CurrentStyle ^ h;
- if ((h == 1) && (doc->CurrentStyle & 2))
- doc->CurrentStyle = doc->CurrentStyle & ~2;
- if ((h == 2) && (doc->CurrentStyle & 1))
- doc->CurrentStyle = doc->CurrentStyle & ~1;
- }
- setStilvalue(doc->CurrentStyle);
- doc->ActPage->chTyStyle(h);
- slotDocCh();
- }
-}
-
-void ScribusApp::AdjustBM()
-{
- for (uint a = 0; a < view->Pages.count(); ++a)
- {
- for (uint b = 0; b < view->Pages.at(a)->Items.count(); ++b)
- {
- PageItem* bb = view->Pages.at(a)->Items.at(b);
- if (bb->isBookmark)
- {
- int it = bb->BMnr;
- QListViewItemIterator itn(BookPal->BView);
- for ( ; itn.current(); ++itn)
- {
- BookMItem *ite = (BookMItem*)itn.current();
- if (ite->ItemNr == it)
- {
- ite->Seite = a;
- break;
- }
- }
- }
- }
- }
- StoreBookmarks();
-}
-
-void ScribusApp::DeletePage2(int pg)
-{
- NoFrameEdit();
- if (view->Pages.count() == 1)
- return;
- for (uint d = 0; d < view->Pages.at(pg)->Items.count(); ++d)
- {
- if (view->Pages.at(pg)->Items.at(d)->isBookmark)
- DelBookMark(view->Pages.at(pg)->Items.at(d));
- }
- view->delPage(pg);
- AdjustBM();
- view->reformPages();
- if (view->Pages.count() == 1)
- {
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- }
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- Sepal->RebuildPage();
-}
-
-void ScribusApp::DeletePage()
-{
- int a, pg;
- NoFrameEdit();
- DelPages *dia = new DelPages(this, doc->ActPage->PageNr+1, view->Pages.count());
- if (dia->exec())
- {
- pg = dia->FromPage->value()-1;
- for (a = pg; a < dia->ToPage->value(); ++a)
- {
- for (uint d = 0; d < view->Pages.at(pg)->Items.count(); ++d)
- {
- if (view->Pages.at(pg)->Items.at(d)->isBookmark)
- DelBookMark(view->Pages.at(pg)->Items.at(d));
- }
- view->delPage(pg);
- AdjustBM();
- }
- view->reformPages();
- if (view->Pages.count() == 1)
- {
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- }
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- Sepal->RebuildPage();
- }
- delete dia;
-}
-
-void ScribusApp::MovePage()
-{
- NoFrameEdit();
- MovePages *dia = new MovePages(this, doc->ActPage->PageNr+1, view->Pages.count(), true);
- if (dia->exec())
- {
- int from = dia->FromPage->value();
- int to = dia->ToPage->value();
- int wie = dia->Where->currentItem();
- int wo = dia->ActualPage->value();
- if (from != wo)
- view->movePage(from-1, to, wo-1, wie);
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- AdjustBM();
- Sepal->RebuildPage();
- }
- delete dia;
-}
-
-void ScribusApp::CopyPage()
-{
- NoFrameEdit();
- MovePages *dia = new MovePages(this, doc->ActPage->PageNr+1, view->Pages.count(), false);
- if (dia->exec())
- {
- Page* from = view->Pages.at(dia->FromPage->value()-1);
- int wo = dia->ActualPage->value();
- switch (dia->Where->currentItem())
- {
- case 0:
- slotNewPage(wo-1);
- break;
- case 1:
- slotNewPage(wo);
- break;
- case 2:
- slotNewPage(view->Pages.count());
- break;
- }
- Page* Ziel = doc->ActPage;
- for (uint ite = 0; ite < from->Items.count(); ++ite)
- {
- from->Items.at(ite)->CopyIt(&Buffer);
- Ziel->PasteItem(&Buffer, true);
- if (from->Items.at(ite)->isBookmark)
- AddBookMark(Ziel->Items.at(Ziel->Items.count()-1));
- }
- Ziel->MPageNam = from->MPageNam;
- Ziel->Deselect(true);
- view->DrawNew();
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- Sepal->RebuildPage();
- AdjustBM();
- }
- delete dia;
-}
-
-void ScribusApp::setItemFont(int id)
-{
- QString nf;
- nf = *FontID[long(id)];
- SetNewFont(nf);
-}
-
-void ScribusApp::SetNewFont(QString nf)
-{
- Aktiv();
- int a;
- if (!doc->UsedFonts.contains(nf))
- {
- doc->AddFont(nf, Prefs.AvailFonts[nf]->Font);
- a = FontMenu->insertItem(new FmItem(nf, Prefs.AvailFonts[nf]->Font));
- FontID.insert(static_cast<long>(a), &Prefs.AvailFonts[nf]->SCName);
- }
- AdjustFontMenu(nf);
- doc->ActPage->ItemFont(nf);
- slotDocCh();
-}
-
-void ScribusApp::AdjustFontMenu(QString nf)
-{
- uint a;
- QString df;
- Mpal->Fonts->setText(nf);
- for (a = 2; a < FontMenu->count(); ++a)
- {
- df = *FontID[long(FontMenu->idAt(a))];
- if (df == nf)
- FontMenu->setItemChecked(FontMenu->idAt(a), true);
- else
- FontMenu->setItemChecked(FontMenu->idAt(a), false);
- }
-}
-
-void ScribusApp::setItemFSize(int id)
-{
- int c = SizeTMenu->indexOf(id);
- bool ok = false;
- if (c > 0)
- doc->ActPage->chFSize(SizeTMenu->text(id).left(2).toInt());
- else
- {
- Query* dia = new Query(this, "New", 1, 0, "Size:", "Size");
- if (dia->exec())
- {
- c = dia->Answer->text().toInt(&ok);
- if ((ok) && (c < 513) && (c > 0))
- doc->ActPage->chFSize(c);
- delete dia;
- }
- }
- slotDocCh();
-}
-
-void ScribusApp::setFSizeMenu(int size)
-{
- uint a;
- for (a = 0; a < SizeTMenu->count(); ++a)
- {
- SizeTMenu->setItemChecked(SizeTMenu->idAt(a), false);
- if (SizeTMenu->text(SizeTMenu->idAt(a)).left(2).toInt() == size)
- {
- SizeTMenu->setItemChecked(SizeTMenu->idAt(a), true);
- }
- }
-}
-
-void ScribusApp::setItemFarbe(int id)
-{
- uint a;
- for (a = 0; a < ColorMenu->count(); ++a)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), false);
- }
- ColorMenu->setItemChecked(id, true);
- doc->ActPage->ItemBrush(ColorMenu->text(id), true);
- slotDocCh();
-}
-
-void ScribusApp::setItemShade(int id)
-{
- int c = ShadeMenu->indexOf(id);
- uint a;
- bool ok = false;
- for (a = 0; a < ShadeMenu->count(); ++a)
- {
- ShadeMenu->setItemChecked(ShadeMenu->idAt(a), false);
- }
- ShadeMenu->setItemChecked(id, true);
- if (c > 0)
- {
- doc->ActPage->ItemBrushShade((c-1) * 10, true);
- }
- else
- {
- Query* dia = new Query(this, "New", 1, 0, "Shade:", "Shade");
- if (dia->exec())
- {
- c = dia->Answer->text().toInt(&ok);
- if (ok)
- {
- doc->ActPage->ItemBrushShade(c);
- }
- delete dia;
- }
- }
- slotDocCh();
-}
-
-void ScribusApp::setCSMenu(QString k, QString l, int lk , int ls)
-{
- uint a;
- QString la;
- int lb;
- if (doc->ActPage->SelItem.count() != 0)
- {
- if (doc->ActPage->SelItem.at(0)->PType == 4)
- {
- la = k;
- lb = lk;
- }
- else
- {
- la = l;
- lb = ls;
- }
- }
- else
- {
- la = l;
- lb = ls;
- }
- if (la == "None")
- la = tr("None");
- for (a = 0; a < ColorMenu->count(); ++a)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), false);
- if (ColorMenu->text(ColorMenu->idAt(a)) == la)
- ColorMenu->setItemChecked(ColorMenu->idAt(a), true);
- }
- for (a = 0; a < ShadeMenu->count(); ++a)
- {
- ShadeMenu->setItemChecked(ShadeMenu->idAt(a), false);
- }
- ShadeMenu->setItemChecked(ShadeMenu->idAt(lb/10+1), true);
-}
-
-void ScribusApp::slotEditStyles()
-{
- QValueList<uint> ers;
- QString nn;
- bool ff;
- uint nr;
- ers.clear();
- if (HaveDoc)
- {
- StilFormate *dia = new StilFormate(this, doc, &Prefs.AvailFonts);
- if (dia->exec())
- {
- for (uint a=0; a<doc->Vorlagen.count(); ++a)
- {
- ff = false;
- nn = doc->Vorlagen[a].Vname;
- for (uint b=0; b<dia->TempVorl.count(); ++b)
- {
- if (nn == dia->TempVorl[b].Vname)
- {
- nr = b;
- ff = true;
- break;
- }
- }
- if (ff)
- ers.append(nr);
- else
- ers.append(0);
- }
- doc->Vorlagen = dia->TempVorl;
- for (uint c=0; c<view->Pages.count(); ++c)
- {
- for (uint d=0; d<view->Pages.at(c)->Items.count(); ++d)
- {
- if (view->Pages.at(c)->Items.at(d)->PType == 4)
- {
- for (uint e=0; e<view->Pages.at(c)->Items.at(d)->Ptext.count(); ++e)
- {
- if (view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab > 4)
- view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab = ers[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab];
- if (doc->Vorlagen[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab].Font != "")
- {
- view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cfont = doc->Vorlagen[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab].Font;
- view->Pages.at(c)->Items.at(d)->Ptext.at(e)->csize = doc->Vorlagen[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cab].FontSize;
- }
- }
- }
- }
- }
- for (uint a=0; a<doc->Vorlagen.count(); ++a)
- {
- if (doc->Vorlagen[a].Font != "")
- SetNewFont(doc->Vorlagen[a].Font);
- }
- Mpal->Spal->updateFList();
- view->DrawNew();
- slotDocCh();
- }
- delete dia;
- }
-}
-
-void ScribusApp::setItemTextAli(int id)
-{
- int a = AliMenu->indexOf(id);
- setNewAbStyle(a);
-}
-
-void ScribusApp::setNewAbStyle(int a)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->SetAbStyle(a);
- doc->CurrentABStil = a;
- Mpal->setAli(a);
- slotDocCh();
- }
-}
-
-void ScribusApp::setAbsValue(int a)
-{
- doc->CurrentABStil = a;
- Mpal->setAli(a);
- for (int b = 0; b < 5; ++b)
- {
- AliMenu->setItemChecked(AliMenu->idAt(b), false);
- }
- if (a < 5)
- {
- Mpal->Spal->setCurrentItem(0);
- AliMenu->setItemChecked(AliMenu->idAt(a), true);
- }
- else
- Mpal->Spal->setCurrentItem(a-4);
-}
-
-void ScribusApp::slotEditColors()
-{
- int a;
- uint b, c, d;
- CListe edc;
- QMap<QString,QString> ers;
- if (HaveDoc)
- {
- edc = doc->PageColors;
- }
- else
- {
- edc = Prefs.DColors;
- }
- Farbmanager* dia = new Farbmanager(this, edc);
- if (dia->exec())
- {
- if (HaveDoc)
- {
- slotDocCh();
- doc->PageColors = dia->EditColors;
- Mpal->Cpal->SetColors(doc->PageColors);
- CListe::Iterator it;
- ColorMenu->clear();
- QPixmap pm = QPixmap(15, 15);
- a = 0;
- ColorMenu->insertItem(tr("None"));
- for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
- {
- pm.fill(doc->PageColors[it.key()].getRGBColor());
- ColorMenu->insertItem(QIconSet(pm), it.key());
- if (it.key() == doc->Dbrush)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), true);
- }
- a++;
- }
- ers = dia->Ersatzliste;
- if (!ers.isEmpty())
- {
- for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
- {
- ers.remove(it.key());
- }
- if (!ers.isEmpty())
- {
- QMap<QString,QString>::Iterator it;
- for (it = ers.begin(); it != ers.end(); ++it)
- {
- for (b=0; b<view->Pages.count(); ++b)
- {
- for (c=0; c<view->Pages.at(b)->Items.count(); ++c)
- {
- if (view->Pages.at(b)->Items.at(c)->PType == 4)
- {
- for (d=0; d<view->Pages.at(b)->Items.at(c)->Ptext.count(); ++d)
- {
- if (it.key() == view->Pages.at(b)->Items.at(c)->Ptext.at(d)->ccolor)
- {
- view->Pages.at(b)->Items.at(c)->Ptext.at(d)->ccolor = it.data();
- }
- }
- }
- if (it.key() == view->Pages.at(b)->Items.at(c)->Pcolor)
- {
- view->Pages.at(b)->Items.at(c)->Pcolor = it.data();
- }
- if (it.key() == view->Pages.at(b)->Items.at(c)->Pcolor2)
- {
- view->Pages.at(b)->Items.at(c)->Pcolor2 = it.data();
- }
- }
- }
- }
- }
- }
- view->DrawNew();
- }
- else
- {
- Prefs.DColors = dia->EditColors;
- Mpal->Cpal->SetColors(Prefs.DColors);
- }
- }
- delete dia;
-}
-
-void ScribusApp::setPenFarbe(QString farbe)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->ItemPen(farbe);
- slotDocCh();
- }
-}
-
-void ScribusApp::setPenShade(int sh)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->ItemPenShade(sh);
- slotDocCh();
- }
-}
-
-void ScribusApp::setBrushFarbe(QString farbe)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->ItemBrush(farbe);
- slotDocCh();
- }
-}
-
-void ScribusApp::setBrushShade(int sh)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->ItemBrushShade(sh);
- slotDocCh();
- }
-}
-
-void ScribusApp::setGradFill(int typ, QString col1, int sh1, QString col2, int sh2)
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->ItemGradFill(typ, col1, sh1, col2, sh2);
- slotDocCh();
- }
-}
-
-void ScribusApp::GetBrushPen()
-{
- setActiveWindow();
- if (HaveDoc)
- {
- doc->ActPage->QueryFarben();
- slotDocCh();
- }
-}
-
-void ScribusApp::RectFrame()
-{
- doc->ActPage->SetFrameRect();
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::RoundedFrame()
-{
- doc->ActPage->SetFrameRounded();
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::OvalFrame()
-{
- doc->ActPage->SetFrameOval();
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::DeleteObjekt()
-{
- if (!doc->EditClip)
- doc->ActPage->DeleteItem();
-}
-
-void ScribusApp::Objekt2Back()
-{
- doc->ActPage->ToBack();
-}
-
-void ScribusApp::Objekt2Front()
-{
- doc->ActPage->ToFront();
-}
-
-void ScribusApp::ObjektRaise()
-{
- doc->ActPage->RaiseItem();
-}
-
-void ScribusApp::ObjektLower()
-{
- doc->ActPage->LowerItem();
-}
-
-void ScribusApp::ObjektDup()
-{
- slotEditCopy();
- doc->ActPage->Deselect(true);
- slotEditPaste();
- for (uint b=0; b<doc->ActPage->SelItem.count(); ++b)
- {
- doc->ActPage->SelItem.at(b)->Locked = false;
- doc->ActPage->MoveItem(DispX, DispY, doc->ActPage->SelItem.at(b));
- }
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::ObjektDupM()
-{
- NoFrameEdit();
- Mdup *dia = new Mdup(this, DispX * UmReFaktor, DispY * UmReFaktor, doc->Einheit);
- if (dia->exec())
- {
- int anz = dia->Ncopies->value();
- float dH = static_cast<float>(dia->ShiftH->value()) / UmReFaktor / 100.0;
- float dV = static_cast<float>(dia->ShiftV->value()) / UmReFaktor / 100.0;
- int a;
- if (anz>0)
- {
- for (a=0; a<anz; ++a)
- {
- slotEditCopy();
- doc->ActPage->Deselect(true);
- slotEditPaste();
- for (uint b=0; b<doc->ActPage->SelItem.count(); ++b)
- {
- doc->ActPage->SelItem.at(b)->Locked = false;
- doc->ActPage->MoveItem(dH, dV, doc->ActPage->SelItem.at(b));
- }
- DispX = dH;
- DispY = dV;
- }
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- }
- }
- delete dia;
-}
-
-void ScribusApp::SelectFromOutl(int Page, int Item)
-{
- NoFrameEdit();
- setActiveWindow();
- doc->ActPage->Deselect(true);
- view->GotoPage(Page);
- doc->ActPage->SelectItemNr(Item);
-}
-
-void ScribusApp::SelectFromOutlS(int Page)
-{
- NoFrameEdit();
- setActiveWindow();
- doc->ActPage->Deselect(true);
- view->GotoPage(Page);
-}
-
-void ScribusApp::InfoDoc()
-{
- DocInfos *dia = new DocInfos(this, doc->DocAutor, doc->DocTitel, doc->DocComments);
- if (dia->exec())
- {
- doc->DocAutor = dia->AutorInfo->text();
- doc->DocTitel = dia->TitelInfo->text();
- doc->DocComments = dia->MultiLineEdit1->text();
- slotDocCh();
- }
- delete dia;
-}
-
-void ScribusApp::ObjektAlign()
-{
- float xdp, ydp;
- bool xa, ya, Vth, Vtv;
- int xart, yart, ein;
- if (HaveDoc)
- ein = doc->Einheit;
- else
- ein = Prefs.Einheit;
- NoFrameEdit();
- Align *dia = new Align(this, doc->ActPage->SelItem.count(), ein);
- connect(dia, SIGNAL(ApplyDist(bool, bool, bool, bool, float, float, int, int)),
- this, SLOT(DoAlign(bool, bool, bool, bool, float, float, int, int)));
- if (dia->exec())
- {
- xdp = float(dia->AHor->value()) / UmReFaktor / 100.0;
- xa = (dia->CheckH->isChecked() || dia->VerteilenH->isChecked());
- ydp = float(dia->AVert->value()) / UmReFaktor/ 100.0;
- ya = (dia->CheckV->isChecked() || dia->VerteilenV->isChecked());
- xart = dia->VartH->currentItem();
- yart = dia->VartV->currentItem();
- Vth = dia->VerteilenH->isChecked();
- Vtv = dia->VerteilenV->isChecked();
- doc->ActPage->AlignObj(xa, ya, Vth, Vtv, xdp, ydp, xart, yart);
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- }
- delete dia;
-}
-
-void ScribusApp::DoAlign(bool xa, bool ya, bool Vth, bool Vtv, float xdp, float ydp, int xart, int yart)
-{
- doc->ActPage->AlignObj(xa, ya, Vth, Vtv, xdp, ydp, xart, yart);
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::BuildFontMenu()
-{
- QPopupMenu *pm;
- FontID.clear();
- FontMenu->clear();
- FStyleMenu->clear();
- int a;
- QString b = " ";
- QMap<QString,QStrList> Fami;
- SCFontsIterator it(Prefs.AvailFonts);
- for ( ; it.current(); ++it)
- {
- QString family,style;
- if (it.current()->UseFont)
- {
- QString &fn=it.current()->SCName;
- int pos=fn.find(" ");
- family=fn.left(pos);
- style=fn.right(fn.length()-pos);
- Fami[family].inSort(fn);
- }
- }
-
- QMapIterator<QString,QStrList> qmi;
- for (qmi = Fami.begin(); qmi != Fami.end(); ++qmi)
- {
- pm = new QPopupMenu();
- QString family=qmi.key();
- QStrList &qsl=qmi.data();
- for( QStrListIterator sli(qsl) ; sli.current() ; ++sli)
- {
- if (Prefs.AvailFonts[sli.current()]->UseFont)
- {
- QString &fn=Prefs.AvailFonts[sli.current()]->SCName;
- a = pm->insertItem(new FmItem(fn, Prefs.AvailFonts[fn]->Font));
- FontID.insert(long(a), &fn);
- }
- }
- connect(pm, SIGNAL(activated(int)), this, SLOT(setItemFont(int)));
- FStyleMenu->insertItem(family, pm);
- }
- a = FontMenu->insertItem(tr("Face"), FStyleMenu);
-// FontID.insert(long(a), &b);
- a = FontMenu->insertSeparator();
-// FontID.insert(long(a), &b);
- if (!HaveDoc)
- {
- it.toFirst();
- a = FontMenu->insertItem(new FmItem(it.currentKey(), it.current()->Font));
- FontMenu->setItemChecked(a, true);
- FontID.insert(long(a), &it.current()->SCName);
- }
- else
- {
- QMap<QString,QFont>::Iterator it3;
- for (it3 = doc->UsedFonts.begin(); it3 != doc->UsedFonts.end(); ++it3)
- {
- a = FontMenu->insertItem(new FmItem(it3.key(), it3.data()));
- if (it3.key() == doc->Dfont)
- {
- FontMenu->setItemChecked(a, true);
- }
- FontID.insert(long(a), &it3.key());
- }
- }
-}
-
-void ScribusApp::GetAllFonts()
-{
- Prefs.AvailFonts.GetFonts(PrefsPfad);
- if (Prefs.AvailFonts.isEmpty())
- NoFonts = true;
-}
-
-void ScribusApp::slotFontOrg()
-{
- uint a;
- FontPrefs *dia = new FontPrefs(this, Prefs.AvailFonts, HaveDoc, &Prefs, PrefsPfad);
- connect(dia, SIGNAL(ReReadPrefs()), this, SLOT(ReadPrefs()));
- if (dia->exec())
- {
- a = 0;
- SCFontsIterator it(Prefs.AvailFonts);
- for ( ; it.current() ; ++it)
- {
- it.current()->EmbedPS = dia->FlagsPS.at(a)->isChecked();
- it.current()->UseFont = dia->FlagsUse.at(a)->isChecked();
- a++;
- }
- a = 0;
- QMap<QString,QString>::Iterator itfsu;
- Prefs.GFontSub.clear();
- for (itfsu = dia->RList.begin(); itfsu != dia->RList.end(); ++itfsu)
- {
- Prefs.GFontSub[itfsu.key()] = dia->FlagsRepl.at(a)->currentText();
- a++;
- }
- }
- disconnect(dia, SIGNAL(ReReadPrefs()), this, SLOT(ReadPrefs()));
- delete dia;
-}
-
-void ScribusApp::slotPrefsOrg()
-{
- void *mo;
- char *error;
- typedef Preferences* (*sdem)(QWidget *d, preV *Vor);
- sdem demo;
- QString pfad = PREL;
- pfad += "/lib/scribus/libs/libpreferences.so";
- mo = dlopen(pfad, RTLD_LAZY);
- if (!mo)
- {
- std::cout << "Can't find Plugin" << endl;
- return;
- }
- dlerror();
- demo = (sdem)dlsym(mo, "Run");
- if ((error = dlerror()) != NULL)
- {
- std::cout << "Can't find Symbol" << endl;
- dlclose(mo);
- return;
- }
- Preferences *dia = (*demo)(this, &Prefs);
- if (dia->exec())
- {
- Prefs.KeyActions = dia->KKC;
- SetShortCut();
- Prefs.AppFontSize = dia->GFsize->value();
- Prefs.Wheelval = dia->SpinBox3->value();
- Prefs.RecentDCount = dia->Recen->value();
- Prefs.DocDir = dia->Docs->text();
- DocDir = Prefs.DocDir;
- switch (dia->PreviewSize->currentItem())
- {
- case 0:
- Prefs.PSize = 40;
- break;
- case 1:
- Prefs.PSize = 60;
- break;
- case 2:
- Prefs.PSize = 80;
- break;
- }
- Prefs.SaveAtQ = dia->SaveAtQuit->isChecked();
- ScBook->BibWin->RebuildView();
- ScBook->AdjustMenu();
- if (Prefs.GUI != dia->GUICombo->currentText())
- {
- Prefs.GUI = dia->GUICombo->currentText();
- qApp->setStyle(QStyleFactory::create(Prefs.GUI));
- }
- QFont apf = qApp->font();
- apf.setPointSize(Prefs.AppFontSize);
- qApp->setFont(apf,true);
- PolyC = dia->T6_Ecken->value();
- PolyF = dia->PFactor;
- PolyR = dia->T6_Faktor2->value();
- PolyS = dia->T6_Konvex->isChecked();
- PolyFd = dia->T6_Slider1->value();
- Prefs.PolyC = PolyC;
- Prefs.PolyF = PolyF;
- Prefs.PolyFd = PolyFd;
- Prefs.PolyS = PolyS;
- Prefs.PolyR = PolyR;
- Prefs.PageFormat = dia->GZComboF->currentItem();
- Prefs.Ausrichtung = dia->GZComboO->currentItem();
- Prefs.PageBreite = dia->Pagebr;
- Prefs.PageHoehe = dia->Pageho;
- Prefs.RandOben = dia->TopR->value() / UmReFaktor / 100;
- Prefs.RandUnten = dia->BottomR->value() / UmReFaktor / 100;
- Prefs.RandLinks = dia->LeftR->value() / UmReFaktor / 100;
- Prefs.RandRechts = dia->RightR->value() / UmReFaktor / 100;
- Prefs.DoppelSeiten = dia->Doppelseiten->isChecked();
- Prefs.ErsteLinks = dia->Linkszuerst->isChecked();
- Prefs.PDFTransparency = dia->UsePDFTrans->isChecked();
- Mpal->Cpal->UseTrans(Prefs.PDFTransparency);
- if (HaveDoc)
- {
- doc->GrabRad = dia->SpinBox3_2->value();
- doc->GuideRad = dia->SpinBox2g->value() / UmReFaktor / 100;
- doc->Dfont = dia->FontCombo->currentText();
- doc->Dsize = dia->SizeCombo->currentText().left(2).toInt();
- doc->minorGrid = dia->SpinBox1->value() / UmReFaktor / 100;
- doc->majorGrid = dia->SpinBox2->value() / UmReFaktor / 100;
- doc->minorColor = dia->Cmin;
- doc->majorColor = dia->Cmax;
- doc->papColor = dia->Cpaper;
- doc->margColor = dia->Crand;
- doc->guideColor = dia->Cgui;
- doc->VHoch = dia->VHochW->value();
- doc->VHochSc = dia->VHochWSc->value();
- doc->VTief = dia->VTiefW->value();
- doc->VTiefSc = dia->VTiefWSc->value();
- doc->VKapit = dia->SmallCaps->value();
- doc->Dpen = dia->Foreground->currentText();
- if (doc->Dpen == tr("None"))
- doc->Dpen = "None";
- doc->DpenText = dia->ForegroundT->currentText();
- if (doc->DpenText == tr("None"))
- doc->DpenText = "None";
- doc->Dbrush = dia->Background->currentText();
- if (doc->Dbrush == tr("None"))
- doc->Dbrush = "None";
- doc->Dshade = dia->Shade->value();
- doc->Dshade2 = dia->Shade2->value();
- switch (dia->Linestyle->currentItem())
- {
- case 0:
- doc->DLineArt = SolidLine;
- break;
- case 1:
- doc->DLineArt = DashLine;
- break;
- case 2:
- doc->DLineArt = DotLine;
- break;
- case 3:
- doc->DLineArt = DashDotLine;
- break;
- case 4:
- doc->DLineArt = DashDotDotLine;
- break;
- }
- doc->Dwidth = dia->LineW->value()/10;
- doc->DpenLine = dia->Foreground2->currentText();
- if (doc->DpenLine == tr("None"))
- doc->DpenLine = "None";
- doc->DshadeLine = dia->Shade22->value();
- switch (dia->Linestyle2->currentItem())
- {
- case 0:
- doc->DLstyleLine = SolidLine;
- break;
- case 1:
- doc->DLstyleLine = DashLine;
- break;
- case 2:
- doc->DLstyleLine = DotLine;
- break;
- case 3:
- doc->DLstyleLine = DashDotLine;
- break;
- case 4:
- doc->DLstyleLine = DashDotDotLine;
- break;
- }
- doc->DwidthLine = dia->LineW2->value()/10;
- doc->MagMin = dia->MinMag->value();
- doc->MagMax = dia->MaxMag->value();
- doc->MagStep = dia->StepMag->value();
- doc->DbrushPict = dia->BackgroundP->currentText();
- if (doc->DbrushPict == tr("None"))
- doc->DbrushPict = "None";
- doc->ShadePict = dia->ShadeP->value();
- doc->ScaleX = static_cast<float>(dia->XScale->value()) / 100;
- doc->ScaleY = static_cast<float>(dia->YScale->value()) / 100;
- doc->ScaleType = dia->FreeScale->isChecked();
- doc->AspectRatio = dia->Aspect->isChecked();
- doc->Before = dia->RadioButton6->isChecked();
- doc->Einheit = dia->UnitCombo->currentItem();
- switch (doc->Einheit)
- {
- case 0:
- view->UN->setText("pt");
- break;
- case 1:
- view->UN->setText("mm");
- break;
- case 2:
- view->UN->setText("in");
- break;
- case 3:
- view->UN->setText("p");
- break;
- }
- doc->PagesSbS = dia->SidebySide->isChecked();
- doc->ShFrames = dia->FramesVisible->isChecked();
- doc->RandFarbig = dia->RandFarb->isChecked();
- doc->AutoLine = dia->AutoLineV->value();
- doc->AutoSave = dia->ASon->isChecked();
- if (doc->AutoSave)
- {
- doc->ASaveTimer->stop();
- doc->ASaveTimer->start(dia->ASTime->value() * 60 * 1000);
- }
- Mpal->UnitChange();
- view->reformPages();
- view->DrawNew();
- }
- else
- {
- Prefs.GrabRad = dia->SpinBox3_2->value();
- Prefs.GuideRad = dia->SpinBox2g->value() / UmReFaktor / 100;
- Prefs.DefFont = dia->FontCombo->currentText();
- Prefs.DefSize = dia->SizeCombo->currentText().left(2).toInt();
- Prefs.DminGrid = dia->SpinBox1->value() / UmReFaktor / 100;
- Prefs.DmajGrid = dia->SpinBox2->value() / UmReFaktor / 100;
- Prefs.DminColor = dia->Cmin;
- Prefs.DmajColor = dia->Cmax;
- Prefs.DpapColor = dia->Cpaper;
- Prefs.DmargColor = dia->Crand;
- Prefs.guideColor = dia->Cgui;
- Prefs.DVHoch = dia->VHochW->value();
- Prefs.DVHochSc = dia->VHochWSc->value();
- Prefs.DVTief = dia->VTiefW->value();
- Prefs.DVTiefSc = dia->VTiefWSc->value();
- Prefs.DVKapit = dia->SmallCaps->value();
- Prefs.Dpen = dia->Foreground->currentText();
- if (Prefs.Dpen == tr("None"))
- Prefs.Dpen = "None";
- Prefs.DpenText = dia->ForegroundT->currentText();
- if (Prefs.DpenText == tr("None"))
- Prefs.DpenText = "None";
- Prefs.Dbrush = dia->Background->currentText();
- if (Prefs.Dbrush == tr("None"))
- Prefs.Dbrush = "None";
- Prefs.Dshade = dia->Shade->value();
- Prefs.Dshade2 = dia->Shade2->value();
- switch (dia->Linestyle->currentItem())
- {
- case 0:
- Prefs.DLineArt = SolidLine;
- break;
- case 1:
- Prefs.DLineArt = DashLine;
- break;
- case 2:
- Prefs.DLineArt = DotLine;
- break;
- case 3:
- Prefs.DLineArt = DashDotLine;
- break;
- case 4:
- Prefs.DLineArt = DashDotDotLine;
- break;
- }
- Prefs.Dwidth = dia->LineW->value()/10;
- Prefs.DpenLine = dia->Foreground2->currentText();
- if (Prefs.DpenLine == tr("None"))
- Prefs.DpenLine = "None";
- Prefs.DshadeLine = dia->Shade22->value();
- switch (dia->Linestyle2->currentItem())
- {
- case 0:
- Prefs.DLstyleLine = SolidLine;
- break;
- case 1:
- Prefs.DLstyleLine = DashLine;
- break;
- case 2:
- Prefs.DLstyleLine = DotLine;
- break;
- case 3:
- Prefs.DLstyleLine = DashDotLine;
- break;
- case 4:
- Prefs.DLstyleLine = DashDotDotLine;
- break;
- }
- Prefs.DwidthLine = dia->LineW2->value()/10;
- Prefs.MagMin = dia->MinMag->value();
- Prefs.MagMax = dia->MaxMag->value();
- Prefs.MagStep = dia->StepMag->value();
- Prefs.DbrushPict = dia->BackgroundP->currentText();
- if (Prefs.DbrushPict == tr("None"))
- Prefs.DbrushPict = "None";
- Prefs.ShadePict = dia->ShadeP->value();
- Prefs.ScaleX = static_cast<float>(dia->XScale->value()) / 100;
- Prefs.ScaleY = static_cast<float>(dia->YScale->value()) / 100;
- Prefs.ScaleType = dia->FreeScale->isChecked();
- Prefs.AspectRatio = dia->Aspect->isChecked();
- Prefs.Before = dia->RadioButton6->isChecked();
- Prefs.Einheit = dia->UnitCombo->currentItem();
- switch (Prefs.Einheit)
- {
- case 0:
- UmReFaktor = 1.0;
- break;
- case 1:
- UmReFaktor = 1.0 / 72.0 * 25.4;
- break;
- case 2:
- UmReFaktor = 1.0 / 72.0;
- break;
- case 3:
- UmReFaktor = 1.0 / 12.0;
- break;
- }
- Prefs.PagesSbS = dia->SidebySide->isChecked();
- Prefs.ShFrames = dia->FramesVisible->isChecked();
- Prefs.RandFarbig = dia->RandFarb->isChecked();
- Prefs.AutoLine = dia->AutoLineV->value();
- Prefs.AutoSave = dia->ASon->isChecked();
- Prefs.AutoSaveTime = dia->ASTime->value() * 60 * 1000;
- }
- SavePrefs();
- }
- delete dia;
- dlclose(mo);
-}
-
-void ScribusApp::SavePrefs()
-{
- Prefs.MainX = abs(pos().x());
- Prefs.MainY = abs(pos().y());
- Prefs.MainW = size().width();
- Prefs.MainH = size().height();
- Prefs.Werkv = WerkTools->isVisible();
- Prefs.Mpalv = Mpal->isVisible();
- Prefs.Tpalv = Tpal->isVisible();
- Prefs.SCpalv = ScBook->isVisible();
- Prefs.Lpalv = Lpal->isVisible();
- Prefs.Sepalv = Sepal->isVisible();
- if (Mpal->isVisible())
- {
- Prefs.Mpalx = abs(Mpal->pos().x());
- Prefs.Mpaly = abs(Mpal->pos().y());
- }
- if (Tpal->isVisible())
- {
- Prefs.Tpalx = abs(Tpal->pos().x());
- Prefs.Tpaly = abs(Tpal->pos().y());
- }
- if (ScBook->isVisible())
- {
- Prefs.SCpalx = abs(ScBook->pos().x());
- Prefs.SCpaly = abs(ScBook->pos().y());
- Prefs.SCpalw = abs(ScBook->size().width());
- Prefs.SCpalh = abs(ScBook->size().height());
- }
- if (Sepal->isVisible())
- {
- Prefs.Sepalx = abs(Sepal->pos().x());
- Prefs.Sepaly = abs(Sepal->pos().y());
- }
- if (BookPal->isVisible())
- {
- Prefs.Bopalx = abs(BookPal->pos().x());
- Prefs.Bopaly = abs(BookPal->pos().y());
- }
- if (Lpal->isVisible())
- {
- Prefs.Lpalx = abs(Lpal->pos().x());
- Prefs.Lpaly = abs(Lpal->pos().y());
- }
- Prefs.RecentDocs.clear();
- uint max = QMIN(Prefs.RecentDCount, RecentDocs.count());
- for (uint m = 0; m < max; ++m)
- {
- Prefs.RecentDocs.append(RecentDocs[m]);
- }
- Prefs.PrinterName = PDef.Pname;
- Prefs.PrinterFile = PDef.Dname;
- Prefs.PrinterCommand = PDef.Command;
- ScriXmlDoc *ss = new ScriXmlDoc();
- ss->WritePref(&Prefs, PrefsPfad+"/scribus.rc");
- delete ss;
-}
-
-void ScribusApp::ReadPrefs()
-{
- ScriXmlDoc *ss = new ScriXmlDoc();
- bool erg = ss->ReadPref(&Prefs, PrefsPfad+"/scribus.rc");
- delete ss;
- if (!erg)
- return;
- PDef.Pname = Prefs.PrinterName;
- PDef.Dname = Prefs.PrinterFile;
- PDef.Command = Prefs.PrinterCommand;
- PolyC = Prefs.PolyC;
- PolyF = Prefs.PolyF;
- PolyFd = Prefs.PolyFd;
- PolyS = Prefs.PolyS;
- PolyR = Prefs.PolyR;
- recentMenu->clear();
- uint max = QMIN(Prefs.RecentDCount, Prefs.RecentDocs.count());
- for (uint m = 0; m < max; ++m)
- {
- QFileInfo fd(Prefs.RecentDocs[m]);
- if (fd.exists())
- {
- RecentDocs.append(Prefs.RecentDocs[m]);
- recentMenu->insertItem(Prefs.RecentDocs[m]);
- }
- }
- if (!Prefs.Werkv)
- toolMenu->changeItem(viewTools, tr("Show Tools"));
- if (Prefs.Mpalv)
- toolMenu->changeItem(viewMpal, tr("Hide Measurements"));
- if (Prefs.Tpalv)
- toolMenu->changeItem(viewTpal, tr("Hide Outline"));
- if (Prefs.SCpalv)
- toolMenu->changeItem(viewBpal, tr("Hide Scrapbook"));
- if (Prefs.Lpalv)
- toolMenu->changeItem(viewLpal, tr("Hide Layers"));
- if (Prefs.Sepalv)
- toolMenu->changeItem(viewSepal, tr("Hide Page Palette"));
- if (Prefs.Bopalv)
- toolMenu->changeItem(viewBopal, tr("Hide Bookmarks"));
- Mpal->move(Prefs.Mpalx, Prefs.Mpaly);
- Tpal->move(Prefs.Tpalx, Prefs.Tpaly);
- Lpal->move(Prefs.Lpalx, Prefs.Lpaly);
- Sepal->move(Prefs.Sepalx, Prefs.Sepaly);
- BookPal->move(Prefs.Bopalx, Prefs.Bopaly);
- ScBook->move(Prefs.SCpalx, Prefs.SCpaly);
- ScBook->resize(Prefs.SCpalw, Prefs.SCpalh);
- Npal->move(Prefs.Npalx, Prefs.Npaly);
- move(Prefs.MainX, Prefs.MainY);
- resize(Prefs.MainW, Prefs.MainH);
-}
-
-void ScribusApp::ShowSubs()
-{
- QString mess;
- if (HaveGS != 0)
- {
- mess = tr("The following Programs are missing:")+"\n\n";
- if (HaveGS != 0)
- {
- mess += tr("Ghostscript : You cannot use EPS-Images")+"\n\n";
- PDFavailable = false;
- }
- QMessageBox::warning(this, tr("Warning"), mess, 1, 0, 0);
- }
- if (!Prefs.Werkv)
- WerkTools->hide();
- if (Prefs.Mpalv)
- {
- Mpal->show();
- Mpal->TabStack->raiseWidget(2);
- qApp->processEvents();
- Mpal->TabStack->raiseWidget(0);
- }
- if (Prefs.Tpalv)
- Tpal->show();
- if (Prefs.SCpalv)
- ScBook->show();
- if (Prefs.Lpalv)
- Lpal->show();
- if (Prefs.Sepalv)
- Sepal->show();
- if (Prefs.Bopalv)
- BookPal->show();
- setActiveWindow();
- raise();
-}
-
-PSLib* ScribusApp::getPSDriver(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf)
-{
- char *error;
- typedef PSLib* (*sdem)(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf);
- sdem demo;
- QString pfad = PREL;
- pfad += "/lib/scribus/libs/libpostscript.so";
- PSDriver = dlopen(pfad, RTLD_LAZY);
- if (!PSDriver)
- {
- std::cout << "Can't find Plugin" << endl;
- return NULL;
- }
- dlerror();
- demo = (sdem)dlsym(PSDriver, "Run");
- if ((error = dlerror()) != NULL)
- {
- std::cout << "Can't find Symbol" << endl;
- dlclose(PSDriver);
- return NULL;
- }
- PSLib *dia = (*demo)(psart, AllFonts, DocFonts, DocColors, pdf);
- return dia;
-}
-
-void ScribusApp::closePSDriver()
-{
- dlclose(PSDriver);
-}
-
-PDFlib* ScribusApp::getPDFDriver()
-{
- char *error;
- typedef PDFlib* (*sdem)();
- sdem demo;
- QString pfad = PREL;
- pfad += "/lib/scribus/libs/libpdf.so";
- PDFDriver = dlopen(pfad, RTLD_LAZY);
- if (!PDFDriver)
- {
- std::cout << "Can't find Plugin" << endl;
- return NULL;
- }
- dlerror();
- demo = (sdem)dlsym(PDFDriver, "Run");
- if ((error = dlerror()) != NULL)
- {
- std::cout << "Can't find Symbol" << endl;
- dlclose(PDFDriver);
- return NULL;
- }
- PDFlib *dia = (*demo)();
- return dia;
-}
-
-void ScribusApp::closePDFDriver()
-{
- dlclose(PDFDriver);
-}
-
-bool ScribusApp::DoSaveAsEps(QString fn)
-{
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- PSLib *dd = getPSDriver(false, Prefs.AvailFonts, doc->UsedFonts, doc->PageColors, false);
- if (dd != NULL)
- {
- if (dd->PS_set_file(fn))
- view->CreatePS(dd, doc->ActPage->PageNr, doc->ActPage->PageNr+1, 1, false, tr("All"), true, false, false, false);
- else
- {
- delete dd;
- closePSDriver();
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- return false;
- }
- closePSDriver();
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- return true;
- }
- else
- return false;
-}
-
-void ScribusApp::SaveAsEps()
-{
- QString fna;
- if (!doc->DocName.startsWith("Document"))
- {
- QFileInfo fi(doc->DocName);
- fna = fi.dirPath()+"/"+fi.baseName()+".eps";
- }
- else
- {
- QDir di = QDir();
- fna = di.currentDirPath()+"/"+doc->DocName+".eps";
- }
- QString fn = CFileDialog(tr("Save as"), tr("EPS-Files (*.eps);; All Files (*)"), "", false, false);
- if (!fn.isEmpty())
- {
- if (!DoSaveAsEps(fn))
- QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
- }
-}
-
-void ScribusApp::SaveAsPDF()
-{
- QString fn;
- uint frPa, toPa;
- int Components;
- QString nam = "";
- QString pfad = PREL;
- pfad += "/lib/scribus/profiles/";
- if (BookPal->BView->childCount() == 0)
- doc->PDF_Optionen.Bookmarks = false;
- PDF_Opts *dia = new PDF_Opts(this, doc->DocName, doc->UsedFonts, view, &doc->PDF_Optionen, doc->PDF_Optionen.PresentVals, &PDFXProfiles, Prefs.AvailFonts);
- if (dia->exec())
- {
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- fn = dia->Datei->text();
- doc->PDF_Optionen.Datei = fn;
- doc->PDF_Optionen.Thumbnails = dia->CheckBox1->isChecked();
- doc->PDF_Optionen.Compress = dia->Compression->isChecked();
- doc->PDF_Optionen.Resolution = dia->Resolution->value();
- doc->PDF_Optionen.EmbedList = dia->FontsToEmbed;
- doc->PDF_Optionen.RecalcPic = dia->DSColor->isChecked();
- doc->PDF_Optionen.PicRes = dia->ValC->value();
- doc->PDF_Optionen.Bookmarks = dia->CheckBM->isChecked();
- doc->PDF_Optionen.Binding = dia->ComboBind->currentItem();
- doc->PDF_Optionen.PresentMode = dia->CheckBox10->isChecked();
- doc->PDF_Optionen.PresentVals = dia->EffVal;
- doc->PDF_Optionen.Articles = dia->Article->isChecked();
- doc->PDF_Optionen.Encrypt = dia->Encry->isChecked();
- if (dia->Encry->isChecked())
- {
- int Perm = -64;
- if (dia->ComboBox1->currentItem() == 1)
- Perm &= ~0x00240000;
- if (dia->PrintSec->isChecked())
- Perm += 4;
- if (dia->ModifySec->isChecked())
- Perm += 8;
- if (dia->CopySec->isChecked())
- Perm += 16;
- if (dia->AddSec->isChecked())
- Perm += 32;
- doc->PDF_Optionen.Permissions = Perm;
- doc->PDF_Optionen.PassOwner = dia->PassOwner->text();
- doc->PDF_Optionen.PassUser = dia->PassUser->text();
- }
- if (dia->ComboBox1->currentItem() == 0)
- doc->PDF_Optionen.Version = 13;
- if (dia->ComboBox1->currentItem() == 1)
- doc->PDF_Optionen.Version = 14;
- if (dia->ComboBox1->currentItem() == 2)
- doc->PDF_Optionen.Version = 12;
- if (dia->OutCombo->currentItem() == 0)
- {
- doc->PDF_Optionen.UseRGB = true;
- doc->PDF_Optionen.UseProfiles = false;
- doc->PDF_Optionen.UseProfiles2 = false;
- }
- else
- {
- doc->PDF_Optionen.UseRGB = false;
-#ifdef HAVE_CMS
- doc->PDF_Optionen.UseProfiles = dia->EmbedProfs->isChecked();
- doc->PDF_Optionen.UseProfiles2 = dia->EmbedProfs2->isChecked();
- doc->PDF_Optionen.Intent = dia->IntendS->currentItem();
- doc->PDF_Optionen.Intent2 = dia->IntendI->currentItem();
- doc->PDF_Optionen.EmbeddedI = dia->NoEmbedded->isChecked();
- doc->PDF_Optionen.SolidProf = dia->SolidPr->currentText();
- doc->PDF_Optionen.ImageProf = dia->ImageP->currentText();
- doc->PDF_Optionen.PrintProf = dia->PrintProfC->currentText();
- if (doc->PDF_Optionen.Version == 12)
- {
- const char *Descriptor;
- cmsHPROFILE hIn;
- hIn = cmsOpenProfileFromFile(pfad+PrinterProfiles[doc->PDF_Optionen.PrintProf], "r");
- Descriptor = cmsTakeProductDesc(hIn);
- nam = QString(Descriptor);
- if ((int) cmsGetColorSpace(hIn) == icSigRgbData)
- Components = 3;
- if ((int)cmsGetColorSpace(hIn) == icSigCmykData)
- Components = 4;
- if ((int)cmsGetColorSpace(hIn) == icSigCmyData)
- Components = 3;
- cmsCloseProfile(hIn);
- doc->PDF_Optionen.Info = dia->InfoString->text();
- doc->PDF_Optionen.BleedTop = float(dia->BleedTop->value())/UmReFaktor/100.0;
- doc->PDF_Optionen.BleedLeft = float(dia->BleedLeft->value())/UmReFaktor/100.0;
- doc->PDF_Optionen.BleedRight = float(dia->BleedRight->value())/UmReFaktor/100.0;
- doc->PDF_Optionen.BleedBottom = float(dia->BleedBottom->value())/UmReFaktor/100.0;
- doc->PDF_Optionen.Encrypt = false;
- doc->PDF_Optionen.PresentMode = false;
- doc->PDF_Optionen.Encrypt = false;
- }
-#else
- doc->PDF_Optionen.UseProfiles = false;
- doc->PDF_Optionen.UseProfiles2 = false;
-#endif
- }
- if (dia->AllPages->isChecked())
- {
- frPa = 0;
- toPa = view->Pages.count();
- }
- else
- {
- frPa = uint(dia->FirstPage->value()-1);
- toPa = uint(dia->LastPage->value());
- }
- QMap<int,QPixmap> thumbs;
- for (uint ap = frPa; ap < toPa; ++ap)
- {
- QPixmap pm(10,10);
- if (doc->PDF_Optionen.Thumbnails)
- pm = view->PageToPixmap(ap, 100);
- thumbs.insert(ap, pm);
- }
- PDFlib *pd = getPDFDriver();
- if (pd->PDF_Begin_Doc(fn, doc, view, &doc->PDF_Optionen, Prefs.AvailFonts, doc->UsedFonts, BookPal->BView))
- {
- for (uint ap = 0; ap < view->MasterPages.count(); ++ap)
- {
- if (view->MasterPages.at(ap)->Items.count() != 0)
- pd->PDF_TemplatePage(view->MasterPages.at(ap));
- }
- for (uint a = frPa; a < toPa; ++a)
- {
- pd->PDF_Begin_Page(view->Pages.at(a), thumbs[a]);
- pd->PDF_ProcessPage(view->Pages.at(a), a);
- pd->PDF_End_Page();
- }
- if (doc->PDF_Optionen.Version == 12)
- pd->PDF_End_Doc(pfad+PrinterProfiles[doc->PDF_Optionen.PrintProf], nam, Components);
- else
- pd->PDF_End_Doc();
- }
- else
- QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
- delete pd;
- closePDFDriver();
-// BuildFontMenu();
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- }
- delete dia;
-}
-
-void ScribusApp::AddBookMark(PageItem *ite)
-{
- BookPal->BView->AddPageItem(ite);
- StoreBookmarks();
-}
-
-void ScribusApp::DelBookMark(PageItem *ite)
-{
- BookPal->BView->DeleteItem(ite->BMnr);
- StoreBookmarks();
-}
-
-void ScribusApp::BookMarkTxT(PageItem *ite)
-{
- BookPal->BView->ChangeText(ite);
- StoreBookmarks();
-}
-
-void ScribusApp::ChBookmarks(int s, int e, int n)
-{
- view->Pages.at(s)->Items.at(e)->BMnr = n;
-}
-
-void ScribusApp::RestoreBookMarks()
-{
- BookMItem* ip;
- BookMItem* ip2;
- BookMItem* ip3;
- QValueList<ScribusDoc::BookMa>::Iterator it2;
- it2 = doc->BookMarks.begin();
- BookPal->BView->clear();
- if (doc->BookMarks.count() == 0)
- return;
- BookMItem *ite = new BookMItem(BookPal->BView, &(*it2));
- ++it2;
- for( ; it2 != doc->BookMarks.end(); ++it2 )
- {
- if ((*it2).Parent == 0)
- ite = new BookMItem(BookPal->BView, ite, &(*it2));
- else
- {
- QListViewItemIterator it3(BookPal->BView);
- for ( ; it3.current(); ++it3)
- {
- ip = (BookMItem*)it3.current();
- if ((*it2).Parent == ip->ItemNr)
- {
- ip2 = ip;
- break;
- }
- }
- if ((*it2).Prev == 0)
- (void) new BookMItem(ip2, &(*it2));
- else
- {
- QListViewItemIterator it4(BookPal->BView);
- for ( ; it4.current(); ++it4)
- {
- ip = (BookMItem*)it4.current();
- if ((*it2).Prev == ip->ItemNr)
- {
- ip3 = ip;
- break;
- }
- }
- (void) new BookMItem(ip2, ip3, &(*it2));
- }
- }
- }
-}
-
-void ScribusApp::StoreBookmarks()
-{
- doc->BookMarks.clear();
- BookMItem* ip;
- QListViewItemIterator it(BookPal->BView);
- struct ScribusDoc::BookMa Boma;
- for ( ; it.current(); ++it)
- {
- ip = (BookMItem*)it.current();
- Boma.Title = ip->Titel;
- Boma.Text = ip->text(0);
- Boma.Aktion = ip->Action;
- Boma.ItemNr = ip->ItemNr;
- Boma.Seite = ip->Seite;
- Boma.Element = ip->Element;
- Boma.Parent = ip->Pare;
- Boma.First = ip->First;
- Boma.Prev = ip->Prev;
- Boma.Next = ip->Next;
- Boma.Last = ip->Last;
- doc->BookMarks.append(Boma);
- }
- ActWin->NrItems = BookPal->BView->NrItems;
- ActWin->First = BookPal->BView->First;
- ActWin->Last = BookPal->BView->Last;
-}
-
-void ScribusApp::ModifyObject()
-{
- NoFrameEdit();
- PageItem* b = doc->ActPage->SelItem.at(0);
- ModObj *dia = new ModObj(this, b, doc->PageColors, doc, view, &InputProfiles);
- connect(dia, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
- dia->exec();
- delete dia;
- doc->UnDoValid = false;
- CanUndo();
- Mpal->setLvalue(b->LocalScX, b->LocalScY, b->LocalX, b->LocalY );
-}
-
-void ScribusApp::slotElemRead(QString Name, int x, int y, bool art, bool loca, ScribusDoc* docc)
-{
- NoFrameEdit();
- ScriXmlDoc *ss = new ScriXmlDoc();
- if(ss->ReadElem(Name, Prefs.AvailFonts, docc, x, y, art, loca, Prefs.GFontSub))
- {
- BuildFontMenu();
- Mpal->Spal->updateFList();
- docc->ActPage->update();
- slotDocCh();
- docc->UnDoValid = false;
- CanUndo();
- }
- delete ss;
-}
-
-void ScribusApp::slotChangeUnit(int art)
-{
- doc->Einheit = art;
- switch (art)
- {
- case 0:
- UmReFaktor = 1.0;
- view->UN->setText("pt");
- break;
- case 1:
- UmReFaktor = 0.3527777;
- view->UN->setText("mm");
- break;
- case 2:
- UmReFaktor = 1.0 / 72.0;
- view->UN->setText("in");
- break;
- case 3:
- UmReFaktor = 1.0 / 12.0;
- view->UN->setText("p");
- break;
- }
- Mpal->UnitChange();
- view->DrawNew();
-}
-
-void ScribusApp::ManageJava()
-{
- JavaDocs *dia = new JavaDocs(this, doc, view);
- dia->exec();
- delete dia;
-}
-
-void ScribusApp::ManageTemp(QString temp)
-{
- MusterSeiten *dia = new MusterSeiten(this, doc, view, temp);
- connect(dia, SIGNAL(CreateNew(int)), this, SLOT(slotNewPageT(int)));
- connect(dia, SIGNAL(Fertig()), this, SLOT(ManTempEnd()));
- menuBar()->setItemEnabled(pgmm, 0);
- editMenu->setItemEnabled(tman, 0);
- ActWin->MenuStat[0] = DatSav->isEnabled();
- ActWin->MenuStat[1] = fileMenu->isItemEnabled(fid1);
- ActWin->MenuStat[2] = fileMenu->isItemEnabled(fid4);
- ActWin->MenuStat[3] = fileMenu->isItemEnabled(fid5);
- DatNeu->setEnabled(false);
- DatSav->setEnabled(false);
- DatOpe->setEnabled(false);
- DatClo->setEnabled(false);
-/* fileMenu->setItemEnabled(fid1, 0);
- fileMenu->setItemEnabled(fid4, 0);
- fileMenu->setItemEnabled(fid5, 0);
- fileMenu->setItemEnabled(fid51, 0);
- fileMenu->setItemEnabled(fid12, 0);
- fileMenu->setItemEnabled(fid13, 0);
- fileMenu->setItemEnabled(fid14, 0); */
- fileMenu->setEnabled(false);
- doc->TemplateMode = true;
- Sepal->DisablePal();
- doc->UnDoValid = false;
- CanUndo();
- dia->show();
- ActWin->muster = dia;
-}
-
-void ScribusApp::ManTempEnd()
-{
- view->HideTemplate();
- doc->TemplateMode = false;
- menuBar()->setItemEnabled(pgmm, 1);
- editMenu->setItemEnabled(tman, 1);
- DatNeu->setEnabled(true);
- DatSav->setEnabled(ActWin->MenuStat[0]);
- DatOpe->setEnabled(true);
- DatClo->setEnabled(true);
-/* fileMenu->setItemEnabled(fid1, ActWin->MenuStat[1]);
- fileMenu->setItemEnabled(fid4, ActWin->MenuStat[2]);
- fileMenu->setItemEnabled(fid5, ActWin->MenuStat[3]);
- fileMenu->setItemEnabled(fid12, 1);
- fileMenu->setItemEnabled(fid13, 1);
- fileMenu->setItemEnabled(fid14, 1); */
- fileMenu->setEnabled(true);
- if (view->Pages.count() > 1)
- {
- pageMenu->setItemEnabled(pgmd, 1);
- pageMenu->setItemEnabled(pgmv, 1);
- }
- else
- {
- pageMenu->setItemEnabled(pgmd, 0);
- pageMenu->setItemEnabled(pgmv, 0);
- }
- if (doc->isModified())
- slotDocCh();
- Sepal->EnablePal();
- Sepal->RebuildTemp();
- ActWin->muster = NULL;
-}
-
-void ScribusApp::ApplyTemp()
-{
- QString mna;
- ApplyT *dia = new ApplyT(this, view);
- if (dia->exec())
- {
- mna = dia->Templ->currentText();
- Apply_Temp(mna, doc->ActPage->PageNr);
- }
- delete dia;
-}
-
-void ScribusApp::Apply_Temp(QString in, int Snr)
-{
- QString mna = in;
- if (mna == tr("Normal"))
- mna = "Normal";
- view->Pages.at(Snr)->MPageNam = mna;
- Page* Mp = view->MasterPages.at(view->MasterNames[mna]);
- if (Mp->YGuides.count() != 0)
- {
- for (uint y = 0; y < Mp->YGuides.count(); ++y)
- {
- if (view->Pages.at(Snr)->YGuides.contains(Mp->YGuides[y]) == 0)
- view->Pages.at(Snr)->YGuides.append(Mp->YGuides[y]);
- }
- qHeapSort(view->Pages.at(Snr)->YGuides);
- }
- if (Mp->XGuides.count() != 0)
- {
- for (uint x = 0; x < Mp->XGuides.count(); ++x)
- {
- if (view->Pages.at(Snr)->XGuides.contains(Mp->XGuides[x]) == 0)
- view->Pages.at(Snr)->XGuides.append(Mp->XGuides[x]);
- }
- qHeapSort(view->Pages.at(Snr)->XGuides);
- }
- view->DrawNew();
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
- Sepal->Rebuild();
-}
-
-void ScribusApp::GroupObj()
-{
- PageItem* b;
- float x, y, w, h;
- for (uint a=0; a<doc->ActPage->SelItem.count(); ++a)
- {
- b = doc->ActPage->SelItem.at(a);
- b->Groups.push(doc->GroupCounter);
- }
- doc->GroupCounter++;
- doc->ActPage->getGroupRect(&x, &y, &w, &h);
- doc->ActPage->repaint(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::UnGroupObj()
-{
- PageItem* b;
- for (uint a=0; a<doc->ActPage->SelItem.count(); ++a)
- {
- b = doc->ActPage->SelItem.at(a);
- b->Groups.pop();
- }
- doc->ActPage->Deselect(true);
- slotDocCh();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::StatusPic()
-{
- if (HaveDoc)
- {
- PicStatus *dia = new PicStatus(this, doc, view);
- connect(dia, SIGNAL(GotoSeite(int)), this, SLOT(SelectFromOutlS(int)));
- dia->exec();
- delete dia;
- }
-}
-
-QString ScribusApp::CFileDialog(QString caption, QString filter, QString defNa, bool Pre, bool mod, bool comp)
-{
- CustomFDialog dia(this, caption, filter, Pre, mod, comp);
- if (defNa != "")
- dia.setSelection(defNa);
- if (dia.exec() == QDialog::Accepted)
- return dia.selectedFile();
- else
- return "";
-}
-
-void ScribusApp::RunPlug(int id)
-{
- int a = extraMenu->indexOf(id);
- if (a > 2)
- CallDLL(extraMenu->text(id));
-}
-
-void ScribusApp::RunImportPlug(int id)
-{
- int a = importMenu->indexOf(id);
- if (a > 1)
- CallDLL(importMenu->text(id));
-}
-
-void ScribusApp::RunExportPlug(int id)
-{
- int a = exportMenu->indexOf(id);
- if (a > 2)
- CallDLL(exportMenu->text(id));
-}
-
-void ScribusApp::RunHelpPlug(int id)
-{
- int a = helpMenu->indexOf(id);
- if (a > 4)
-// if (a > 5)
- CallDLL(helpMenu->text(id));
-}
-
-void ScribusApp::FinalizePlugs()
-{
- char *error;
- QMap<QString, PlugData>::Iterator it;
- struct PlugData pda;
- typedef void (*sdem2)();
- sdem2 demo2;
- for (it = PluginMap.begin(); it != PluginMap.end(); ++it)
- {
- if (it.data().Typ == 4)
- {
- dlerror();
- demo2 = (sdem2)dlsym(it.data().Zeiger, "CleanUpPlug");
- if ((error = dlerror()) != NULL)
- {
- dlclose(it.data().Zeiger);
- continue;
- }
- else
- {
- (*demo2)();
- }
- }
- }
-}
-
-void ScribusApp::InitPlugs()
-{
- QString pfad = PREL;
- QString nam = "";
- int ty = 0;
- struct PlugData pda;
- pfad += "/lib/scribus/plugins/";
- QDir d(pfad, "*.so*", QDir::Name, QDir::Files | QDir::Executable | QDir::NoSymLinks);
- if ((d.exists()) && (d.count() != 0))
- {
- extraMenu->insertSeparator();
- for (uint dc = 0; dc < d.count(); ++dc)
- {
- pda.Zeiger = 0;
- pda.Datei = "";
- pda.Typ = 0;
- if (DLLName(d[dc], &nam, &ty, &pda.Zeiger))
- {
- if (ty == 1)
- extraMenu->insertItem(tr(nam));
- if (ty == 2)
- importMenu->insertItem(tr(nam));
- if (ty == 3)
- exportMenu->insertItem(tr(nam));
- if (ty == 4)
- helpMenu->insertItem(tr(nam));
- pda.Datei = d[dc];
- pda.Typ = ty;
- PluginMap.insert(tr(nam), pda);
- }
- }
- connect(extraMenu, SIGNAL(activated(int)), this, SLOT(RunPlug(int)));
- connect(importMenu, SIGNAL(activated(int)), this, SLOT(RunImportPlug(int)));
- connect(exportMenu, SIGNAL(activated(int)), this, SLOT(RunExportPlug(int)));
- connect(helpMenu, SIGNAL(activated(int)), this, SLOT(RunHelpPlug(int)));
- }
-}
-
-void ScribusApp::CallDLL(QString name)
-{
- void *mo;
- char *error;
- struct PlugData pda;
- pda = PluginMap[name];
- typedef void (*sdem)(QWidget *d, ScribusApp *plug);
- sdem demo;
- QString pfad = PREL;
- if (pda.Typ != 4)
- {
- pfad += "/lib/scribus/plugins/" + pda.Datei;
- mo = dlopen(pfad, RTLD_LAZY | RTLD_GLOBAL);
- if (!mo)
- {
- std::cout << "Can't find Plugin" << endl;
- return;
- }
- }
- else
- mo = pda.Zeiger;
- dlerror();
- demo = (sdem)dlsym(mo, "Run");
- if ((error = dlerror()) != NULL)
- {
- std::cout << "Can't find Symbol" << endl;
- dlclose(mo);
- return;
- }
- (*demo)(this, this);
- if (pda.Typ != 4)
- dlclose(mo);
-}
-
-bool ScribusApp::DLLName(QString name, QString *PName, int *typ, void **Zeig)
-{
- void *mo;
- char *error;
- typedef QString (*sdem0)();
- typedef int (*sdem1)();
- typedef void (*sdem2)(QWidget *d, ScribusApp *plug);
- sdem0 demo;
- sdem1 demo1;
- sdem2 demo2;
- QString pfad = PREL;
- pfad += "/lib/scribus/plugins/" + name;
- mo = dlopen(pfad, RTLD_LAZY | RTLD_GLOBAL);
- if (!mo)
- return false;
- dlerror();
- demo = (sdem0)dlsym(mo, "Name");
- if ((error = dlerror()) != NULL)
- {
- dlclose(mo);
- return false;
- }
- *PName = (*demo)();
- dlerror();
- demo1 = (sdem1)dlsym(mo, "Type");
- if ((error = dlerror()) != NULL)
- {
- dlclose(mo);
- return false;
- }
- *typ = (*demo1)();
- *Zeig = mo;
- if (*typ != 4)
- dlclose(mo);
- else
- {
- dlerror();
- demo2 = (sdem2)dlsym(mo, "InitPlug");
- if ((error = dlerror()) != NULL)
- {
- dlclose(mo);
- return false;
- }
- (*demo2)(this, this);
- }
- return true;
-}
-
-void ScribusApp::GetCMSProfiles()
-{
- MonitorProfiles.clear();
- PrinterProfiles.clear();
- InputProfiles.clear();
-#ifdef HAVE_CMS
- QString pfad = PREL;
- QString nam = "";
- const char *Descriptor;
- cmsHPROFILE hIn;
- pfad += "/lib/scribus/profiles/";
- QDir d(pfad, "*.*", QDir::Name, QDir::Files | QDir::NoSymLinks);
- if ((d.exists()) && (d.count() != 0))
- {
- for (uint dc = 0; dc < d.count(); ++dc)
- {
- QFileInfo fi(pfad + d[dc]);
- QString ext = fi.extension(false).lower();
- if ((ext == "icm") || (ext == "icc"))
- {
- hIn = cmsOpenProfileFromFile(pfad + d[dc], "r");
- Descriptor = cmsTakeProductDesc(hIn);
- nam = QString(Descriptor);
- switch ((int) cmsGetDeviceClass(hIn))
- {
- case icSigInputClass:
- if ((int) cmsGetColorSpace(hIn) == icSigRgbData)
- InputProfiles[nam] = pfad + d[dc];
- break;
- case icSigColorSpaceClass:
- if ((int) cmsGetColorSpace(hIn) == icSigRgbData)
- InputProfiles[nam] = pfad + d[dc];
- break;
- case icSigDisplayClass:
- MonitorProfiles[nam] = d[dc];
- InputProfiles[nam] = pfad + d[dc];
- break;
- case icSigOutputClass:
- PrinterProfiles[nam] = d[dc];
- if ((int) cmsGetColorSpace(hIn) == icSigCmykData)
- PDFXProfiles[nam] = d[dc];
- break;
- }
- cmsCloseProfile(hIn);
- }
- }
- if ((!PrinterProfiles.isEmpty()) && (!InputProfiles.isEmpty()) && (!MonitorProfiles.isEmpty()))
- CMSavail = true;
- }
- else
- CMSavail = false;
-#else
- CMSavail = false;
-#endif
-}
-
-void ScribusApp::SetCMSPrefs()
-{
- struct CMSset *CM;
- if (CMSavail)
- {
- if (HaveDoc)
- CM = &doc->CMSSettings;
- else
- CM = &Prefs.DCMSset;
- CMSPrefs *dia = new CMSPrefs(this, CM, &InputProfiles, &PrinterProfiles, &MonitorProfiles);
- if(dia->exec())
- {
- int cc = Prefs.DColors.count();
- FMess->setText(tr("Adjusting Colors"));
- FProg->reset();
- if (HaveDoc)
- {
- if (dia->Changed)
- {
- cc = doc->PageColors.count() + view->CountElements();
- FProg->setTotalSteps(cc);
- slotDocCh();
-#ifdef HAVE_CMS
- doc->HasCMS = doc->CMSSettings.CMSinUse;
- ActWin->SoftProofing = doc->CMSSettings.SoftProofOn;
- ActWin->Gamut = doc->CMSSettings.GamutCheck;
- CMSuse = doc->CMSSettings.CMSinUse;
- ActWin->IntentPrinter = doc->CMSSettings.DefaultIntentPrinter;
- ActWin->IntentMonitor = doc->CMSSettings.DefaultIntentMonitor;
- SoftProofing = doc->CMSSettings.SoftProofOn;
- Gamut = doc->CMSSettings.GamutCheck;
- IntentPrinter = doc->CMSSettings.DefaultIntentPrinter;
- IntentMonitor = doc->CMSSettings.DefaultIntentMonitor;
- qApp->setOverrideCursor(QCursor(waitCursor), true);
- ActWin->CloseCMSProfiles();
- ActWin->OpenCMSProfiles(InputProfiles, MonitorProfiles, PrinterProfiles);
- stdProof = ActWin->stdProof;
- stdTrans = ActWin->stdTrans;
- stdProofImg = ActWin->stdProofImg;
- stdTransImg = ActWin->stdTransImg;
- CMSoutputProf = doc->DocOutputProf;
- CMSprinterProf = doc->DocPrinterProf;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsInput2 = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocInputProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsInput2 = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigRgbData)
- doc->CMSSettings.ComponentsPrinter = 3;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmykData)
- doc->CMSSettings.ComponentsPrinter = 4;
- if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmyData)
- doc->CMSSettings.ComponentsPrinter = 3;
- doc->PDF_Optionen.SComp = doc->CMSSettings.ComponentsInput2;
- doc->PDF_Optionen.SolidProf = doc->CMSSettings.DefaultInputProfile2;
- doc->PDF_Optionen.ImageProf = doc->CMSSettings.DefaultInputProfile;
- doc->PDF_Optionen.PrintProf = doc->CMSSettings.DefaultPrinterProfile;
- doc->PDF_Optionen.Intent = doc->CMSSettings.DefaultIntentMonitor;
- RecalcColors(FProg);
- view->RecalcPictures(&InputProfiles, FProg);
-#endif
- view->DrawNew();
- FProg->setProgress(cc);
- qApp->setOverrideCursor(QCursor(arrowCursor), true);
- }
- }
- FMess->setText("");
- FProg->reset();
- }
- delete dia;
- }
-}
-
-void ScribusApp::RecalcColors(QProgressBar *dia)
-{
- CListe::Iterator it;
- if (HaveDoc)
- {
- ColorMenu->clear();
- QPixmap pm = QPixmap(15, 15);
- int a = 0;
- ColorMenu->insertItem(tr("None"));
- CMYKColor tmp;
- tmp.fromQColor(doc->papColor);
- tmp.RecalcRGB();
- doc->papColor = tmp.getRGBColor();
- for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
- {
- doc->PageColors[it.key()].RecalcRGB();
- pm.fill(doc->PageColors[it.key()].getRGBColor());
- ColorMenu->insertItem(QIconSet(pm), it.key());
- if (it.key() == doc->Dbrush)
- {
- ColorMenu->setItemChecked(ColorMenu->idAt(a), true);
- }
- a++;
- if (dia != NULL)
- dia->setProgress(a);
- }
- Mpal->Cpal->SetColors(doc->PageColors);
- }
-}
-
-void ScribusApp::ModifyAnnot()
-{
- PageItem *b;
- if (doc->ActPage->SelItem.count() != 0)
- {
- b = doc->ActPage->SelItem.at(0);
- if ((b->AnType == 0) || (b->AnType == 1) || (b->AnType > 9))
- {
- Annota *dia = new Annota(this, b, doc->PageC, static_cast<int>(doc->PageB), static_cast<int>(doc->PageH), doc->PageColors, view);
- if (dia->exec())
- slotDocCh();
- delete dia;
- }
- else
- {
- Annot *dia = new Annot(this, b, doc->PageC, static_cast<int>(doc->PageB), static_cast<int>(doc->PageH), doc->PageColors, view);
- if (dia->exec())
- slotDocCh();
- delete dia;
- }
- }
-}
-
-void ScribusApp::SetShortCut()
-{
- uint a;
- for (a = 0; a < 9; ++a)
- {
- fileMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- for (a = 9; a < 19; ++a)
- {
- editMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- for (a = 19; a < 30; ++a)
- {
- ObjMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- for (a = 30; a < 34; ++a)
- {
- pageMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- pageMenu->setAccel(Prefs.KeyActions[61].KeyID, Prefs.KeyActions[61].MenuID);
- for (a = 34; a < 45; ++a)
- {
- viewMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- for (a = 45; a < 49; ++a)
- {
- toolMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- pageMenu->setAccel(Prefs.KeyActions[49].KeyID, Prefs.KeyActions[49].MenuID);
- extraMenu->setAccel(Prefs.KeyActions[50].KeyID, Prefs.KeyActions[50].MenuID);
- extraMenu->setAccel(Prefs.KeyActions[51].KeyID, Prefs.KeyActions[51].MenuID);
- for (a = 52; a < 56; ++a)
- {
- helpMenu->setAccel(Prefs.KeyActions[a].KeyID, Prefs.KeyActions[a].MenuID);
- }
- ObjMenu->setAccel(Prefs.KeyActions[61].KeyID, Prefs.KeyActions[61].MenuID);
- toolMenu->setAccel(Prefs.KeyActions[62].KeyID, Prefs.KeyActions[62].MenuID);
- editMenu->setAccel(Prefs.KeyActions[63].KeyID, Prefs.KeyActions[63].MenuID);
- editMenu->setAccel(Prefs.KeyActions[64].KeyID, Prefs.KeyActions[64].MenuID);
- toolMenu->setAccel(Prefs.KeyActions[65].KeyID, Prefs.KeyActions[65].MenuID);
- ObjMenu->setAccel(Prefs.KeyActions[66].KeyID, Prefs.KeyActions[66].MenuID);
-}
-
-void ScribusApp::PutScrap(QString t)
-{
- ScBook->ObjFromMenu(t);
-}
-
-void ScribusApp::UniteOb()
-{
- doc->ActPage->UniteObj();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::SplitUniteOb()
-{
- doc->ActPage->SplitObj();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::TraceText()
-{
-#ifdef HAVE_FREETYPE
- NoFrameEdit();
- doc->ActPage->TextToPath();
- doc->UnDoValid = false;
- CanUndo();
-#endif
-}
-
-void ScribusApp::Pfadtext()
-{
- doc->ActPage->ToPathText();
- doc->UnDoValid = false;
- CanUndo();
-}
-
-void ScribusApp::changeLayer(int l)
-{
- doc->ActPage->Deselect(true);
- view->setLayMenTxt(l);
- view->LaMenu();
- view->DrawNew();
-}
-
-void ScribusApp::showLayer()
-{
- view->DrawNew();
-}
-
-void ScribusApp::LayerRemove(int l)
-{
- for (uint a = 0; a < view->Pages.count(); ++a)
- {
- for (uint b = 0; b < view->Pages.at(a)->Items.count(); ++b)
- {
- if (view->Pages.at(a)->Items.at(b)->LayerNr == l)
- view->Pages.at(a)->Items.at(b)->LayerNr = 0;
- }
- }
- for (uint a = 0; a < view->MasterPages.count(); ++a)
- {
- for (uint b = 0; b < view->MasterPages.at(a)->Items.count(); ++b)
- {
- if (view->MasterPages.at(a)->Items.at(b)->LayerNr == l)
- view->MasterPages.at(a)->Items.at(b)->LayerNr = 0;
- }
- }
- for (uint a = 0; a < view->DocPages.count(); ++a)
- {
- for (uint b = 0; b < view->DocPages.at(a)->Items.count(); ++b)
- {
- if (view->DocPages.at(a)->Items.at(b)->LayerNr == l)
- view->DocPages.at(a)->Items.at(b)->LayerNr = 0;
- }
- }
- view->LaMenu();
-}
-
-void ScribusApp::UnDoAction()
-{
- PageItem* b;
- uint a;
- bool mp = false;
- if (doc->UnDoValid)
- {
- doc->ActPage->Deselect(true);
- b = doc->UnData.Item;
- b->Select = false;
-// view->Pages.at(doc->UnData.PageNr)->SelItem.clear();
- view->Pages.at(doc->UnData.PageNr)->Deselect(true);
- switch (doc->UnData.UnCode)
- {
- case 0:
- view->Pages.at(doc->UnData.PageNr)->Items.insert(b->ItemNr, b);
- for (a = 0; a < view->Pages.at(doc->UnData.PageNr)->Items.count(); ++a)
- {
- view->Pages.at(doc->UnData.PageNr)->Items.at(a)->ItemNr = a;
- }
- break;
- case 1:
- b->Xpos = doc->UnData.Xpos;
- b->Ypos = doc->UnData.Ypos;
- break;
- case 2:
- b->Xpos = doc->UnData.Xpos;
- b->Ypos = doc->UnData.Ypos;
- b->Rot = doc->UnData.Rot;
- if (b->PType == 5)
- mp = true;
- view->Pages.at(doc->UnData.PageNr)->SizeItem(doc->UnData.Width, doc->UnData.Height, b->ItemNr, mp);
- break;
- case 3:
- b->Rot = doc->UnData.Rot;
- break;
- case 4:
- view->Pages.at(doc->UnData.PageNr)->Items.take(b->ItemNr);
- view->Pages.at(doc->UnData.PageNr)->Items.insert(doc->UnData.ItemNr, b);
- for (a = 0; a < view->Pages.at(doc->UnData.PageNr)->Items.count(); ++a)
- {
- view->Pages.at(doc->UnData.PageNr)->Items.at(a)->ItemNr = a;
- }
- break;
- }
- view->DrawNew();
- doc->UnDoValid = false;
- editMenu->setItemEnabled(edUndo, 0);
- slotDocCh();
- }
-}
-
-void ScribusApp::CanUndo()
-{
- switch (doc->UnData.UnCode)
- {
- case 0:
- editMenu->changeItem(edUndo, tr("Undo Delete Object"));
- break;
- case 1:
- case 4:
- editMenu->changeItem(edUndo, tr("Undo Object Move"));
- break;
- case 2:
- case 3:
- editMenu->changeItem(edUndo, tr("Undo Object Change"));
- break;
- }
- if (doc->UnDoValid)
- editMenu->setItemEnabled(edUndo, 1);
- else
- editMenu->setItemEnabled(edUndo, 0);
-}
-
-void ScribusApp::InitHyphenator()
-{
- QString datein = "";
- QString lang = QString(QTextCodec::locale()).left(2);
- QString pfad = PREL;
- pfad += "/lib/scribus/dicts/";
- QDir d(pfad, "*.dic", QDir::Name, QDir::Files | QDir::NoSymLinks);
- if ((d.exists()) && (d.count() != 0))
- {
- for (uint dc = 0; dc < d.count(); ++dc)
- {
- if (d[dc] == "hyph_en.dic")
- datein = tr("English");
- if (d[dc] == "hyph_de.dic")
- datein = tr("German");
- if (d[dc] == "hyph_es.dic")
- datein = tr("Spanish");
- if (d[dc] == "hyph_it.dic")
- datein = tr("Italian");
- if (d[dc] == "hyph_fr.dic")
- datein = tr("French");
- if (d[dc] == "hyph_ru.dic")
- datein = tr("Russian");
- if (d[dc] == "hyph_da.dic")
- datein = tr("Danish");
- if (d[dc] == "hyph_sk.dic")
- datein = tr("Slovak");
- if (d[dc] == "hyph_hu.dic")
- datein = tr("Hungarian");
- Sprachen.insert(datein, d[dc]);
- if (d[dc] == "hyph_"+lang+".dic")
- Prefs.Language = datein;
- }
- if (datein == "")
- Prefs.Language = tr("English");
- }
-}
-
-void ScribusApp::configHyphenator()
-{
- HySettings *dia = new HySettings(this, &Sprachen);
- if (HaveDoc)
- {
- dia->Verbose->setChecked(doc->Trenner->Automatic);
- dia->Input->setChecked(doc->Trenner->AutoCheck);
- dia->Language->setCurrentText(doc->Trenner->Language);
- dia->WordLen->setValue(doc->Trenner->MinWordLen);
- }
- else
- {
- dia->Verbose->setChecked(Prefs.Automatic);
- dia->Input->setChecked(Prefs.AutoCheck);
- dia->Language->setCurrentText(Prefs.Language);
- dia->WordLen->setValue(Prefs.MinWordLen);
- }
- if (dia->exec())
- {
- if (HaveDoc)
- {
- doc->Trenner->slotNewDict(dia->Language->currentText());
- doc->Trenner->slotNewSettings(dia->WordLen->value(), dia->Verbose->isChecked(), dia->Input->isChecked());
- }
- else
- {
- Prefs.MinWordLen = dia->WordLen->value();
- Prefs.Language = dia->Language->currentText();
- Prefs.Automatic = dia->Verbose->isChecked();
- Prefs.AutoCheck = dia->Input->isChecked();
- }
- }
- delete dia;
-}
-
-void ScribusApp::doHyphenate()
-{
- PageItem *b;
- if (HaveDoc)
- {
- if (doc->ActPage->SelItem.count() != 0)
- {
- b = doc->ActPage->SelItem.at(0);
- doc->Trenner->slotHyphenate(b);
- }
- }
-}
-
-void ScribusApp::ToggleObjLock()
-{
- PageItem *b;
- if (HaveDoc)
- {
- if (doc->ActPage->SelItem.count() != 0)
- {
- b = doc->ActPage->SelItem.at(0);
- doc->ActPage->ToggleLock();
- HaveNewSel(b->PType);
- }
- }
-}
-
-void ScribusApp::ManageGuides()
-{
- if (HaveDoc)
- {
- GuideManager *dia = new GuideManager(this, doc->ActPage, doc->Einheit);
- dia->exec();
- delete dia;
- }
-}
-
-void ScribusApp::SetTranspar(float t)
-{
- PageItem *b;
- if (HaveDoc)
- {
- if (doc->ActPage->SelItem.count() != 0)
- {
- b = doc->ActPage->SelItem.at(0);
- b->Transparency = t;
- view->DrawNew();
- slotDocCh();
- }
- }
-}
-
-void ScribusApp::Collect()
-{
- QString s = QFileDialog::getExistingDirectory(QDir::currentDirPath(), this, "d", tr("Choose a Directory"), true);
- if (s != "")
- {
- if(s.right(1) != "/")
- s += "/";
- QFileInfo fi = QFileInfo(s);
- if (fi.exists())
- {
- if (fi.isDir() && fi.isWritable())
- {
- for (uint a = 0; a < view->MasterPages.count(); ++a)
- {
- for (uint b = 0; b < view->MasterPages.at(a)->Items.count(); ++b)
- {
- PageItem* ite = view->MasterPages.at(a)->Items.at(b);
- if (ite->PType == 2)
- {
- QFileInfo itf = QFileInfo(ite->Pfile);
- if (itf.exists())
- {
- QString cmd = "cp " + ite->Pfile + " " + s + itf.fileName();
- system(cmd);
- ite->Pfile = s + itf.fileName();
- }
- }
- }
- }
- for (uint a = 0; a < view->DocPages.count(); ++a)
- {
- for (uint b = 0; b < view->DocPages.at(a)->Items.count(); ++b)
- {
- PageItem* ite = view->DocPages.at(a)->Items.at(b);
- if (ite->PType == 2)
- {
- QFileInfo itf = QFileInfo(ite->Pfile);
- if (itf.exists())
- {
- QString cmd = "cp " + ite->Pfile + " " + s + itf.fileName();
- system(cmd);
- ite->Pfile = s + itf.fileName();
- }
- }
- }
- }
- QString fn;
- if (doc->hasName)
- {
- QFileInfo fis(doc->DocName);
- fn = s + fis.fileName();
- }
- else
- fn = s + doc->DocName+".scd";
- if (!DoFileSave(fn))
- QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
- }
- }
- }
-}
-
-void ScribusApp::slotTest()
-{
-}
-
-void ScribusApp::slotTest2()
-{
-}
/Scribus/Scribus/scribus/scribus.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/polyprops.h
===================================================================
--- Scribus/Scribus/scribus/polyprops.h (revision 6)
+++ Scribus/Scribus/scribus/polyprops.h (nonexistent)
@@ -1,67 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'polygonprops.ui'
-**
-** Created: Fre Mai 10 14:30:06 2002
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef POLYGONPROPS_H
-#define POLYGONPROPS_H
-
-#include <qdialog.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qpixmap.h>
-
-class PolygonProps : public QDialog
-{
- Q_OBJECT
-
-public:
- PolygonProps(QWidget* parent = 0);
- ~PolygonProps() {};
- float GetZeroFaktor();
- float GetMaxFaktor();
-
- QLabel* Text1;
- QSpinBox* Ecken;
- QCheckBox* Konvex;
- QLabel* Text2;
- QSpinBox* Faktor;
- QSlider* Slider1;
- QLabel* Preview;
- QLabel* Text2_2;
- QSpinBox* Faktor2;
- QSlider* Slider2;
- QPushButton* PushButton1;
- QPushButton* PushButton2;
- QPixmap* Pre;
- float PFactor;
-
-public slots:
- void UpdatePreView();
- float GetFaktor();
- void ValFromSpin(int a);
- void ValFromSpin2(int a);
-
-protected:
- QVBoxLayout* PolygonPropsLayout;
- QHBoxLayout* Layout11;
- QVBoxLayout* Layout10;
- QHBoxLayout* Layout2;
- QHBoxLayout* Layout9;
- QVBoxLayout* Layout8;
- QHBoxLayout* Layout7;
- QHBoxLayout* Layout1_2;
- QHBoxLayout* Layout9_2;
- QVBoxLayout* Layout8_2;
- QHBoxLayout* Layout7_2;
-};
-
-#endif // POLYGONPROPS_H
/Scribus/Scribus/scribus/polyprops.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/ISOenc.txt
===================================================================
--- Scribus/Scribus/scribus/ISOenc.txt (revision 6)
+++ Scribus/Scribus/scribus/ISOenc.txt (nonexistent)
@@ -1,200 +0,0 @@
-A 0101
-AE 0306
-Aacute 0301
-Acircumflex 0302
-Adieresis 0304
-Agrave 0300
-Aring 0305
-Atilde 0303
-B 0102
-C 0103
-Ccedilla 0307
-D 0104
-E 0105
-Eacute 0311
-Ecircumflex 0312
-Edieresis 0313
-Egrave 0310
-Eth 0320
-F 0106
-G 0107
-H 0110
-I 0111
-Iacute 0315
-Icircumflex 0316
-Idieresis 0317
-Igrave 0314
-J 0112
-K 0113
-L 0114
-M 0115
-N 0116
-Ntilde 0321
-O 0117
-Oacute 0323
-Ocircumflex 0324
-Odieresis 0326
-Ograve 0322
-Oslash 0330
-Otilde 0325
-P 0120
-Q 0121
-R 0122
-S 0123
-T 0124
-Thorn 0336
-U 0125
-Uacute 0332
-Ucircumflex 0333
-Udieresis 0334
-Ugrave 0331
-V 0126
-W 0127
-X 0130
-Y 0131
-Yacute 0335
-Z 0132
-a 0141
-aacute 0341
-acircumflex 0342
-acute 0264
-adieresis 0344
-ae 0346
-agrave 0340
-ampersand 046
-aring 0345
-asciicircum 0136
-asciitilde 0176
-asterisk 052
-at 0100
-atilde 0343
-b 0142
-backslash 0134
-bar 0174
-braceleft 0173
-braceright 0175
-bracketleft 0133
-bracketright 0135
-breve 0226
-brokenbar 0246
-c 0143
-caron 0237
-ccedilla 0347
-cedilla 0270
-cent 0242
-circumflex 0223
-colon 072
-comma 054
-copyright 0251
-currency 0244
-d 0144
-degree 0260
-dieresis 0250
-divide 0367
-dollar 044
-dotaccent 0227
-dotlessi 0220
-e 0145
-eacute 0351
-ecircumflex 0352
-edieresis 0353
-egrave 0350
-eight 070
-equal 075
-eth 0360
-exclam 041
-exclamdown 0241
-f 0146
-five 065
-four 064
-g 0147
-germandbls 0337
-grave 0221
-greater 076
-guillemotleft 0253
-guillemotright 0273
-h 0150
-hungarumlaut 0235
-hyphen 0255
-hyphen 055
-i 0151
-iacute 0355
-icircumflex 0356
-idieresis 0357
-igrave 0354
-j 0152
-k 0153
-l 0154
-less 074
-logicalnot 0254
-m 0155
-macron 0257
-mu 0265
-multiply 0327
-n 0156
-nine 071
-ntilde 0361
-numbersign 043
-o 0157
-oacute 0363
-ocircumflex 0364
-odieresis 0366
-ogonek 0236
-ograve 0362
-one 061
-onehalf 0275
-onequarter 0274
-onesuperior 0271
-ordfeminine 0252
-ordmasculine 0272
-oslash 0370
-otilde 0365
-p 0160
-paragraph 0266
-parenleft 050
-parenright 051
-percent 045
-period 056
-periodcentered 0267
-plus 053
-plusminus 0261
-q 0161
-question 077
-questiondown 0277
-quotedbl 042
-quoteleft 0140
-quoteright 047
-r 0162
-registered 0256
-ring 0232
-s 0163
-section 0247
-semicolon 073
-seven 067
-six 066
-slash 057
-space 040
-sterling 0243
-t 0164
-thorn 0376
-three 063
-threequarters 0276
-threesuperior 0263
-tilde 0224
-two 062
-twosuperior 0262
-u 0165
-uacute 0372
-ucircumflex 0373
-udieresis 0374
-ugrave 0371
-underscore 0137
-v 0166
-w 0167
-x 0170
-y 0171
-yacute 0375
-ydieresis 0377
-yen 0245
-z 0172
-zero 060
/Scribus/Scribus/scribus/ISOenc.txt
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/druck.h
===================================================================
--- Scribus/Scribus/scribus/druck.h (revision 6)
+++ Scribus/Scribus/scribus/druck.h (nonexistent)
@@ -1,132 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'Druck.ui'
-**
-** Created: Mon Sep 17 21:42:05 2001
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef DRUCK_H
-#define DRUCK_H
-
-#include <qdialog.h>
-#include <qbuttongroup.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qspinbox.h>
-#include <qtoolbutton.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qcheckbox.h>
-
-class AdvOptions : public QDialog
-{
- Q_OBJECT
-
-public:
- AdvOptions(QWidget* parent, bool Hm, bool Vm, bool Ic);
- ~AdvOptions() {};
- QCheckBox* MirrorH;
- QCheckBox* MirrorV;
- QCheckBox* UseICC;
- QPushButton* PushButton1;
- QPushButton* PushButton2;
-
-protected:
- QVBoxLayout* AdvOptionsLayout;
- QHBoxLayout* Layout2;
-};
-
-class Druck : public QDialog
-{
- Q_OBJECT
-
-public:
- Druck( QWidget* parent, QString PDatei, QString PDev, QString PCom );
- ~Druck() {};
- QString printerName();
- QString outputFileName();
- QCheckBox* OtherCom;
- QLabel* OthText;
- QLineEdit* Command;
- bool outputToFile();
- int fromPage();
- int toPage();
- int numCopies();
- int pageOrder();
- bool outputSeparations();
- QString separationName();
- QString PrinterOpts;
- bool color();
- bool MirrorH;
- bool MirrorV;
- bool ICCinUse;
-
-public slots:
- void setMinMax(int min, int max);
- void setFromTo(int min, int max);
-
-protected:
- QVBoxLayout* DruckLayout;
- QGridLayout* DruckerLayout;
- QHBoxLayout* Layout1x;
- QHBoxLayout* Layout1;
- QHBoxLayout* UmfangLayout;
- QGridLayout* ButtonGroup5Layout;
- QGridLayout* ButtonGroup4Layout;
- QVBoxLayout* ButtonGroup3Layout;
- QVBoxLayout* ButtonGroup3_2Layout;
- QGridLayout* OptionenLayout;
- QHBoxLayout* Layout2;
- QHBoxLayout* LayoutCC;
-
-private slots:
- void SetAdvOptions();
- void SetOptions();
- void SelPrinter(const QString& prn);
- void SelRange(bool e);
- void SelMode(bool e);
- void SelFile();
- void SelComm();
-
-private:
- QGroupBox* Drucker;
- QComboBox* PrintDest;
- QLabel* DateiT;
- QLineEdit* LineEdit1;
- QToolButton* ToolButton1;
- QButtonGroup* Umfang;
- QButtonGroup* ButtonGroup5;
- QLabel* TextLabel2_2;
- QSpinBox* To;
- QSpinBox* From;
- QLabel* TextLabel2;
- QRadioButton* RadioButton2;
- QRadioButton* RadioButton1;
- QButtonGroup* ButtonGroup4;
- QRadioButton* FirstPlast;
- QRadioButton* FirstPfirst;
- QLabel* TextLabel3;
- QSpinBox* Copies;
- QButtonGroup* Optionen;
- QButtonGroup* ButtonGroup3;
- QButtonGroup* ButtonGroup3_2;
- QRadioButton* NormalP;
- QRadioButton* PrintSep;
- QRadioButton* PrintGray;
- QRadioButton* PrintGray2;
- QComboBox* SepArt;
- QPushButton* OKButton_2;
- QPushButton* OKButton;
- QPushButton* OptButton;
- QPushButton* AdvOptButton;
- QString Geraet;
- bool ToFile;
- bool ToSeparation;
-};
-
-#endif // DRUCK_H
/Scribus/Scribus/scribus/druck.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/missing.h
===================================================================
--- Scribus/Scribus/scribus/missing.h (revision 6)
+++ Scribus/Scribus/scribus/missing.h (nonexistent)
@@ -1,36 +0,0 @@
-#ifndef MISSINGFONT_H
-#define MISSINGFONT_H
-
-#include <qdialog.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <scribusdoc.h>
-
-class DmF : public QDialog
-{
- Q_OBJECT
-
-public:
- DmF( QWidget* parent, QString fon, SCFonts &avail );
- ~DmF() {};
-
- QPushButton* PushButton1;
- QLabel* TextLabel6;
- QLabel* PixmapLabel1;
- QComboBox* Replace;
- QLabel* TextLabel1;
- QLabel* TextLabel4;
- QString Ersatz;
-
-public slots:
- virtual void NeuerFont(const QString& e);
-
-protected:
- QHBoxLayout* MissingFontLayout;
- QGridLayout* Layout1;
-
-};
-
-#endif // MISSINGFONT_H
/Scribus/Scribus/scribus/missing.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/libpdf/pdflib.h
===================================================================
--- Scribus/Scribus/scribus/libpdf/pdflib.h (revision 6)
+++ Scribus/Scribus/scribus/libpdf/pdflib.h (nonexistent)
@@ -1,140 +0,0 @@
-/***************************************************************************
- pdflib.h - description
- -------------------
- begin : Sat Jan 19 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. *
- * *
- ***************************************************************************/
-
-#ifndef PDFLIB_H
-#define PDFLIB_H
-#include <qstring.h>
-#include <qrect.h>
-#include <qvaluelist.h>
-#include <qimage.h>
-#include "pageitem.h"
-#include "scribusview.h"
-#include "bookmwin.h"
-#include <qfile.h>
-
-/**
- *@author Franz Schmid
- */
-
-class PDFlib {
-
-public:
- PDFlib();
- virtual ~PDFlib();
- virtual bool PDF_Begin_Doc(QString fn, ScribusDoc *docu, ScribusView *vie, PDFOpt *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi);
- virtual void PDF_Begin_Page(Page* pag, QPixmap pm);
- virtual void PDF_End_Page();
- virtual void PDF_TemplatePage(Page* pag);
- virtual void PDF_ProcessPage(Page* pag, uint PNr);
- virtual void PDF_End_Doc(QString PrintPr = "", QString Name = "", int Components = 0);
- struct GlNamInd { uint Code;
- QString Name;
- };
- typedef QMap<uint, GlNamInd> GListeInd;
- QMap<QString, GListeInd> GlyphsIdxOfFont;
-
-private:
- QString EncStream(QString *in, int ObjNum);
- QString EncString(QString in, int ObjNum);
- void CalcOwnerKey(QString Owner, QString User);
- void CalcUserKey(QString User, int Permission);
- QString FitKey(QString pass);
- QString FToStr(float c);
- QString IToStr(int c);
- QString SetClipPath(PageItem *ite);
- QString SetFarbe(QString farbe, int Shade);
- QString setTextSt(PageItem *ite, uint PNr);
- void PutDoc(QString in);
- void PutPage(QString in);
- void StartObj(int nr);
- void WritePDFStream(QString *cc);
- QString PDFEncode(QString in);
- QByteArray ComputeMD5(QString in);
- void PDF_Bookmark(int nr, float ypos);
- void PDF_Gradient(PageItem *b);
- void PDF_Transparenz(PageItem *b);
- void PDF_Annotation(PageItem *ite, uint PNr);
- void PDF_Form(QString im);
- void PDF_xForm(float w, float h, QString im);
- void PDF_Image(QString fn, float sx, float sy, float x, float y, bool fromAN = false, QString Profil = "", bool Embedded = false, int Intent = 1);
- QString Inhalt;
- ScribusDoc* doc;
- ScribusView* view;
- Page* ActPage;
- PDFOpt* Options;
- BookMView* Bvie;
- QFile Spool;
- int Dokument;
- struct Dest { QString Name;
- int Seite;
- QString Act;
- };
- struct Cata { int Outlines;
- int PageTree;
- int Dest;
- } Catalog;
- struct PagT { QValueList<int> Kids;
- int Count;
- } PageTree;
- struct PagL { int ObjNum;
- int Thumb;
- QMap<QString,int> XObjects;
- QMap<QString,int> FObjects;
- QValueList<int> AObjects;
- QValueList<int> FormObjects;
- } Seite;
- struct OutL { int First;
- int Last;
- int Count;
- } Outlines;
- struct Bead { int Parent;
- int Next;
- int Prev;
- int Page;
- QRect Recht;
- };
- struct ICCD { int ResNum;
- QString ResName;
- QString ICCArray;
- };
- QValueList<uint> XRef;
- QValueList<Dest> NamedDest;
- QValueList<int> Threads;
- QValueList<Bead> Beads;
- QValueList<int> CalcFields;
- QMap<QString,int> Shadings;
- QMap<QString,int> Transpar;
- QMap<QString,ICCD> ICCProfiles;
- int ObjCounter;
- QString ResNam;
- int ResCount;
- QString NDnam;
- QString Datum;
- int NDnum;
- QMap<QString, QString> UsedFontsP;
- QMap<QString, QFont> RealFonts;
- bool CompAvail;
- QByteArray KeyGen;
- QByteArray OwnerKey;
- QByteArray UserKey;
- QByteArray FileID;
- QByteArray EncryKey;
- int Encrypt;
- int KeyLen;
-};
-
-#endif
/Scribus/Scribus/scribus/libpdf/pdflib.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/libpdf/Makefile.am
===================================================================
--- Scribus/Scribus/scribus/libpdf/Makefile.am (revision 6)
+++ Scribus/Scribus/scribus/libpdf/Makefile.am (nonexistent)
@@ -1,24 +0,0 @@
-libdir = $(prefix)/lib/scribus/libs
-AM_CPPFLAGS = -I$(top_builddir)/scribus
-lib_LTLIBRARIES = libpdf.la
-
-INCLUDES = $(LIBFREETYPE_CFLAGS) $(all_includes)
-
-
-libpdf_la_LDFLAGS = -version-info 0:0:0
-
-libpdf_la_METASOURCES = AUTO
-
-libpdf_la_SOURCES = pdflib.cpp
-KDE_OPTIONS = qtonly
-
-EXTRA_DIST = pdflib.cpp pdflib.h
-
-install-data-local:
- $(mkinstalldirs) $(prefix)/include/scribus/libpdf/
- $(INSTALL_DATA) $(srcdir)/pdflib.h $(prefix)/include/scribus/libpdf/pdflib.h
-
-uninstall-local:
- -rm -f $(prefix)/include/scribus/libpdf/pdflib.h
-
-AM_LDFLAGS = -s $(LIBFREETYPE_LIBS)
/Scribus/Scribus/scribus/libpdf/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/libpdf/pdflib.cpp
===================================================================
--- Scribus/Scribus/scribus/libpdf/pdflib.cpp (revision 6)
+++ Scribus/Scribus/scribus/libpdf/pdflib.cpp (nonexistent)
@@ -1,3160 +0,0 @@
-/***************************************************************************
- pdflib.cpp - description
- -------------------
- begin : Sat Jan 19 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 "pdflib.h"
-#include "config.h"
-#include <qregexp.h>
-#include <qdatetime.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
-#include <cstdlib>
-#include <cmath>
-#include "rc4.h"
-
-extern bool GlyIndex(QMap<uint, PDFlib::GlNamInd> *GListInd, QString Dat);
-extern QByteArray ComputeMD5Sum(QByteArray *in);
-extern QImage LoadPict(QString fn);
-extern bool loadText(QString nam, QString *Buffer);
-extern void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level);
-extern QString CompressStr(QString *in);
-extern QString ImageToTxt(QImage *im);
-extern QString ImageToCMYK(QImage *im);
-extern QString MaskToTxt(QImage *im, bool PDF = true);
-extern char *toHex( uchar u );
-extern QString String2Hex(QString *in, bool lang = true);
-extern float Cwidth(ScribusDoc *doc, QPainter *p, QString name, QString ch, int Siz, QString ch2 = " ");
-#ifdef HAVE_CMS
-extern bool CMSuse;
-#endif
-#ifdef HAVE_TIFF
- #include <tiffio.h>
-#endif
-extern ProfilesL InputProfiles;
-
-extern "C" void* Run();
-
-void* Run()
-{
- PDFlib *dia = new PDFlib();
- return dia;
-}
-PDFlib::PDFlib()
-{
- OwnerKey = QByteArray(32);
- UserKey = QByteArray(32);
- FileID = QByteArray(16);
- EncryKey = QByteArray(5);
- Encrypt = 0;
- KeyLen = 5;
- Dokument = 0;
- Catalog.Outlines = 2;
- Catalog.PageTree = 3;
- Catalog.Dest = 4;
- PageTree.Count = 0;
- PageTree.Kids.clear();
- Outlines.First = 0;
- Outlines.Last = 0;
- Outlines.Count = 0;
- XRef.clear();
- NamedDest.clear();
- NDnam = "LI";
- NDnum = 0;
- ObjCounter = 7;
- Seite.ObjNum = 0;
- Seite.Thumb = 0;
- Seite.XObjects.clear();
- Seite.FObjects.clear();
- Seite.AObjects.clear();
- Seite.FormObjects.clear();
- CalcFields.clear();
- Shadings.clear();
- Transpar.clear();
- ICCProfiles.clear();
- ResNam = "RE";
- ResCount = 0;
-#ifdef HAVE_LIBZ
- CompAvail = true;
-#else
- CompAvail = false;
-#endif
- KeyGen = QByteArray(32);
- KeyGen[0] = 0x28;
- KeyGen[1] = 0xbf;
- KeyGen[2] = 0x4e;
- KeyGen[3] = 0x5e;
- KeyGen[4] = 0x4e;
- KeyGen[5] = 0x75;
- KeyGen[6] = 0x8a;
- KeyGen[7] = 0x41;
- KeyGen[8] = 0x64;
- KeyGen[9] = 0x00;
- KeyGen[10] = 0x4e;
- KeyGen[11] = 0x56;
- KeyGen[12] = 0xff;
- KeyGen[13] = 0xfa;
- KeyGen[14] = 0x01;
- KeyGen[15] = 0x08;
- KeyGen[16] = 0x2e;
- KeyGen[17] = 0x2e;
- KeyGen[18] = 0x00;
- KeyGen[19] = 0xb6;
- KeyGen[20] = 0xd0;
- KeyGen[21] = 0x68;
- KeyGen[22] = 0x3e;
- KeyGen[23] = 0x80;
- KeyGen[24] = 0x2f;
- KeyGen[25] = 0x0c;
- KeyGen[26] = 0xa9;
- KeyGen[27] = 0xfe;
- KeyGen[28] = 0x64;
- KeyGen[29] = 0x53;
- KeyGen[30] = 0x69;
- KeyGen[31] = 0x7a;
-}
-
-PDFlib::~PDFlib()
-{
-}
-
-QString PDFlib::FToStr(float c)
-{
- QString cc;
- return cc.setNum(c);
-}
-
-QString PDFlib::IToStr(int c)
-{
- QString cc;
- return cc.setNum(c);
-}
-
-void PDFlib::PutDoc(QString in)
-{
- QTextStream t(&Spool);
- t.writeRawBytes(in, in.length());
- Dokument += in.length();
-}
-
-void PDFlib::PutPage(QString in)
-{
- Inhalt += in;
-}
-
-void PDFlib::StartObj(int nr)
-{
- XRef.append(Dokument);
- PutDoc(IToStr(nr)+ " 0 obj\n");
-}
-
-QString PDFlib::PDFEncode(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;
- }
- return tmp;
-}
-
-QString PDFlib::EncStream(QString *in, int ObjNum)
-{
- rc4_context_t rc4;
- QString tmp = "";
- int dlen = 0;
- if (Options->Encrypt)
- {
- if (in->length() < 1)
- return "";
- tmp = *in;
- QByteArray us(tmp.length());
- QByteArray ou(tmp.length());
- for (uint a = 0; a < tmp.length(); ++a)
- {
- us[a] = uchar(QChar(tmp.at(a)));
- }
- QByteArray data(10);
- if (KeyLen > 5)
- {
- data.resize(21);
- }
- for (int cd = 0; cd < KeyLen; ++cd)
- {
- data[cd] = EncryKey[cd];
- dlen++;
- }
- data[dlen++] = ObjNum;
- data[dlen++] = ObjNum >> 8;
- data[dlen++] = ObjNum >> 16;
- data[dlen++] = 0;
- data[dlen++] = 0;
- QByteArray step1(16);
- step1 = ComputeMD5Sum(&data);
- rc4_init(&rc4, (uchar*)step1.data(), QMIN(KeyLen+5, 16));
- rc4_encrypt(&rc4, (uchar*)us.data(), (uchar*)ou.data(), tmp.length());
- QString uk = "";
- for (uint cl = 0; cl < tmp.length(); ++cl)
- {
- uk += ou[cl];
- }
- tmp = uk;
- }
- else
- tmp = *in;
- return tmp;
-}
-
-QString PDFlib::EncString(QString in, int ObjNum)
-{
- rc4_context_t rc4;
- QString tmp;
- int dlen = 0;
- if (Options->Encrypt)
- {
- if (in.length() < 3)
- return "<>";
- tmp = in.mid(1, in.length()-2);
- QByteArray us(tmp.length());
- QByteArray ou(tmp.length());
- for (uint a = 0; a < tmp.length(); ++a)
- {
- us[a] = uchar(QChar(tmp.at(a)));
- }
- QByteArray data(10);
- if (KeyLen > 5)
- {
- data.resize(21);
- }
- for (int cd = 0; cd < KeyLen; ++cd)
- {
- data[cd] = EncryKey[cd];
- dlen++;
- }
- data[dlen++] = ObjNum;
- data[dlen++] = ObjNum >> 8;
- data[dlen++] = ObjNum >> 16;
- data[dlen++] = 0;
- data[dlen++] = 0;
- QByteArray step1(16);
- step1 = ComputeMD5Sum(&data);
- rc4_init(&rc4, (uchar*)step1.data(), QMIN(KeyLen+5, 16));
- rc4_encrypt(&rc4, (uchar*)us.data(), (uchar*)ou.data(), tmp.length());
- QString uk = "";
- for (uint cl = 0; cl < tmp.length(); ++cl)
- {
- uk += ou[cl];
- }
- tmp = "<"+String2Hex(&uk, false)+">";
- }
- else
- tmp = in;
- return tmp;
-}
-
-QString PDFlib::FitKey(QString pass)
-{
- QString pw = pass;
- if (pw.length() < 32)
- {
- uint l = pw.length();
- for (uint a = 0; a < 32 - l; ++a)
- {
- pw.append(KeyGen[a]);
- }
- }
- else
- pw = pw.left(32);
- return pw;
-}
-
-void PDFlib::CalcOwnerKey(QString Owner, QString User)
-{
- rc4_context_t rc4;
- QString pw = User;
- QString pw2;
- pw2 = Owner;
- if (pw2 == "")
- pw2 = User;
- pw = FitKey(pw);
- pw2 = FitKey(pw2);
- QByteArray step1(16);
- step1 = ComputeMD5(pw2);
- if (KeyLen > 5)
- {
- for (int kl = 0; kl < 50; ++kl)
- {
- step1 = ComputeMD5Sum(&step1);
- }
- }
- QByteArray us(32);
- QByteArray enk(16);
- if (KeyLen > 5)
- {
- for (uint a2 = 0; a2 < 32; ++a2)
- {
- OwnerKey[a2] = uchar(QChar(pw.at(a2)));
- }
- for (int rl = 0; rl < 20; rl++)
- {
- for (int j = 0; j < 16; j ++)
- {
- enk[j] = step1[j] ^ rl;
- }
- rc4_init(&rc4, (uchar*)enk.data(), 16);
- rc4_encrypt(&rc4, (uchar*)OwnerKey.data(), (uchar*)OwnerKey.data(), 32);
- }
- }
- else
- {
- for (uint a = 0; a < 32; ++a)
- {
- us[a] = uchar(QChar(pw.at(a)));
- }
- rc4_init(&rc4, (uchar*)step1.data(), 5);
- rc4_encrypt(&rc4, (uchar*)us.data(), (uchar*)OwnerKey.data(), 32);
- }
- return;
-}
-
-void PDFlib::CalcUserKey(QString User, int Permission)
-{
- rc4_context_t rc4;
- QString pw = User;
- pw = FitKey(pw);
- QByteArray step1(16);
- QByteArray perm(4);
- uint perm_value = (uint)Permission;
- perm[0] = perm_value;
- perm[1] = perm_value >> 8;
- perm[2] = perm_value >> 16;
- perm[3] = perm_value >> 24;
- for (uint a = 0; a < 32; ++a)
- {
- pw += OwnerKey[a];
- }
- for (uint a1 = 0; a1 < 4; ++a1)
- {
- pw += perm[a1];
- }
- for (uint a3 = 0; a3 < 16; ++a3)
- {
- pw += FileID[a3];
- }
- step1 = ComputeMD5(pw);
- if (KeyLen > 5)
- {
- for (int kl = 0; kl < 50; ++kl)
- {
- step1 = ComputeMD5Sum(&step1);
- }
- EncryKey.resize(16);
- }
- for (int a2 = 0; a2 < KeyLen; ++a2)
- {
- EncryKey[a2] = step1[a2];
- }
- if (KeyLen > 5)
- {
- QString pr2 = "";
- for (int kl3 = 0; kl3 < 32; ++kl3)
- {
- pr2 += KeyGen[kl3];
- }
- for (uint a4 = 0; a4 < 16; ++a4)
- {
- pr2 += FileID[a4];
- }
- step1 = ComputeMD5(pr2);
- QByteArray enk(16);
- for (uint a3 = 0; a3 < 16; ++a3)
- {
- UserKey[a3] = step1[a3];
- }
- for (int rl = 0; rl < 20; rl++)
- {
- for (int j = 0; j < 16; j ++)
- {
- enk[j] = EncryKey[j] ^ rl;
- }
- rc4_init(&rc4, (uchar*)enk.data(), 16);
- rc4_encrypt(&rc4, (uchar*)UserKey.data(), (uchar*)UserKey.data(), 16);
- }
- }
- else
- {
- rc4_init(&rc4, (uchar*)step1.data(), 5);
- rc4_encrypt(&rc4, (uchar*)KeyGen.data(), (uchar*)UserKey.data(), 32);
- }
- return;
-}
-
-QByteArray PDFlib::ComputeMD5(QString in)
-{
- QByteArray TBytes(in.length());
- for (uint a = 0; a < in.length(); ++a)
- {
- TBytes[a] = uchar(QChar(in.at(a)));
- }
- return ComputeMD5Sum(&TBytes);
-}
-
-bool PDFlib::PDF_Begin_Doc(QString fn, ScribusDoc *docu, ScribusView *vie, PDFOpt *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi)
-{
- QString tmp;
- QString ok = "";
- QString uk = "";
- QFileInfo fd;
- int a;
- Spool.setName(fn);
- if (!Spool.open(IO_WriteOnly))
- return false;
- doc = docu;
- view = vie;
- Bvie = vi;
- Options = opts;
- UsedFontsP.clear();
- if (Options->Articles)
- ObjCounter = 9;
- else
- ObjCounter = 8;
- if (Options->Version == 12)
- {
- PutDoc("%PDF-1.3\n");
- ObjCounter++;
- }
- if (Options->Version == 13)
- PutDoc("%PDF-1.3\n");
- if (Options->Version == 14)
- PutDoc("%PDF-1.4\n");
- PutDoc("%"+QString(QChar(199))+QString(QChar(236))+QString(QChar(143))+QString(QChar(162))+"\n");
- StartObj(1);
- PutDoc("<<\n/Type /Catalog\n/Outlines 3 0 R\n/Pages 4 0 R\n/Dests 5 0 R\n/AcroForm 6 0 R\n/Names 7 0 R\n");
- if (Options->Articles)
- PutDoc("/Threads 8 0 R\n");
- if (Options->Version == 12)
- PutDoc("/OutputIntents [ "+IToStr(ObjCounter-1)+" 0 R ]\n");
- PutDoc("/ViewerPreferences << /PageDirection ");
- if (Options->Binding == 0)
- PutDoc("/L2R");
- else
- PutDoc("/R2L");
- PutDoc(" >>\n>>\nendobj\n");
- QString IDg = Datum;
- IDg += Options->Datei;
- IDg += "Scribus "+QString(VERSION);
- IDg += "Libpdf for Scribus v0.6";
- IDg += doc->DocTitel;
- IDg += doc->DocAutor;
- IDg += "/False";
- FileID = ComputeMD5(IDg);
- if (Options->Encrypt)
- {
- if (Options->Version == 14)
- KeyLen = 16;
- else
- KeyLen = 5;
- CalcOwnerKey(Options->PassOwner, Options->PassUser);
- CalcUserKey(Options->PassUser, Options->Permissions);
- for (uint cl2 = 0; cl2 < 32; ++cl2)
- {
- ok += OwnerKey[cl2];
- }
- if (KeyLen > 5)
- {
- for (uint cl3 = 0; cl3 < 16; ++cl3)
- {
- uk += UserKey[cl3];
- }
- for (uint cl3r = 0; cl3r < 16; ++cl3r)
- {
- uk += KeyGen[cl3r];
- }
- }
- else
- {
- for (uint cl = 0; cl < 32; ++cl)
- {
- uk += UserKey[cl];
- }
- }
- }
- QDate d = QDate::currentDate();
- Datum = "D:";
- tmp.sprintf("%4d", d.year());
- tmp.replace(QRegExp(" "), "0");
- Datum += tmp;
- tmp.sprintf("%2d", d.month());
- tmp.replace(QRegExp(" "), "0");
- Datum += tmp;
- tmp.sprintf("%2d", d.day());
- tmp.replace(QRegExp(" "), "0");
- Datum += tmp;
- QTime t = QTime::currentTime();
- tmp = t.toString();
- tmp.replace(QRegExp(":"), "");
- Datum += tmp;
- StartObj(2);
- PutDoc("<<\n/Creator "+EncString("(Scribus "+QString(VERSION)+")",2)+"\n");
- PutDoc("/Producer "+EncString("(Libpdf for Scribus v0.6)",2)+"\n");
- PutDoc("/Title "+EncString("("+doc->DocTitel+")",2)+"\n");
- PutDoc("/Author "+EncString("("+doc->DocAutor+")",2)+"\n");
- PutDoc("/CreationDate "+EncString("("+Datum+")",2)+"\n");
- PutDoc("/ModDate "+EncString("("+Datum+")",2)+"\n");
- if (Options->Version == 12)
- PutDoc("/GTS_PDFXVersion (PDF/X-3:2002)\n");
- PutDoc("/Trapped /False\n>>\nendobj\n");
- XRef.append(Dokument);
- XRef.append(Dokument);
- XRef.append(Dokument);
- XRef.append(Dokument);
- XRef.append(Dokument);
- if (Options->Articles)
- XRef.append(Dokument);
- if (Options->Version == 12)
- XRef.append(Dokument);
- if (Options->Encrypt)
- {
- StartObj(ObjCounter);
- Encrypt = ObjCounter;
- ObjCounter++;
- PutDoc("<<\n/Filter /Standard\n");
- if (KeyLen > 5)
- PutDoc("/R 3\n/V 2\n/Length 128\n");
- else
- PutDoc("/R 2\n/V 1\n");
- PutDoc("/O <"+String2Hex(&ok)+">\n");
- PutDoc("/U <"+String2Hex(&uk)+">\n");
- PutDoc("/P "+IToStr(Options->Permissions)+"\n>>\nendobj\n");
- }
- RealFonts = DocFonts;
- QMap<QString,QFont> ReallyUsed;
- ReallyUsed.clear();
- for (uint c=0; c<view->MasterPages.count(); ++c)
- {
- for (uint d=0; d<view->MasterPages.at(c)->Items.count(); ++d)
- {
- if ((view->MasterPages.at(c)->Items.at(d)->PType == 4) || (view->MasterPages.at(c)->Items.at(d)->PType == 8))
- {
- for (uint e=0; e<view->MasterPages.at(c)->Items.at(d)->Ptext.count(); ++e)
- {
- ReallyUsed.insert(view->MasterPages.at(c)->Items.at(d)->Ptext.at(e)->cfont, DocFonts[view->MasterPages.at(c)->Items.at(d)->Ptext.at(e)->cfont]);
- }
- }
- }
- }
- for (uint c=0; c<view->Pages.count(); ++c)
- {
- for (uint d=0; d<view->Pages.at(c)->Items.count(); ++d)
- {
- if ((view->Pages.at(c)->Items.at(d)->PType == 4) || (view->Pages.at(c)->Items.at(d)->PType == 8))
- {
- for (uint e=0; e<view->Pages.at(c)->Items.at(d)->Ptext.count(); ++e)
- {
- ReallyUsed.insert(view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cfont, DocFonts[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cfont]);
- }
- }
- }
- }
- QMap<QString,QFont>::Iterator it;
- a = 0;
- for (it = ReallyUsed.begin(); it != ReallyUsed.end(); ++it)
-// for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
- {
- fd = QFileInfo(AllFonts[it.key()]->Datei);
- UsedFontsP.insert(it.key(), "/Fo"+IToStr(a));
- QString Encod = AllFonts[it.key()]->FontEnc;
- if (AllFonts[it.key()]->HasMetrics)
- {
- if ((fd.extension(false).lower() == "pfb") && (Options->EmbedList.contains(it.key())))
- {
- QString fon = "";
- StartObj(ObjCounter);
- QFile f(AllFonts[it.key()]->Datei);
- QByteArray bb(f.size());
- if (f.open(IO_ReadOnly))
- {
- f.readBlock(bb.data(), f.size());
- f.close();
- }
- uint posi;
- for (posi = 6; posi < bb.size(); ++posi)
- {
- if ((bb[posi] == char(0x80)) && (static_cast<int>(bb[posi+1]) == 2))
- break;
- fon += bb[posi];
- }
- int len1 = fon.length();
- uint ulen;
- ulen = bb[posi+2] & 0xff;
- ulen |= (bb[posi+3] << 8) & 0xff00;
- ulen |= (bb[posi+4] << 16) & 0xff0000;
- ulen |= (bb[posi+5] << 24) & 0xff000000;
- if (ulen > bb.size())
- ulen = bb.size()-7;
- posi += 6;
- for (uint j = 0; j < ulen; ++j)
- {
- fon += bb[posi];
- posi++;
- }
- posi += 6;
- int len2 = fon.length()-len1;
- for (uint j = posi; j < bb.size(); ++j)
- {
- if ((bb[j] == char(0x80)) && (static_cast<int>(bb[j+1]) == 3))
- break;
- if(bb[j]=='\r')
- fon +="\n";
- else
- fon += bb[j];
- }
- int len3 = fon.length()-len2-len1;
- if ((Options->Compress) && (CompAvail))
- fon = CompressStr(&fon);
- PutDoc("<<\n/Length "+IToStr(fon.length()+1)+"\n");
- PutDoc("/Length1 "+IToStr(len1)+"\n");
- PutDoc("/Length2 "+IToStr(len2)+"\n");
- PutDoc("/Length3 "+IToStr(len3)+"\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&fon,ObjCounter)+"\nendstream\nendobj\n");
- ObjCounter++;
- }
- if ((fd.extension(false).lower() == "pfa") && (Options->EmbedList.contains(it.key())))
- {
- QString fon = "";
- QString fon2 = "";
- QString tm = "";
- uint value;
- bool ok = true;
- StartObj(ObjCounter);
- loadText(AllFonts[it.key()]->Datei, &fon);
- int len1 = fon.find("eexec")+5;
- fon2 = fon.left(len1)+"\n";
- int len2 = fon.find("0000000000000000000000000");
- if (len2 == -1)
- len2 = fon.length()+1;
- int count = 0;
- for (int xx = len1; xx < len2-1; ++xx)
- {
- tm = fon.at(xx);
- if (tm == QChar(13))
- continue;
- if (tm == QChar(10))
- continue;
- xx++;
- count++;
- tm += fon.at(xx);
- value = tm.toUInt(&ok, 16);
- fon2 += QChar(value);
- }
- fon2 += fon.mid(len2);
- if ((Options->Compress) && (CompAvail))
- fon2 = CompressStr(&fon2);
- PutDoc("<<\n/Length "+IToStr(fon2.length()+1)+"\n");
- PutDoc("/Length1 "+IToStr(len1+1)+"\n");
- PutDoc("/Length2 "+IToStr(count)+"\n");
- if (static_cast<int>(fon.length()-len2) == -1)
- PutDoc("/Length3 0\n");
- else
- PutDoc("/Length3 "+IToStr(fon.length()-len2)+"\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&fon2, ObjCounter)+"\nendstream\nendobj\n");
- ObjCounter++;
- }
- if ((fd.extension(false).lower() == "ttf") && (Options->EmbedList.contains(it.key())))
- {
- QString fon = "";
- StartObj(ObjCounter);
- QFile f(AllFonts[it.key()]->Datei);
- QByteArray bb(f.size());
- if (f.open(IO_ReadOnly))
- {
- f.readBlock(bb.data(), f.size());
- f.close();
- }
- uint posi;
- for (posi = 0; posi < bb.size(); ++posi)
- {
- fon += bb[posi];
- }
- int len = fon.length();
- if ((Options->Compress) && (CompAvail))
- fon = CompressStr(&fon);
- PutDoc("<<\n/Length "+IToStr(fon.length()+1)+"\n");
- PutDoc("/Length1 "+IToStr(len)+"\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&fon, ObjCounter)+"\nendstream\nendobj\n");
- ObjCounter++;
- }
- StartObj(ObjCounter);
- PutDoc("<<\n/Type /FontDescriptor\n");
- PutDoc("/FontName /"+AllFonts[it.key()]->RealName()+"\n");
- PutDoc("/FontBBox [ "+AllFonts[it.key()]->FontBBox+" ]\n");
- PutDoc("/Flags ");
- QFontInfo fo = QFontInfo(it.data());
- int pfl = 0;
- if (AllFonts[it.key()]->IsFixedPitch)
- pfl = pfl ^ 1;
- if (fo.italic())
- pfl = pfl ^ 64;
- if (Encod == "adobe-fontspecific")
- pfl = pfl ^ 4;
- else
- pfl = pfl ^ 32;
- PutDoc(IToStr(pfl)+"\n");
- PutDoc("/Ascent "+AllFonts[it.key()]->Ascent+"\n");
- PutDoc("/Descent "+AllFonts[it.key()]->Descender+"\n");
- PutDoc("/CapHeight "+AllFonts[it.key()]->CapHeight+"\n");
- PutDoc("/ItalicAngle "+AllFonts[it.key()]->ItalicAngle+"\n");
- PutDoc("/StemV "+AllFonts[it.key()]->StdVW+"\n");
- if ((fd.extension(false).lower() == "ttf") && (Options->EmbedList.contains(it.key())))
- PutDoc("/FontFile2 "+IToStr(ObjCounter-1)+" 0 R\n");
- if ((fd.extension(false).lower() == "pfb") && (Options->EmbedList.contains(it.key())))
- PutDoc("/FontFile "+IToStr(ObjCounter-1)+" 0 R\n");
- if ((fd.extension(false).lower() == "pfa") && (Options->EmbedList.contains(it.key())))
- PutDoc("/FontFile "+IToStr(ObjCounter-1)+" 0 R\n");
- PutDoc(">>\nendobj\n");
- ObjCounter++;
-#ifndef HAVE_FREETYPE
- StartObj(ObjCounter);
- PutDoc("[ ");
- for (int ww = 0; ww < 256; ++ww)
- {
- PutDoc(IToStr(static_cast<int>(AllFonts[it.key()]->CharWidth[ww]*1000))+" ");
- }
- PutDoc("]\nendobj\n");
- ObjCounter++;
-#endif
- }
-#ifdef HAVE_FREETYPE
- GListeInd gl;
- GlyIndex(&gl, AllFonts[it.key()]->Datei);
- GlyphsIdxOfFont.insert(it.key(), gl);
- uint FontDes = ObjCounter - 1;
- GListeInd::Iterator itg;
- itg = gl.begin();
- GListeInd::Iterator itg2;
- itg2 = gl.begin();
- uint Fcc = gl.count() / 224;
- if ((gl.count() % 224) != 0)
- Fcc += 1;
- for (uint Fc = 0; Fc < Fcc; ++Fc)
- {
- StartObj(ObjCounter);
- int chCount = 31;
- PutDoc("[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ");
- for (int ww = 31; ww < 256; ++ww)
- {
- PutDoc(IToStr(static_cast<int>(AllFonts[it.key()]->CharWidth[itg.key()]*1000))+" ");
- if (itg == gl.end())
- break;
- ++itg;
- chCount++;
- }
- PutDoc("]\nendobj\n");
- ObjCounter++;
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Type /Encoding\n/Differences [ 32\n");
- int crc = 0;
- for (int ww2 = 32; ww2 < 256; ++ww2)
- {
- PutDoc(itg2.data().Name+" ");
- if (itg2 == gl.end())
- break;
- ++itg2;
- crc++;
- if (crc > 8)
- {
- PutDoc("\n");
- crc = 0;
- }
- }
- PutDoc("]\n>>\nendobj\n");
- StartObj(ObjCounter);
- PutDoc("<<\n/Type /Font\n/Subtype ");
- if (fd.extension(false).lower() == "ttf")
- PutDoc("/TrueType\n");
- else
- PutDoc("/Type1\n");
- PutDoc("/Name /Fo"+IToStr(a)+"S"+IToStr(Fc)+"\n");
- PutDoc("/BaseFont /"+AllFonts[it.key()]->RealName()+"\n");
- PutDoc("/FirstChar 0\n");
- PutDoc("/LastChar "+IToStr(chCount-1)+"\n");
- PutDoc("/Widths "+IToStr(ObjCounter-2)+" 0 R\n");
- PutDoc("/Encoding "+IToStr(ObjCounter-1)+" 0 R\n");
- PutDoc("/FontDescriptor "+IToStr(FontDes)+" 0 R\n");
- PutDoc(">>\nendobj\n");
- Seite.FObjects["Fo"+IToStr(a)+"S"+IToStr(Fc)] = ObjCounter;
- ObjCounter++;
- }
-#else
- StartObj(ObjCounter);
- bool cEnc = false;
- PutDoc("<<\n/Type /Font\n/Subtype ");
- if (fd.extension(false).lower() == "ttf")
- PutDoc("/TrueType\n");
- else
- PutDoc("/Type1\n");
- PutDoc("/Name /Fo"+IToStr(a)+"\n");
- if (AllFonts[it.key()]->HasMetrics)
- PutDoc("/BaseFont /"+AllFonts[it.key()]->RealName()+"\n");
- else
- PutDoc("/BaseFont /Helvetica\n");
- if ((Encod == "iso8859-1") || (Encod == "ascii-0")) // || (Encod == "adobe-fontspecific"))
- PutDoc("/Encoding /WinAnsiEncoding\n");
- if ((Encod == "iso8859-2") || (Encod == "iso8859-15") || (Encod == "iso8859-13"))
- {
- PutDoc("/Encoding "+IToStr(ObjCounter+1)+" 0 R\n");
- cEnc = true;
- }
- if (AllFonts[it.key()]->HasMetrics)
- {
- PutDoc("/FirstChar 0\n/LastChar 255\n");
- PutDoc("/Widths "+IToStr(ObjCounter-1)+" 0 R\n");
- PutDoc("/FontDescriptor "+IToStr(ObjCounter-2)+" 0 R\n");
- }
- PutDoc(">>\nendobj\n");
- Seite.FObjects["Fo"+IToStr(a)] = ObjCounter;
- ObjCounter++;
- if (cEnc)
- {
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Type /Encoding\n/Differences [\n");
- QString EncVec;
- QString Epfad = PREL;
- Epfad += "/lib/scribus/"+Encod+".enc";
- loadText(Epfad, &EncVec);
- PutDoc(EncVec);
- PutDoc("]\n>>\nendobj\n");
- }
-#endif
- a++;
- }
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- StartObj(ObjCounter);
- ObjCounter++;
- QString dataP;
- struct ICCD dataD;
- loadText(InputProfiles[Options->SolidProf], &dataP);
- PutDoc("<<\n");
- if ((Options->Compress) && (CompAvail))
- {
- PutDoc("/Filter /FlateDecode\n");
- dataP = CompressStr(&dataP);
- }
- PutDoc("/Length "+IToStr(dataP.length()+1)+"\n");
- PutDoc("/N "+IToStr(Options->SComp)+"\n");
- PutDoc(">>\nstream\n"+EncStream(&dataP, ObjCounter-1)+"\nendstream\nendobj\n");
- StartObj(ObjCounter);
- dataD.ResName = ResNam+IToStr(ResCount);
- dataD.ICCArray = "[ /ICCBased "+IToStr(ObjCounter-1)+" 0 R ]";
- dataD.ResNum = ObjCounter;
- ICCProfiles[Options->SolidProf] = dataD;
- PutDoc("[ /ICCBased "+IToStr(ObjCounter-1)+" 0 R ]\n");
- PutDoc("endobj\n");
- ResCount++;
- ObjCounter++;
- }
-#endif
- return true;
-}
-
-void PDFlib::PDF_TemplatePage(Page* pag)
-{
- QString tmp;
- ActPage = pag;
- Inhalt = "";
- Seite.AObjects.clear();
- PDF_ProcessPage(pag, pag->PageNr);
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1\n");
- PutDoc("/BBox [ 0 0 "+FToStr(doc->PageB)+" "+FToStr(doc->PageH)+" ]\n");
- PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
- if (Seite.XObjects.count() != 0)
- {
- PutDoc("/XObject <<\n");
- QMap<QString,int>::Iterator it;
- for (it = Seite.XObjects.begin(); it != Seite.XObjects.end(); ++it)
- {
- PutDoc("/"+it.key()+" "+IToStr(it.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Seite.FObjects.count() != 0)
- {
- PutDoc("/Font << \n");
- QMap<QString,int>::Iterator it2;
- for (it2 = Seite.FObjects.begin(); it2 != Seite.FObjects.end(); ++it2)
- {
- PutDoc("/"+it2.key()+" "+IToStr(it2.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Shadings.count() != 0)
- {
- PutDoc("/Shading << \n");
- QMap<QString,int>::Iterator it3;
- for (it3 = Shadings.begin(); it3 != Shadings.end(); ++it3)
- {
- PutDoc("/"+it3.key()+" "+IToStr(it3.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Transpar.count() != 0)
- {
- PutDoc("/ExtGState << \n");
- QMap<QString,int>::Iterator it3t;
- for (it3t = Transpar.begin(); it3t != Transpar.end(); ++it3t)
- {
- PutDoc("/"+it3t.key()+" "+IToStr(it3t.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (ICCProfiles.count() != 0)
- {
- PutDoc("/ColorSpace << \n");
- QMap<QString,ICCD>::Iterator it3c;
- for (it3c = ICCProfiles.begin(); it3c != ICCProfiles.end(); ++it3c)
- {
- PutDoc("/"+it3c.data().ResName+" "+IToStr(it3c.data().ResNum)+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- PutDoc(">>\n");
- if ((Options->Compress) && (CompAvail))
- Inhalt = CompressStr(&Inhalt);
- PutDoc("/Length "+IToStr(Inhalt.length()+1));
- if ((Options->Compress) && (CompAvail))
- PutDoc("\n/Filter /FlateDecode");
- PutDoc(" >>\nstream\n"+EncStream(&Inhalt, ObjCounter-1)+"\nendstream\nendobj\n");
- QString name = pag->PageNam.simplifyWhiteSpace().replace( QRegExp("\\s"), "" );
- Seite.XObjects[name] = ObjCounter-1;
-}
-
-void PDFlib::PDF_Begin_Page(Page* pag, QPixmap pm)
-{
- QString tmp;
- ActPage = pag;
- Inhalt = "";
- Seite.AObjects.clear();
- if (Options->Thumbnails)
- {
- QImage img = pm.convertToImage();
- QString im = ImageToTxt(&img);
- if ((Options->Compress) && (CompAvail))
- im = CompressStr(&im);
- StartObj(ObjCounter);
- PutDoc("<<\n/Width "+IToStr(img.width())+"\n");
- PutDoc("/Height "+IToStr(img.height())+"\n");
- PutDoc("/ColorSpace /DeviceRGB\n/BitsPerComponent 8\n");
- PutDoc("/Length "+IToStr(im.length()+1)+"\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&im, ObjCounter)+"\nendstream\nendobj\n");
- Seite.Thumb = ObjCounter;
- ObjCounter++;
- }
-}
-
-void PDFlib::PDF_End_Page()
-{
- uint PgNr = ActPage->PageNr;
- Seite.ObjNum = ObjCounter;
- WritePDFStream(&Inhalt);
- StartObj(ObjCounter);
- PutDoc("<<\n/Type /Page\n/Parent 4 0 R\n");
- PutDoc("/MediaBox [0 0 "+FToStr(doc->PageB)+" "+FToStr(doc->PageH)+"]\n");
- PutDoc("/TrimBox ["+FToStr(Options->BleedLeft)+" "+FToStr(Options->BleedBottom)+" "+FToStr(doc->PageB-Options->BleedRight)+" "+FToStr(doc->PageH-Options->BleedTop)+"]\n");
- PutDoc("/Contents "+IToStr(Seite.ObjNum)+" 0 R\n");
- if (Options->Thumbnails)
- PutDoc("/Thumb "+IToStr(Seite.Thumb)+" 0 R\n");
- if (Seite.AObjects.count() != 0)
- {
- PutDoc("/Annots [ ");
- for (uint b = 0; b < Seite.AObjects.count(); ++b)
- {
- PutDoc(IToStr(Seite.AObjects[b])+" 0 R ");
- }
- PutDoc("]\n");
- }
- if (Options->PresentMode)
- {
- PutDoc("/Dur "+IToStr(Options->PresentVals[PgNr].AnzeigeLen)+"\n");
- if (Options->PresentVals[PgNr].Effekt != 0)
- {
- PutDoc("/Trans << /Type /Trans\n");
- PutDoc("/D "+IToStr(Options->PresentVals[PgNr].EffektLen)+"\n");
- switch (Options->PresentVals[PgNr].Effekt)
- {
- case 1:
- PutDoc("/S /Blinds\n");
- if (Options->PresentVals[PgNr].Dm == 0)
- PutDoc("/Dm /H\n");
- else
- PutDoc("/Dm /V\n");
- break;
- case 2:
- PutDoc("/S /Box\n");
- if (Options->PresentVals[PgNr].M == 0)
- PutDoc("/M /I\n");
- else
- PutDoc("/M /O\n");
- break;
- case 3:
- PutDoc("/S /Dissolve\n");
- break;
- case 4:
- PutDoc("/S /Glitter\n");
- PutDoc("/Di "+IToStr(Options->PresentVals[PgNr].Di)+"\n");
- break;
- case 5:
- PutDoc("/S /Split\n");
- if (Options->PresentVals[PgNr].Dm == 0)
- PutDoc("/Dm /H\n");
- else
- PutDoc("/Dm /V\n");
- if (Options->PresentVals[PgNr].M == 0)
- PutDoc("/M /I\n");
- else
- PutDoc("/M /O\n");
- break;
- case 6:
- PutDoc("/S /Wipe\n");
- PutDoc("/Di "+IToStr(Options->PresentVals[PgNr].Di)+"\n");
- break;
- }
- PutDoc(">>\n");
- }
- }
- PutDoc(">>\nendobj\n");
- PageTree.Count++;
- PageTree.Kids.append(ObjCounter);
- ObjCounter++;
-}
-
-void PDFlib::PDF_ProcessPage(Page* pag, uint PNr)
-{
- QString tmp;
- ActPage = pag;
- PageItem* ite;
- int Lnr = 0;
- struct Layer ll;
- ll.Drucken = false;
- ll.LNr = 0;
- QString name = "/"+pag->MPageNam.simplifyWhiteSpace().replace( QRegExp("\\s"), "" );
- if (pag->MPageNam != "")
- {
- Page* mPage = view->MasterPages.at(view->MasterNames[view->Pages.at(PNr)->MPageNam]);
- if (mPage->Items.count() != 0)
- {
- PutPage("1 0 0 1 0 0 cm\n");
- PutPage(name+" Do\n");
- for (uint lam = 0; lam < doc->Layers.count(); ++lam)
- {
- Level2Layer(doc, &ll, Lnr);
- Lnr++;
- if (ll.Drucken)
- {
- for (uint am = 0; am < mPage->Items.count(); ++am)
- {
- ite = mPage->Items.at(am);
- if ((ite->LayerNr != ll.LNr) || (!ite->isPrintable))
- continue;
- if (ite->PType == 4)
- {
- PutPage("q\n");
- if ((ite->Transparency != 0) && (Options->Version == 14))
- PDF_Transparenz(ite);
- if (Options->UseRGB)
- {
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" rg\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- switch (Options->Intent)
- {
- case 0:
- PutPage("/Perceptual");
- break;
- case 1:
- PutPage("/RelativeColorimetric");
- break;
- case 2:
- PutPage("/Saturation");
- break;
- case 3:
- PutPage("/AbsoluteColorimetric");
- break;
- }
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" scn\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" SCN\n");
- }
- else
- {
-#endif
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" k\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
- PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
- if (ite->Rot != 0)
- {
- float sr = sin(-ite->Rot* 3.1415927 / 180.0);
- float cr = cos(-ite->Rot* 3.1415927 / 180.0);
- if ((cr * cr) < 0.001)
- cr = 0;
- if ((sr * sr) < 0.001)
- sr = 0;
- PutPage(FToStr(cr)+" "+FToStr(sr)+" "+FToStr(-sr)+" "+FToStr(cr)+" 0 0 cm\n");
- }
- if ((ite->Pcolor != "None") || (ite->GrType != 0))
- {
- if (ite->GrType != 0)
- PDF_Gradient(ite);
- else
- {
- PutPage(SetClipPath(ite));
- if (ite->Segments.count() != 0)
- PutPage("h\nf*\n");
- else
- PutPage("h\nf\n");
- }
- }
- if ((ite->flippedH % 2) != 0)
- PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
- if ((ite->flippedV % 2) != 0)
- PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+" cm\n");
- PutPage(setTextSt(ite, PNr));
- PutPage("Q\n");
- }
- }
- }
- }
- }
- }
- ll.Drucken = false;
- ll.LNr = 0;
- Lnr = 0;
- for (uint la = 0; la < doc->Layers.count(); ++la)
- {
- Level2Layer(doc, &ll, Lnr);
- if (ll.Drucken)
- {
- for (uint a = 0; a < ActPage->Items.count(); ++a)
- {
- ite = ActPage->Items.at(a);
- if (ite->LayerNr != ll.LNr)
- continue;
- PutPage("q\n");
- if ((ite->Transparency != 0) && (Options->Version == 14))
- PDF_Transparenz(ite);
- if ((ite->isBookmark) && (Options->Bookmarks))
- PDF_Bookmark(ite->BMnr, doc->PageH - ite->Ypos);
- if (!ite->isPrintable)
- {
- PutPage("Q\n");
- continue;
- }
- if ((ite->PType == 4) && (pag->PageNam != ""))
- {
- PutPage("Q\n");
- continue;
- }
- if (Options->UseRGB)
- {
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" rg\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" RG\n");
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- switch (Options->Intent)
- {
- case 0:
- PutPage("/Perceptual");
- break;
- case 1:
- PutPage("/RelativeColorimetric");
- break;
- case 2:
- PutPage("/Saturation");
- break;
- case 3:
- PutPage("/AbsoluteColorimetric");
- break;
- }
- PutPage(" ri\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" cs\n");
- PutPage("/"+ICCProfiles[Options->SolidProf].ResName+" CS\n");
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" scn\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" SCN\n");
- }
- else
- {
-#endif
- if (ite->Pcolor != "None")
- PutPage(SetFarbe(ite->Pcolor, ite->Shade)+" k\n");
- if (ite->Pcolor2 != "None")
- PutPage(SetFarbe(ite->Pcolor2, ite->Shade2)+" K\n");
- }
-#ifdef HAVE_CMS
- }
-#endif
- Inhalt += FToStr(ite->Pwidth)+" w\n";
- QString Dt = FToStr(QMAX(ite->Pwidth, 1));
- QString Da = FToStr(QMAX(3*ite->Pwidth, 1));
- switch (ite->PLineArt)
- {
- case Qt::SolidLine:
- PutPage("[] 0 d\n");
- break;
- case Qt::DashLine:
- PutPage("["+Da+" "+Dt+"] 0 d\n");
- break;
- case Qt::DotLine:
- PutPage("["+Dt+"] 0 d\n");
- break;
- case Qt::DashDotLine:
- PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
- break;
- case Qt::DashDotDotLine:
- PutPage("["+Da+" "+Dt+" "+Dt+" "+Dt+" "+Dt+" "+Dt+"] 0 d\n");
- break;
- default:
- PutPage("[] 0 d\n");
- break;
- }
- switch (ite->PLineEnd)
- {
- case Qt::FlatCap:
- PutPage("0 J\n");
- break;
- case Qt::SquareCap:
- PutPage("2 J\n");
- break;
- case Qt::RoundCap:
- PutPage("1 J\n");
- break;
- default:
- PutPage("0 J\n");
- break;
- }
- switch (ite->PLineJoin)
- {
- case Qt::MiterJoin:
- PutPage("0 j\n");
- break;
- case Qt::BevelJoin:
- PutPage("2 j\n");
- break;
- case Qt::RoundJoin:
- PutPage("1 j\n");
- break;
- default:
- PutPage("0 j\n");
- break;
- }
- PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
- if (ite->Rot != 0)
- {
- float sr = sin(-ite->Rot* 3.1415927 / 180.0);
- float cr = cos(-ite->Rot* 3.1415927 / 180.0);
- if ((cr * cr) < 0.001)
- cr = 0;
- if ((sr * sr) < 0.001)
- sr = 0;
- PutPage(FToStr(cr)+" "+FToStr(sr)+" "+FToStr(-sr)+" "+FToStr(cr)+" 0 0 cm\n");
- }
- switch (ite->PType)
- {
- case 2:
- if (ite->Pcolor != "None")
- {
- PutPage(SetClipPath(ite));
- if (ite->Segments.count() != 0)
- PutPage("h\nf*\n");
- else
- PutPage("h\nf\n");
- }
- PutPage(SetClipPath(ite));
- if (ite->Segments.count() != 0)
- PutPage("h\nW*\nn\n");
- else
- PutPage("h\nW\nn\n");
- if ((ite->flippedH % 2) != 0)
- PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
- if ((ite->flippedV % 2) != 0)
- PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+" cm\n");
- if ((ite->PicAvail) && (ite->Pfile != ""))
- {
- PDF_Image(ite->Pfile, ite->LocalScX, ite->LocalScY, ite->LocalX, -ite->LocalY, false, ite->IProfile, ite->UseEmbedded, ite->IRender);
- }
- break;
- case 4:
- if ((ite->isAnnotation) && (Options->Version != 12))
- {
- PDF_Annotation(ite, PNr);
- break;
- }
- if ((ite->Pcolor != "None") || (ite->GrType != 0))
- {
- PutPage(SetClipPath(ite));
- if (ite->GrType != 0)
- PDF_Gradient(ite);
- else
- {
- if (ite->Segments.count() != 0)
- PutPage("h\nf*\n");
- else
- PutPage("h\nf\n");
- }
- }
- if ((ite->flippedH % 2) != 0)
- PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
- if ((ite->flippedV % 2) != 0)
- PutPage("1 0 0 -1 0 "+FToStr(-ite->Height)+" cm\n");
- PutPage(setTextSt(ite, PNr));
- break;
- case 5:
- PutPage("0 0 m\n");
- PutPage(FToStr(ite->Width)+" "+FToStr(-ite->Height)+" l\n");
- PutPage("S\n");
- break;
- case 1:
- case 3:
- case 6:
- if (ite->GrType != 0)
- PDF_Gradient(ite);
- else
- {
- if (ite->Pcolor != "None")
- {
- PutPage(SetClipPath(ite));
- if (ite->Segments.count() != 0)
- PutPage("h\nf*\n");
- else
- PutPage("h\nf\n");
- }
- }
- if (ite->Pcolor2 != "None")
- {
- PutPage(SetClipPath(ite));
- PutPage("h\nS\n");
- }
- break;
- case 7:
- PutPage(SetClipPath(ite));
- PutPage("S\n");
- break;
- case 8:
- if (ite->PoShow)
- {
- if (ite->PoLine.size() > 3)
- {
- PutPage("q\n");
- PutPage(SetClipPath(ite));
- PutPage("S\nQ\n");
- }
- }
- PutPage(setTextSt(ite, PNr));
- break;
- }
- PutPage("Q\n");
- }
- }
- Lnr++;
- }
-}
-
-QString PDFlib::setTextSt(PageItem *ite, uint PNr)
-{
- struct Pti *hl;
- QString tmp = "";
- QString tmp2 = "";
- if (ite->PType == 4)
- tmp += "BT\n0 Tr\n";
- for (uint d = 0; d < ite->MaxChars; ++d)
- {
- hl = ite->Ptext.at(d);
- if ((hl->ch == QChar(13)) || (hl->ch == QChar(10)))
- continue;
- if (ite->PType == 8)
- {
- tmp += "q\n";
- tmp += "1 0 0 1 "+FToStr(hl->PtransX)+" "+FToStr(-hl->PtransY)+" cm\n";
- float sr = sin(-hl->PRot* 3.1415927 / 180.0);
- float cr = cos(-hl->PRot* 3.1415927 / 180.0);
- if ((cr * cr) < 0.001)
- cr = 0;
- if ((sr * sr) < 0.001)
- sr = 0;
- tmp += FToStr(cr)+" "+FToStr(sr)+" "+FToStr(-sr)+" "+FToStr(cr)+" 0 0 cm\n";
- tmp += "BT\n0 Tr\n";
- }
- else
- {
- if (hl->yp == 0)
- break;
- }
- int tsz = hl->csize;
- QString chx = hl->ch;
- if (hl->ch == QChar(30))
- {
- uint zae = 0;
- while (ite->Ptext.at(d+zae)->ch == QChar(30))
- {
- zae++;
- if (d+zae == ite->MaxChars)
- break;
- }
- QString out="%1";
- chx = out.arg(PNr+doc->FirstPnum, zae).right(zae).left(1);
- }
-
-#ifdef HAVE_FREETYPE
- uint cc = chx[0].unicode();
- uint idx = 0;
- if (GlyphsIdxOfFont[hl->cfont].contains(cc))
- idx = GlyphsIdxOfFont[hl->cfont][cc].Code;
- uint idx1 = (idx >> 8) & 0xFF;
- if ((hl->cstyle & 127) == 0)
- tmp += UsedFontsP[hl->cfont]+"S"+IToStr(idx1)+" "+IToStr(hl->csize)+" Tf\n";
-#else
- if ((hl->cstyle & 127) == 0)
- tmp += UsedFontsP[hl->cfont]+" "+IToStr(hl->csize)+" Tf\n";
-#endif
- if (hl->cstyle & 64)
- {
- if (chx.upper() != chx)
- {
- tsz = hl->csize * doc->VKapit / 100;
- chx = chx.upper();
- }
- }
- if (hl->cstyle & 1)
- tsz = hl->csize * doc->VHochSc / 100;
- if (hl->cstyle & 2)
- tsz = hl->csize * doc->VHochSc / 100;
- if ((hl->cstyle & 127) != 0)
-#ifdef HAVE_FREETYPE
- {
- cc = chx[0].unicode();
- idx = 0;
- if (GlyphsIdxOfFont[hl->cfont].contains(cc))
- idx = GlyphsIdxOfFont[hl->cfont][cc].Code;
- idx1 = (idx >> 8) & 0xFF;
- tmp += UsedFontsP[hl->cfont]+"S"+IToStr(idx1)+" "+IToStr(tsz)+" Tf\n";
- }
-#else
- tmp += UsedFontsP[hl->cfont]+" "+IToStr(tsz)+" Tf\n";
-#endif
- if (hl->ccolor != "None")
- {
- if (Options->UseRGB)
- {
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" rg\n";
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" RG\n";
- if ((hl->cstyle & 8) || (hl->cstyle & 16))
- {
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" rg\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" RG\n";
- }
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- tmp += "/"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- tmp += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" scn\n";
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" SCN\n";
- if ((hl->cstyle & 8) || (hl->cstyle & 16))
- {
- tmp2 += "/"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- tmp2 += "/"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" scn\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" SCN\n";
- }
- }
- else
- {
-#endif
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" k\n";
- tmp += SetFarbe(hl->ccolor, hl->cshade)+" K\n";
- if ((hl->cstyle & 8) || (hl->cstyle & 16))
- {
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" k\n";
- tmp2 += SetFarbe(hl->ccolor, hl->cshade)+" K\n";
- }
- }
-#ifdef HAVE_CMS
- }
-#endif
- }
- if (ite->Reverse)
- {
- QPainter ph;
- QFont ffo;
- ph.begin(doc->ActPage);
- int chs = hl->csize;
- ite->SetZeichAttr(&ph, &ffo, hl, &chs, &chx);
- float wtr;
- if (d < ite->MaxChars-1)
- wtr = Cwidth(doc, &ph, hl->cfont, chx, chs, ite->Ptext.at(d+1)->ch);
- else
- wtr = Cwidth(doc, &ph, hl->cfont, chx, chs);
- ph.end();
- tmp += "-1 0 0 1 "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp)+" Tm\n";
- }
- else
- tmp += "1 0 0 1 "+FToStr(hl->xp)+" "+FToStr(-hl->yp)+" Tm\n";
-
-#ifdef HAVE_FREETYPE
- uchar idx2 = idx & 0xFF;
- tmp += "<"+QString(toHex(idx2))+"> Tj\n";
-#else
- if ((chx == "(") || (chx == ")") || (chx == "\\"))
- chx.prepend("\\");
- tmp += "("+chx.local8Bit()+") Tj\n";
-#endif
- if (hl->cstyle & 8)
- {
- QFont tff = RealFonts[hl->cfont];
- tff.setPointSize(hl->csize);
- QFontMetrics tfm = QFontMetrics(tff);
- int Upos = tfm.underlinePos();
- int Uwid = tfm.lineWidth();
- int Ulen = tfm.width(hl->ch)+1;
- tmp2 += IToStr(Uwid)+" w\n";
- tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp-Upos)+" m\n";
- tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp-Upos)+" l\n";
- tmp2 += "S\n";
- }
- if (hl->cstyle & 16)
- {
- QFont tff = RealFonts[hl->cfont];
- tff.setPointSize(hl->csize);
- QFontMetrics tfm = QFontMetrics(tff);
- int Upos = tfm.strikeOutPos();
- int Uwid = tfm.lineWidth();
- int Ulen = tfm.width(hl->ch)+1;
- tmp2 += IToStr(Uwid)+" w\n";
- tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n";
- tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n";
- tmp2 += "S\n";
- }
- if ((hl->cstyle & 128) && ((ite->Ptext.at(QMIN(d+1, ite->Ptext.count()-1))->yp != hl->yp) && (ite->Ptext.at(QMIN(d+1, ite->Ptext.count()-1))->ch != QChar(13)) || ((ite->NextBox != 0) && (d == ite->Ptext.count()-1))))
- {
- QPainter ph;
- QFont ffo;
- ph.begin(doc->ActPage);
- int chs = hl->csize;
- ite->SetZeichAttr(&ph, &ffo, hl, &chs, &chx);
- float wtr = Cwidth(doc, &ph, hl->cfont, chx, chs);
- ph.end();
- tmp += "1 0 0 1 "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp)+" Tm\n";
-#ifdef HAVE_FREETYPE
- chx = "-";
- cc = chx[0].unicode();
- idx = 0;
- if (GlyphsIdxOfFont[hl->cfont].contains(cc))
- idx = GlyphsIdxOfFont[hl->cfont][cc].Code;
- idx2 = idx & 0xFF;
- tmp += "<"+QString(toHex(idx2))+"> Tj\n";
-#else
- tmp += "(-) Tj\n";
-#endif
- }
- if (ite->PType == 8)
- {
- tmp += "ET\nQ\n";
- }
- }
- if (ite->PType == 4)
- tmp += "ET\n"+tmp2;
- return tmp;
-}
-
-QString PDFlib::SetFarbe(QString farbe, int Shade)
-{
- QString tmp;
- CMYKColor tmpC;
- int h, s, v, k, sneu;
- tmpC = doc->PageColors[farbe];
- QColor tmpR;
- if (Options->UseRGB)
- {
- tmpC.getRawRGBColor(&h, &s, &v);
- if ((h == s) && (s == v))
- {
- tmpR.setRgb(h, s, v);
- tmpR.hsv(&h, &s, &v);
- sneu = 255 - ((255 - v) * Shade / 100);
- tmpR.setHsv(h, s, sneu);
- }
- else
- {
- tmpR.setRgb(h, s, v);
- tmpR.hsv(&h, &s, &v);
- sneu = s * Shade / 100;
- tmpR.setHsv(h, sneu, v);
- }
- tmpR.rgb(&h, &s, &v);
- tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0);
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (Options->SComp == 3)
- {
- tmpC.getRawRGBColor(&h, &s, &v);
- if ((h == s) && (s == v))
- {
- tmpR.setRgb(h, s, v);
- tmpR.hsv(&h, &s, &v);
- sneu = 255 - ((255 - v) * Shade / 100);
- tmpR.setHsv(h, s, sneu);
- }
- else
- {
- tmpR.setRgb(h, s, v);
- tmpR.hsv(&h, &s, &v);
- sneu = s * Shade / 100;
- tmpR.setHsv(h, sneu, v);
- }
- tmpR.rgb(&h, &s, &v);
- tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0);
- }
- else
- {
- tmpC.applyGCR();
- tmpC.getCMYK(&h, &s, &v, &k);
- h = h * Shade / 100;
- s = s * Shade / 100;
- v = v * Shade / 100;
- k = k * Shade / 100;
- tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0)+" "+FToStr(k / 255.0);
- }
- }
- else
- {
-#endif
- tmpC.applyGCR();
- tmpC.getCMYK(&h, &s, &v, &k);
- h = h * Shade / 100;
- s = s * Shade / 100;
- v = v * Shade / 100;
- k = k * Shade / 100;
- tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0)+" "+FToStr(k / 255.0);
- }
-#ifdef HAVE_CMS
- }
-#endif
- return tmp;
-}
-
-QString PDFlib::SetClipPath(PageItem *ite)
-{
- bool nPath = true;
- QString tmp = "";
- FPoint np;
- if (ite->PoLine.size() > 3)
- {
- for (uint poi=0; poi<ite->PoLine.size()-3; poi += 4)
- {
- if (ite->PoLine.point(poi).x() > 900000)
- {
- tmp += "h\n";
- nPath = true;
- continue;
- }
- if (nPath)
- {
- np = ite->PoLine.point(poi);
- tmp += FToStr(np.x())+" "+FToStr(-np.y())+" m\n";
- nPath = false;
- }
- np = ite->PoLine.point(poi+1);
- tmp += FToStr(np.x())+" "+FToStr(-np.y())+" ";
- np = ite->PoLine.point(poi+3);
- tmp += FToStr(np.x())+" "+FToStr(-np.y())+" ";
- np = ite->PoLine.point(poi+2);
- tmp += FToStr(np.x())+" "+FToStr(-np.y())+" c\n";
- }
- }
- return tmp;
-}
-
-void PDFlib::PDF_Transparenz(PageItem *b)
-{
- StartObj(ObjCounter);
- QString ShName = ResNam+IToStr(ResCount);
- Transpar[ShName] = ObjCounter;
- ResCount++;
- ObjCounter++;
- PutDoc("<< /Type /ExtGState\n");
- PutDoc("/CA "+FToStr(1.0 - b->Transparency)+"\n");
- PutDoc("/ca "+FToStr(1.0 - b->Transparency)+"\n");
- PutDoc("/BM /Normal\n>>\nendobj\n");
- PutPage("/"+ShName+" gs\n");
-}
-
-void PDFlib::PDF_Gradient(PageItem *b)
-{
- float w = b->Width;
- float h = -b->Height;
- float w2 = w / 2.0;
- float h2 = h / 2.0;
- float rad = QMIN(w, fabs(h)) / 2.0;
- StartObj(ObjCounter);
- QString ShName = ResNam+IToStr(ResCount);
- Shadings[ShName] = ObjCounter;
- ResCount++;
- ObjCounter++;
- PutDoc("<<\n");
- if (b->GrType == 5)
- PutDoc("/ShadingType 3\n");
- else
- PutDoc("/ShadingType 2\n");
- if (Options->UseRGB)
- PutDoc("/ColorSpace /DeviceRGB\n");
- else
-#ifdef HAVE_CMS
- {
- if ((CMSuse) && (Options->UseProfiles))
- PutDoc("/ColorSpace "+ICCProfiles[Options->SolidProf].ICCArray+"\n");
- else
-#endif
- PutDoc("/ColorSpace /DeviceCMYK\n");
-#ifdef HAVE_CMS
- }
-#endif
- switch (b->GrType)
- {
- case 1:
- PutDoc("/Coords [0 "+FToStr(h / 2.0)+" "+FToStr(w)+" "+FToStr(h / 2.0)+"]\n");
- break;
- case 2:
- PutDoc("/Coords ["+FToStr(w / 2.0)+" 0 "+FToStr(w / 2.0)+" "+FToStr(h)+"]\n");
- break;
- case 3:
- PutDoc("/Coords [0 0 "+FToStr(w)+" "+FToStr(h)+"]\n");
- break;
- case 4:
- PutDoc("/Coords ["+FToStr(w)+" 0 0 "+FToStr(h)+"]\n");
- break;
- case 5:
- PutDoc("/Coords ["+FToStr(w2)+" "+FToStr(h2)+" 0 "+FToStr(w2)+" "+FToStr(h2)+" "+FToStr(rad)+"]\n");
- break;
- }
- PutDoc("/BBox [0 "+FToStr(h)+" "+FToStr(w)+" 0]\n");
- PutDoc("/Background ["+SetFarbe(b->Pcolor, b->Shade)+"]\n");
- if (b->GrType == 5)
- PutDoc("/Extend [true true]\n");
- else
- PutDoc("/Extend [false false]\n");
- PutDoc("/Function\n<<\n/FunctionType 2\n/Domain [0 1]\n");
- if (b->GrType == 5)
- {
- PutDoc("/C0 ["+SetFarbe(b->GrColor, b->GrShade)+"]\n");
- PutDoc("/C1 ["+SetFarbe(b->GrColor2, b->GrShade2)+"]\n");
- }
- else
- {
- PutDoc("/C0 ["+SetFarbe(b->GrColor2, b->GrShade2)+"]\n");
- PutDoc("/C1 ["+SetFarbe(b->GrColor, b->GrShade)+"]\n");
- }
- PutDoc("/N 1\n>>\n>>\nendobj\nq\n");
- PutPage("q\n");
- PutPage(SetClipPath(b));
- if (b->Segments.count() != 0)
- PutPage("h\nW* n\n");
- else
- PutPage("h\nW n\n");
- if (b->GrType == 5)
- {
- QString sca = FToStr(w2 / rad)+" 0 0 "+FToStr(fabs(h2) / rad)+" ";
- if (w > fabs(h))
- sca += "-"+FToStr(w2*(w2 / rad)-w2)+" 0";
- else
- {
- if (w < fabs(h))
- sca += "0 "+FToStr(fabs(h2)*(fabs(h2) /rad)-fabs(h2));
- else
- sca += "0 0";
- }
- PutPage(sca+" cm\n");
- }
- PutPage("/"+ShName+" sh\nQ\n");
-}
-
-void PDFlib::PDF_Annotation(PageItem *ite, uint PNr)
-{
- struct Dest de;
- QString bm = "";
- QString cc, cnx;
- QString ct = "";
- int AAcoun = 0;
- int IconOb = 0;
- QImage img;
- QImage img2;
- QMap<int, QString> ind2PDFabr;
- ind2PDFabr[0] = "/Cour";
- ind2PDFabr[1] = "/CoBo";
- ind2PDFabr[2] = "/CoOb";
- ind2PDFabr[3] = "/CoBO";
- ind2PDFabr[4] = "/Helv";
- ind2PDFabr[5] = "/HeBo";
- ind2PDFabr[6] = "/HeOb";
- ind2PDFabr[7] = "/HeBO";
- ind2PDFabr[8] = "/TiRo";
- ind2PDFabr[9] = "/TiBo";
- ind2PDFabr[10] = "/TiIt";
- ind2PDFabr[11] = "/TiBI";
- ind2PDFabr[12] = "/ZaDb";
- ind2PDFabr[13] = "/Symb";
- float x = ite->Xpos;
- float y = doc->PageH - ite->Ypos;
- float x2 = ite->Xpos+ite->Width;
- float y2 = doc->PageH-ite->Ypos-ite->Height;
- for (uint d = 0; d < ite->Ptext.count(); ++d)
- {
- cc = ite->Ptext.at(d)->ch;
- if ((cc == "(") || (cc == ")") || (cc == "\\"))
- bm += "\\";
- bm += cc;
- }
- QStringList bmst = QStringList::split("\r", bm);
- switch (ite->AnChkStil)
- {
- case 0:
- ct = "4";
- break;
- case 1:
- ct = "5";
- break;
- case 2:
- ct = "F";
- break;
- case 3:
- ct = "l";
- break;
- case 4:
- ct = "H";
- break;
- case 5:
- ct = "n";
- break;
- }
- StartObj(ObjCounter);
- Seite.AObjects.append(ObjCounter);
- ObjCounter++;
- PutDoc("<<\n/Type /Annot\n");
- switch (ite->AnType)
- {
- case 0:
- case 10:
- PutDoc("/Subtype /Text\n");
- PutDoc("/Contents "+EncString("("+bm+")",ObjCounter-1)+"\n");
- break;
- case 1:
- case 11:
- PutDoc("/Subtype /Link\n");
- PutDoc("/Dest /"+NDnam+IToStr(NDnum)+"\n");
- de.Name = NDnam+IToStr(NDnum);
- de.Seite = ite->AnZiel;
- de.Act = ite->AnAction;
- NamedDest.append(de);
- NDnum++;
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- Seite.FormObjects.append(ObjCounter-1);
- PutDoc("/Subtype /Widget\n");
- PutDoc("/T "+EncString("("+ite->AnName+")",ObjCounter-1)+"\n");
- if (ite->AnToolTip != "")
- PutDoc("/TU "+EncString("("+PDFEncode(ite->AnToolTip)+")",ObjCounter-1)+"\n");
- PutDoc("/F ");
- switch (ite->AnVis)
- {
- case 0:
- PutDoc("4");
- break;
- case 1:
- PutDoc("2");
- break;
- case 2:
- PutDoc("0");
- break;
- case 3:
- PutDoc("32");
- break;
- }
- PutDoc("\n");
- PutDoc("/BS << /Type /Border /W ");
- if (ite->AnBColor != "None")
- PutDoc(IToStr(ite->AnBwid));
- else
- PutDoc("0");
- PutDoc(" /S /");
- switch (ite->AnBsty)
- {
- case 0:
- PutDoc("S");
- break;
- case 1:
- PutDoc("D");
- break;
- case 2:
- PutDoc("U");
- break;
- case 3:
- PutDoc("B");
- break;
- case 4:
- PutDoc("I");
- break;
- }
- PutDoc(" >>\n");
- cnx = "/DA ("+ind2PDFabr[ite->AnFont]+" "+IToStr(ite->ISize)+" Tf";
- if (Options->UseRGB)
- {
- if (ite->Pcolor2 != "None")
- cnx += " "+SetFarbe(ite->Pcolor2, ite->Shade2)+" rg\n";
- if (ite->Pcolor != "None")
- cnx += " "+SetFarbe(ite->Pcolor, ite->Shade)+" RG\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- cnx += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cnx += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- if (ite->Pcolor != "None")
- cnx += SetFarbe(ite->Pcolor, ite->Shade)+" SCN\n";
- if (ite->Pcolor2 != "None")
- cnx += SetFarbe(ite->Pcolor2, ite->Shade2)+" scn\n";
- }
- else
- {
-#endif
- if (ite->Pcolor2 != "None")
- cnx += " "+SetFarbe(ite->Pcolor2, ite->Shade2)+" k";
- if (ite->Pcolor != "None")
- cnx += " "+SetFarbe(ite->Pcolor, ite->Shade)+" K";
- }
-#ifdef HAVE_CMS
- }
-#endif
- cnx += ")";
- PutDoc(EncString(cnx,ObjCounter-1)+"\n");
- int flg = ite->AnFlag;
- if (Options->Version == 13)
- flg = flg & 522247;
- PutDoc("/Ff "+IToStr(flg)+"\n");
- switch (ite->AnType)
- {
- case 2:
- PutDoc("/FT /Btn\n");
- PutDoc("/H /");
- switch (ite->AnFeed)
- {
- case 0:
- PutDoc("N");
- break;
- case 1:
- PutDoc("I");
- break;
- case 2:
- PutDoc("O");
- break;
- case 3:
- PutDoc("P");
- break;
- }
- PutDoc("\n");
- break;
- case 3:
- PutDoc("/FT /Tx\n");
- PutDoc("/V "+EncString("("+bm+")",ObjCounter-1)+"\n");
- PutDoc("/DV "+EncString("("+bm+")",ObjCounter-1)+"\n");
- PutDoc("/Q "+IToStr(QMIN(ite->Ausrich,2))+"\n");
- PutDoc("/AP << /N "+IToStr(ObjCounter)+" 0 R >>\n");
- if (ite->AnMaxChar != -1)
- PutDoc("/MaxLen "+IToStr(ite->AnMaxChar)+"\n");
- break;
- case 4:
- PutDoc("/FT /Btn\n");
- if (ite->AnIsChk)
- PutDoc("/V /On\n/DV /On\n/AS /On\n");
- else
- PutDoc("/V /Off\n/DV /Off\n/AS /Off\n");
- PutDoc("/AP << /N << /On "+IToStr(ObjCounter)+" 0 R >> >>\n");
- break;
- case 5:
- case 6:
- PutDoc("/FT /Ch\n/V (");
- if (bmst.count() > 0)
- PutDoc(bmst[0]);
- PutDoc(")\n/DV ");
- cnx = "(";
- if (bmst.count() > 0)
- cnx += bmst[0];
- cnx += ")";
- PutDoc(EncString(cnx,ObjCounter-1)+"\n");
- PutDoc("/Opt [ ");
- for (uint bmc = 0; bmc < bmst.count(); ++bmc)
- {
- PutDoc(EncString("("+bmst[bmc]+")",ObjCounter-1)+"\n");
- }
- PutDoc("]\n");
- PutDoc("/AP << /N "+IToStr(ObjCounter)+" 0 R >>\n");
- break;
- }
- PutDoc("/MK << ");
- if ((ite->AnType == 5) || (ite->AnType == 6))
- {
- PutDoc("/BG [ 1 1 1 ] ");
- if (ite->AnBColor != "None")
- PutDoc("/BC [ "+SetFarbe(ite->AnBColor, 100)+" ] ");
- }
- else
- {
- if (ite->Pcolor != "None")
- PutDoc("/BG [ "+SetFarbe(ite->Pcolor, ite->Shade)+" ] ");
- if (ite->AnBColor != "None")
- PutDoc("/BC [ "+SetFarbe(ite->AnBColor, 100)+" ] ");
- }
- switch (ite->AnType)
- {
- case 2:
- PutDoc("/CA ("+bm+") ");
- if (ite->AnRollOver != "")
- PutDoc("/RC "+EncString("("+PDFEncode(ite->AnRollOver)+")",ObjCounter-1)+" ");
- if (ite->AnDown != "")
- PutDoc("/AC "+EncString("("+PDFEncode(ite->AnDown)+")",ObjCounter-1)+" ");
- if (ite->AnUseIcons)
- {
- if (ite->Pfile != "")
- {
- if (ite->pixm.hasAlphaBuffer())
- IconOb += 3;
- else
- IconOb += 2;
- PutDoc("/I "+IToStr(ObjCounter+IconOb-1)+" 0 R ");
- }
- if (ite->Pfile2 != "")
- {
- img = LoadPict(ite->Pfile2);
- if (img.hasAlphaBuffer())
- IconOb += 3;
- else
- IconOb += 2;
- PutDoc("/IX "+IToStr(ObjCounter+IconOb-1)+" 0 R ");
- }
- if (ite->Pfile3 != "")
- {
- img2 = LoadPict(ite->Pfile3);
- if (img2.hasAlphaBuffer())
- IconOb += 3;
- else
- IconOb += 2;
- PutDoc("/RI "+IToStr(ObjCounter+IconOb-1)+" 0 R ");
- }
- PutDoc("/TP "+IToStr(ite->AnIPlace)+" ");
- PutDoc("/IF << /SW /");
- switch (ite->AnScaleW)
- {
- case 0:
- PutDoc("A");
- break;
- case 1:
- PutDoc("S");
- break;
- case 2:
- PutDoc("B");
- break;
- case 3:
- PutDoc("N");
- break;
- }
- PutDoc(" /S /");
- if (ite->LocalScX != ite->LocalScY)
- PutDoc("A");
- else
- PutDoc("P");
- PutDoc(" /A [ ");
- if ((ite->Width/ite->LocalScX - ite->pixm.width()) != 0)
- PutDoc(FToStr(QMAX(ite->LocalX / (ite->Width/ite->LocalScX - ite->pixm.width()), 0.01)));
- else
- PutDoc("0");
- PutDoc(" ");
- if ((ite->Height/ite->LocalScY - ite->pixm.height()) != 0)
- PutDoc(FToStr(QMAX(ite->LocalY / (ite->Height/ite->LocalScY - ite->pixm.height()), 0.01)));
- else
- PutDoc("0");
- PutDoc(" ] >> ");
- }
- break;
- case 6:
- case 5:
- case 3:
- break;
- case 4:
- PutDoc("/CA "+EncString("("+ct+")",ObjCounter-1)+" ");
- break;
- }
- if (ite->Rot != 0)
- PutDoc("/R "+IToStr((abs(static_cast<int>(ite->Rot)) / 90)*90)+" ");
- PutDoc(">>\n");
- if ((ite->AnActType != 0) || (ite->AnAAact))
- {
- if (ite->AnActType == 5)
- PutDoc("/A << /Type /Action /S /ImportData\n/F "+EncString("("+ite->AnAction+")",ObjCounter-1)+" >>\n");
- if (ite->AnActType == 4)
- PutDoc("/A << /Type /Action /S /ResetForm >>\n");
- if (ite->AnActType == 3)
- {
- PutDoc("/A << /Type /Action /S /SubmitForm\n/F << /FS /URL /F "+EncString("("+ite->AnAction+")",ObjCounter-1)+" >>\n");
- if (ite->AnHTML)
- PutDoc("/Flags 4");
- PutDoc(">>\n");
- }
- if (ite->AnActType == 1)
- {
- if (ite->AnAction != "")
- {
- PutDoc("/A << /Type /Action /S /JavaScript /JS ");
- if (ite->AnType > 2)
- PutDoc(IToStr(ObjCounter+1+IconOb));
- else
- PutDoc(IToStr(ObjCounter+IconOb));
- PutDoc(" 0 R >>\n");
- }
- }
- if (ite->AnAAact)
- {
- if (ite->AnAction != "")
- {
- PutDoc("/A << /Type /Action /S /JavaScript /JS ");
- if (ite->AnType > 2)
- PutDoc(IToStr(ObjCounter+1+IconOb));
- else
- PutDoc(IToStr(ObjCounter+IconOb));
- PutDoc(" 0 R >>\n");
- }
- PutDoc("/AA ");
- if (ite->AnType > 2)
- {
- if (ite->AnAction != "")
- PutDoc(IToStr(ObjCounter+2+IconOb));
- else
- PutDoc(IToStr(ObjCounter+1+IconOb));
- }
- else
- {
- if (ite->AnAction != "")
- PutDoc(IToStr(ObjCounter+1+IconOb));
- else
- PutDoc(IToStr(ObjCounter));
- }
- PutDoc(" 0 R\n");
- if (ite->An_C_act != "")
- CalcFields.append(ObjCounter-1+IconOb);
- }
- if (ite->AnActType == 2)
- {
- PutDoc("/A << /Type /Action /S /GoTo /D /"+NDnam+IToStr(NDnum)+" >>\n");
- de.Name = NDnam+IToStr(NDnum);
- de.Seite = ite->AnZiel;
- de.Act = ite->AnAction;
- NamedDest.append(de);
- NDnum++;
- }
- }
- break;
- }
- if ((ite->AnType < 2) || (ite->AnType > 9))
- PutDoc("/Border [ 0 0 0 ]\n");
- switch (((abs(static_cast<int>(ite->Rot)) / 90)*90))
- {
- case 0:
- break;
- case 90:
- x = ite->Xpos;
- y2 = doc->PageH - ite->Ypos;
- x2 = ite->Xpos + ite->Height;
- y = y2 + ite->Width;
- break;
- case 180:
- x = ite->Xpos - ite->Width;
- y2 = doc->PageH - ite->Ypos;
- x2 = ite->Xpos;
- y = y2 + ite->Height;
- break;
- case 270:
- x = ite->Xpos - ite->Height;
- y2 = doc->PageH - ite->Ypos - ite->Width;
- x2 = ite->Xpos;
- y = doc->PageH - ite->Ypos;
- break;
- }
- PutDoc("/Rect [ "+FToStr(x)+" "+FToStr(y2)+" "+FToStr(x2)+" "+FToStr(y)+" ]\n");
- PutDoc(">>\nendobj\n");
- if ((ite->AnType == 2) && (ite->AnUseIcons))
- {
- if (ite->Pfile != "")
- {
- PDF_Image(ite->Pfile, ite->LocalScX, ite->LocalScY, ite->LocalX, -ite->LocalY, true);
- cc = IToStr(ite->pixm.width())+" 0 0 "+IToStr(ite->pixm.height())+" 0 0 cm\n";
- cc += "/"+ResNam+IToStr(ResCount-1)+" Do";
- PDF_xForm(ite->pixm.width(), ite->pixm.height(), cc);
- }
- if (ite->Pfile2 != "")
- {
- PDF_Image(ite->Pfile2, ite->LocalScX, ite->LocalScY, ite->LocalX, -ite->LocalY, true);
- cc = IToStr(img.width())+" 0 0 "+IToStr(img.height())+" 0 0 cm\n";
- cc += "/"+ResNam+IToStr(ResCount-1)+" Do";
- PDF_xForm(img.width(), img.height(), cc);
- }
- if (ite->Pfile3 != "")
- {
- PDF_Image(ite->Pfile3, ite->LocalScX, ite->LocalScY, ite->LocalX, -ite->LocalY, true);
- cc = IToStr(img2.width())+" 0 0 "+IToStr(img2.height())+" 0 0 cm\n";
- cc += "/"+ResNam+IToStr(ResCount-1)+" Do";
- PDF_xForm(img2.width(), img2.height(), cc);
- }
- }
- if (ite->AnType == 3)
- {
- cc = "";
- if (Options->UseRGB)
- {
- if (ite->Pcolor != "None")
- cc += SetFarbe(ite->Pcolor, ite->Shade)+" RG\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->Pcolor != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->Pcolor, ite->Shade)+" SCN\n";
- }
- }
- else
- {
-#endif
- if (ite->Pcolor != "None")
- cc += SetFarbe(ite->Pcolor, ite->Shade)+" K\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
- cc += FToStr(x)+" "+FToStr(y2)+" "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nf\n";
- cc += "/Tx BMC\nBT\n";
- if (Options->UseRGB)
- {
- if (ite->Pcolor2 != "None")
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" rg\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->Pcolor2 != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" scn\n";
- }
- }
- else
- {
-#endif
- if (ite->Pcolor2 != "None")
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" k\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
-// if (Options->Version == 13)
- cc += ind2PDFabr[ite->AnFont];
-/* else
-#ifdef HAVE_FREETYPE
- cc += UsedFonts[ite->IFont]+"S0";
-#else
- cc += UsedFonts[ite->IFont];
-#endif */
- cc += " "+IToStr(ite->ISize)+" Tf\n";
- cc += "1 0 0 1 0 0 Tm\n0 0 Td\n"+EncString("("+bm+")",ObjCounter-1)+" Tj\nET\nEMC";
- PDF_Form(cc);
- }
- if (ite->AnType == 4)
- {
- cc = "q\nBT\n";
- if (Options->UseRGB)
- {
- if (ite->Pcolor2 != "None")
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" rg\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->Pcolor2 != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" scn\n";
- }
- }
- else
- {
-#endif
- if (ite->Pcolor2 != "None")
- cc += SetFarbe(ite->Pcolor2, ite->Shade2)+" k\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
- cc += "/ZaDb "+IToStr(ite->ISize)+" Tf\n";
- cc += "0 0 Td\n("+ct+") Tj\nET\nQ";
- PDF_Form(cc);
- }
- if ((ite->AnType == 5) || (ite->AnType == 6))
- {
- cc = "";
- cc += "1 g\n";
- cc += "0 0 "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nf\n";
- cc += IToStr(ite->AnBwid)+" w\n";
- if (Options->UseRGB)
- {
- if (ite->AnBColor != "None")
- cc += SetFarbe(ite->AnBColor, 100)+" RG\n";
- else
- cc += "0 G\n";
- }
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles))
- {
- if (ite->AnBColor != "None")
- {
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" cs\n";
- cc += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
- cc += SetFarbe(ite->AnBColor, 100)+" SCN\n";
- }
- else
- cc += "0 G\n";
- }
- else
- {
-#endif
- if (ite->AnBColor != "None")
- cc += SetFarbe(ite->AnBColor, 100)+" K\n";
- else
- cc += "0 G\n";
- }
-#ifdef HAVE_CMS
- }
-#endif
- cc += "0 0 "+FToStr(x2-x)+" "+FToStr(y-y2)+" re\nS\n";
- cc += "/Tx BMC\nq\nBT\n";
- cc += "0 g\n";
- cc += ind2PDFabr[ite->AnFont];
- cc += " "+IToStr(ite->ISize)+" Tf\n";
- cc += "1 0 0 1 0 0 Tm\n0 0 Td\n";
- if (bmst.count() > 0)
- cc += EncString("("+bmst[0]+")",ObjCounter-1);
- cc += " Tj\nET\nQ\nEMC";
- PDF_xForm(ite->Width, ite->Height, cc);
- }
- if ((ite->AnType > 1) && ((ite->AnActType == 1) || (ite->AnAAact)) && (ite->AnAction != ""))
- WritePDFStream(&ite->AnAction);
- if ((ite->AnType > 1) && (ite->AnAAact))
- {
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<<\n");
- if (ite->An_E_act != "")
- {
- PutDoc("/E << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_X_act != "")
- {
- PutDoc("/X << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_D_act != "")
- {
- PutDoc("/D << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_Fo_act != "")
- {
- PutDoc("/Fo << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_Bl_act != "")
- {
- PutDoc("/Bl << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if ((ite->AnType == 3) || (ite->AnType == 5) || (ite->AnType == 6))
- {
- if (ite->An_K_act != "")
- {
- PutDoc("/K << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_F_act != "")
- {
- PutDoc("/F << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_V_act != "")
- {
- PutDoc("/V << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- if (ite->An_C_act != "")
- {
- PutDoc("/C << /Type /Action /S /JavaScript /JS "+IToStr(ObjCounter+AAcoun)+" 0 R >>\n");
- AAcoun++;
- }
- }
- PutDoc(">>\nendobj\n");
- if (ite->An_E_act != "")
- WritePDFStream(&ite->An_E_act);
- if (ite->An_X_act != "")
- WritePDFStream(&ite->An_X_act);
- if (ite->An_D_act != "")
- WritePDFStream(&ite->An_D_act);
- if (ite->An_Fo_act != "")
- WritePDFStream(&ite->An_Fo_act);
- if (ite->An_Bl_act != "")
- WritePDFStream(&ite->An_Bl_act);
- if ((ite->AnType == 3) || (ite->AnType == 5) || (ite->AnType == 6))
- {
- if (ite->An_K_act != "")
- WritePDFStream(&ite->An_K_act);
- if (ite->An_F_act != "")
- WritePDFStream(&ite->An_F_act);
- if (ite->An_V_act != "")
- WritePDFStream(&ite->An_V_act);
- if (ite->An_C_act != "")
- WritePDFStream(&ite->An_C_act);
- }
- }
-}
-
-void PDFlib::WritePDFStream(QString *cc)
-{
- QString tmp = *cc;
- if ((Options->Compress) && (CompAvail))
- tmp = CompressStr(&tmp);
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Length "+IToStr(tmp.length())); // moeglicherweise +1
- if ((Options->Compress) && (CompAvail))
- PutDoc("\n/Filter /FlateDecode");
- PutDoc(" >>\nstream\n"+EncStream(&tmp, ObjCounter-1)+"\nendstream\nendobj\n");
-}
-
-void PDFlib::PDF_xForm(float w, float h, QString im)
-{
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<<\n/Type /XObject\n/Subtype /Form\n");
- PutDoc("/BBox [ 0 0 "+FToStr(w)+" "+FToStr(h)+" ]\n");
- PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
- if (Seite.XObjects.count() != 0)
- {
- PutDoc("/XObject <<\n");
- QMap<QString,int>::Iterator it;
- for (it = Seite.XObjects.begin(); it != Seite.XObjects.end(); ++it)
- {
- PutDoc("/"+it.key()+" "+IToStr(it.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Seite.FObjects.count() != 0)
- {
- PutDoc("/Font << \n");
- QMap<QString,int>::Iterator it2;
- for (it2 = Seite.FObjects.begin(); it2 != Seite.FObjects.end(); ++it2)
- {
- PutDoc("/"+it2.key()+" "+IToStr(it2.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- PutDoc(">>\n");
- PutDoc("/Length "+IToStr(im.length())+"\n");
- PutDoc(">>\nstream\n"+EncStream(&im, ObjCounter-1)+"\nendstream\nendobj\n");
- Seite.XObjects[ResNam+IToStr(ResCount)] = ObjCounter-1;
-}
-
-void PDFlib::PDF_Form(QString im)
-{
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<<\n");
- PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
- if (Seite.FObjects.count() != 0)
- {
- PutDoc("/Font << \n");
- QMap<QString,int>::Iterator it2;
- for (it2 = Seite.FObjects.begin(); it2 != Seite.FObjects.end(); ++it2)
- {
- PutDoc("/"+it2.key()+" "+IToStr(it2.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- PutDoc(">>\n");
- PutDoc("/Length "+IToStr(im.length())+"\n");
- PutDoc(">>\nstream\n"+EncStream(&im, ObjCounter-1)+"\nendstream\nendobj\n");
-}
-
-void PDFlib::PDF_Bookmark(int nr, float ypos)
-{
- Bvie->SetAction(nr, "/XYZ 0 "+FToStr(ypos)+" 0]");
-}
-
-void PDFlib::PDF_Image(QString fn, float sx, float sy, float x, float y, bool fromAN, QString Profil, bool Embedded, int Intent)
-{
- QFileInfo fi = QFileInfo(fn);
- QString ext = fi.extension(false).lower();
- QImage img;
- QString im, tmp, dummy, cmd1, cmd2, BBox;
- QChar tc;
- bool found = false;
- int ret = -1;
- float x2, y2, b, h, ax, ay, a2, a1;
- x2 = 0;
- float aufl = Options->Resolution / 72.0;
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles2))
- {
- if (!ICCProfiles.contains(Profil))
- {
- StartObj(ObjCounter);
- ObjCounter++;
- QString dataP = "";
- struct ICCD dataD;
- if ((Embedded) && (!Options->EmbeddedI))
-#ifdef HAVE_TIFF
- {
- if (ext == "tif")
- {
- DWORD EmbedLen = 0;
- LPBYTE EmbedBuffer;
- TIFF* tif = TIFFOpen(fn, "r");
- if(tif)
- {
- if (TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer))
- {
- for (uint el = 0; el < EmbedLen; ++el)
- {
- dataP += EmbedBuffer[el];
- }
- }
- else
- loadText(InputProfiles[Options->ImageProf], &dataP);
- }
- else
- loadText(InputProfiles[Options->ImageProf], &dataP);
- TIFFClose(tif);
- }
- else
- loadText(InputProfiles[Options->ImageProf], &dataP);
- }
-#else
- loadText(InputProfiles[Options->ImageProf], &dataP);
-#endif
- else
- {
- if (Embedded)
- loadText(InputProfiles[Options->ImageProf], &dataP);
- else
- loadText(InputProfiles[Profil], &dataP);
- }
- PutDoc("<<\n");
- if ((Options->Compress) && (CompAvail))
- {
- PutDoc("/Filter /FlateDecode\n");
- dataP = CompressStr(&dataP);
- }
- PutDoc("/Length "+IToStr(dataP.length()+1)+"\n");
- PutDoc("/N 3\n");
- PutDoc(">>\nstream\n"+EncStream(&dataP, ObjCounter-1)+"\nendstream\nendobj\n");
- StartObj(ObjCounter);
- dataD.ResName = ResNam+IToStr(ResCount);
- dataD.ICCArray = "[ /ICCBased "+IToStr(ObjCounter-1)+" 0 R ]";
- dataD.ResNum = ObjCounter;
- ICCProfiles[Profil] = dataD;
- PutDoc("[ /ICCBased "+IToStr(ObjCounter-1)+" 0 R ]\n");
- PutDoc("endobj\n");
- ResCount++;
- ObjCounter++;
- }
- }
-#endif
- if (ext == "eps")
- {
- QFile f(fn);
- if (f.open(IO_ReadOnly))
- {
- QTextStream ts(&f);
- while (!ts.atEnd())
- {
- tc = ' ';
- tmp = "";
- while ((tc != '\n') && (tc != '\r'))
- {
- ts >> tc;
- if ((tc != '\n') && (tc != '\r'))
- tmp += tc;
- }
- if (tmp.startsWith("%%BoundingBox"))
- {
- found = true;
- BBox = tmp;
- }
- if (tmp.startsWith("%%EndComments"))
- break;
- }
- f.close();
- if (found)
- {
- QTextStream ts2(&BBox, IO_ReadOnly);
- ts2 >> dummy >> x2 >> y2 >> b >> h;
- x2 = x2 * aufl;
- y2 = y2 * aufl;
- b = b * aufl;
- h = h * aufl;
- cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(Options->Resolution)+" -sOutputFile=/tmp/sc.png -g";
- cmd2 = " -c showpage -c quit";
- ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp.setNum(qRound(h)) + " " + fn + cmd2);
- if (ret == 0)
- {
- QImage image;
- image.load("/tmp/sc.png");
- image = image.convertDepth(32);
- img = image.copy(static_cast<int>(x2), 0, static_cast<int>(b-x2), static_cast<int>(h-y2));
- system("rm -f /tmp/sc.png");
- }
- }
- }
- if (Options->RecalcPic)
- {
- float afl = QMIN(Options->PicRes, Options->Resolution);
- a2 = Options->Resolution / afl / sx;
- a1 = Options->Resolution / afl / sy;
- ax = img.width() / a2;
- ay = img.height() / a1;
- img = img.smoothScale(static_cast<int>(ax), static_cast<int>(ay));
- img = img.convertDepth(32);
- sx = sx * a2;
- sy = sy * a1;
- }
- }
- else
- {
- img = LoadPict(fn);
- if (Options->RecalcPic)
- {
- float afl = QMIN(Options->PicRes, Options->Resolution);
- a2 = (72.0 / sx) / afl;
- a1 = (72.0 / sy) / afl;
- ax = img.width() / a2;
- ay = img.height() / a1;
- img = img.smoothScale(qRound(ax), qRound(ay));
- img = img.convertDepth(32);
- sx = sx * a2;
- sy = sy * a1;
- }
- aufl = 1;
- }
- if (Options->UseRGB)
- im = ImageToTxt(&img);
- else
- {
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles2))
- im = ImageToTxt(&img);
- else
-#endif
- im = ImageToCMYK(&img);
- }
- sx = sx * (1.0 / aufl);
- sy = sy * (1.0 / aufl);
- if (img.hasAlphaBuffer())
- {
- QImage iMask = img.createAlphaMask();
- QString im2 = MaskToTxt(&iMask);
- StartObj(ObjCounter);
- ObjCounter++;
- if ((Options->Compress) && (CompAvail))
- im2 = CompressStr(&im2);
- PutDoc("<<\n/Type /XObject\n/Subtype /Image\n");
- PutDoc("/Width "+IToStr(iMask.width())+"\n");
- PutDoc("/Height "+IToStr(iMask.height())+"\n");
- PutDoc("/ImageMask true\n/BitsPerComponent 1\n");
- PutDoc("/Length "+IToStr(im2.length())+"\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&im2, ObjCounter-1)+"\nendstream\nendobj\n");
- Seite.XObjects[ResNam+IToStr(ResCount)] = ObjCounter-1;
- ResCount++;
- }
- StartObj(ObjCounter);
- ObjCounter++;
- if ((Options->Compress) && (CompAvail))
- im = CompressStr(&im);
- PutDoc("<<\n/Type /XObject\n/Subtype /Image\n");
- PutDoc("/Width "+IToStr(img.width())+"\n");
- PutDoc("/Height "+IToStr(img.height())+"\n");
-#ifdef HAVE_CMS
- if ((CMSuse) && (Options->UseProfiles2))
- {
- PutDoc("/ColorSpace "+ICCProfiles[Profil].ICCArray+"\n");
- PutDoc("/Intent /");
- int inte2 = Intent;
- if (Options->EmbeddedI)
- inte2 = Options->Intent2;
- switch (inte2)
- {
- case 0:
- PutDoc("Perceptual");
- break;
- case 1:
- PutDoc("RelativeColorimetric");
- break;
- case 2:
- PutDoc("Saturation");
- break;
- case 3:
- PutDoc("AbsoluteColorimetric");
- break;
- }
- PutDoc("\n");
- }
- else
- {
-#endif
- if (Options->UseRGB)
- PutDoc("/ColorSpace /DeviceRGB\n");
- else
- PutDoc("/ColorSpace /DeviceCMYK\n");
-#ifdef HAVE_CMS
- }
-#endif
- PutDoc("/BitsPerComponent 8\n");
- PutDoc("/Length "+IToStr(im.length())+"\n");
- if (img.hasAlphaBuffer())
- PutDoc("/Mask "+IToStr(ObjCounter-2)+" 0 R\n");
- if ((Options->Compress) && (CompAvail))
- PutDoc("/Filter /FlateDecode\n");
- PutDoc(">>\nstream\n"+EncStream(&im, ObjCounter-1)+"\nendstream\nendobj\n");
- Seite.XObjects[ResNam+IToStr(ResCount)] = ObjCounter-1;
- if (!fromAN)
- {
- Inhalt += FToStr(img.width()*sx)+" 0 0 "+FToStr(img.height()*sy)+" "+FToStr(x*sx)+" "+FToStr((-img.height()+y)*sy)+" cm\n";
- Inhalt += "/"+ResNam+IToStr(ResCount)+" Do\n";
- }
- ResCount++;
- return;
-}
-
-void PDFlib::PDF_End_Doc(QString PrintPr, QString Name, int Components)
-{
- QString tmp;
- uint StX;
- int Basis;
- int ResO;
- BookMItem* ip;
- QListViewItem* pp;
- QString Inhal = "";
- QMap<int,QString> Inha;
- Inha.clear();
- int Bmc = 0;
- if ((Bvie->childCount() != 0) && (Options->Bookmarks))
- {
- Basis = ObjCounter - 1;
- Outlines.Count = Bvie->childCount();
- ip = (BookMItem*)Bvie->firstChild();
- pp = Bvie->firstChild();
- Outlines.First = ip->ItemNr+Basis;
- while (pp)
- {
- if (!pp->nextSibling())
- {
- ip = (BookMItem*)pp;
- Outlines.Last = ip->ItemNr+Basis;
- break;
- }
- pp = pp->nextSibling();
- }
- QListViewItemIterator it(Bvie);
- for ( ; it.current(); ++it)
- {
- ip = (BookMItem*)it.current();
- Inhal = "";
- Bmc++;
- Inhal += IToStr(ip->ItemNr+Basis)+ " 0 obj\n";
- Inhal += "<<\n/Title ("+ip->Titel+")\n";
- if (ip->Pare == 0)
- Inhal += "/Parent 3 0 R\n";
- else
- Inhal += "/Parent "+IToStr(ip->Pare+Basis)+" 0 R\n";
- if (ip->Prev != 0)
- Inhal += "/Prev "+IToStr(ip->Prev+Basis)+" 0 R\n";
- if (ip->Next != 0)
- Inhal += "/Next "+IToStr(ip->Next+Basis)+" 0 R\n";
- if (ip->First != 0)
- Inhal += "/First "+IToStr(ip->First+Basis)+" 0 R\n";
- if (ip->Last != 0)
- Inhal += "/Last "+IToStr(ip->Last+Basis)+" 0 R\n";
- if (ip->firstChild())
- Inhal += "/Count -"+IToStr(ip->childCount())+"\n";
- if (ip->Seite < static_cast<int>(PageTree.Kids.count()))
- Inhal += "/Dest ["+IToStr(PageTree.Kids[ip->Seite])+" 0 R "+ip->Action+"\n";
- Inhal += ">>\nendobj\n";
- Inha[ip->ItemNr] = Inhal;
- }
- for (int b = 1; b < Bmc+1; ++b)
- {
- XRef.append(Dokument);
- PutDoc(Inha[b]);
- ObjCounter++;
- }
- }
- StartObj(ObjCounter);
- ResO = ObjCounter;
- PutDoc("<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
- if (Seite.XObjects.count() != 0)
- {
- PutDoc("/XObject <<\n");
- QMap<QString,int>::Iterator it;
- for (it = Seite.XObjects.begin(); it != Seite.XObjects.end(); ++it)
- {
- PutDoc("/"+it.key()+" "+IToStr(it.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Seite.FObjects.count() != 0)
- {
- PutDoc("/Font << \n");
- QMap<QString,int>::Iterator it2;
- for (it2 = Seite.FObjects.begin(); it2 != Seite.FObjects.end(); ++it2)
- {
- PutDoc("/"+it2.key()+" "+IToStr(it2.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Shadings.count() != 0)
- {
- PutDoc("/Shading << \n");
- QMap<QString,int>::Iterator it3;
- for (it3 = Shadings.begin(); it3 != Shadings.end(); ++it3)
- {
- PutDoc("/"+it3.key()+" "+IToStr(it3.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (Transpar.count() != 0)
- {
- PutDoc("/ExtGState << \n");
- QMap<QString,int>::Iterator it3t;
- for (it3t = Transpar.begin(); it3t != Transpar.end(); ++it3t)
- {
- PutDoc("/"+it3t.key()+" "+IToStr(it3t.data())+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- if (ICCProfiles.count() != 0)
- {
- PutDoc("/ColorSpace << \n");
- QMap<QString,ICCD>::Iterator it3c;
- for (it3c = ICCProfiles.begin(); it3c != ICCProfiles.end(); ++it3c)
- {
- PutDoc("/"+it3c.data().ResName+" "+IToStr(it3c.data().ResNum)+" 0 R\n");
- }
- PutDoc(">>\n");
- }
- PutDoc(">>\nendobj\n");
- ObjCounter++;
- XRef[2] = Dokument;
- PutDoc("3 0 obj\n<<\n/Type /Outlines\n");
- PutDoc("/Count "+IToStr(Outlines.Count)+"\n");
- if ((Bvie->childCount() != 0) && (Options->Bookmarks))
- {
- PutDoc("/First "+IToStr(Outlines.First)+" 0 R\n");
- PutDoc("/Last "+IToStr(Outlines.Last)+" 0 R\n");
- }
- PutDoc(">>\nendobj\n");
- XRef[3] = Dokument;
- PutDoc("4 0 obj\n<<\n/Type /Pages\n/Kids [");
- for (uint b = 0; b < PageTree.Kids.count(); ++b)
- {
- PutDoc(IToStr(PageTree.Kids[b])+" 0 R ");
- }
- PutDoc("]\n");
- PutDoc("/Count "+IToStr(PageTree.Count)+"\n");
- PutDoc("/Resources "+IToStr(ObjCounter-1)+" 0 R\n");
- PutDoc(">>\nendobj\n");
- XRef[4] = Dokument;
- PutDoc("5 0 obj\n<<\n");
- if (NamedDest.count() != 0)
- {
- QValueList<Dest>::Iterator vt;
- for (vt = NamedDest.begin(); vt != NamedDest.end(); ++vt)
- {
- if ((*vt).Seite < static_cast<int>(PageTree.Kids.count()))
- PutDoc("/"+(*vt).Name+" ["+IToStr(PageTree.Kids[(*vt).Seite])+" 0 R /XYZ "+(*vt).Act+"]\n");
- }
- }
- PutDoc(">>\nendobj\n");
- XRef[5] = Dokument;
- PutDoc("6 0 obj\n<< /Fields [ ");
- if (Seite.FormObjects.count() != 0)
- {
- for (uint fo = 0; fo < Seite.FormObjects.count(); ++fo)
- {
- PutDoc(IToStr(Seite.FormObjects[fo])+" 0 R ");
- }
- }
- PutDoc(" ]\n");
- if (CalcFields.count() != 0)
- {
- PutDoc("/CO [ ");
- for (uint foc = 0; foc < CalcFields.count(); ++foc)
- {
- PutDoc(IToStr(CalcFields[foc])+" 0 R ");
- }
- PutDoc(" ]\n");
- }
- PutDoc("/NeedAppearances true\n/DR "+IToStr(ResO)+" 0 R\n>>\nendobj\n");
- if (doc->JavaScripts.count() != 0)
- {
- int Fjav0 = ObjCounter;
- QMap<QString,QString>::Iterator itja0;
- for (itja0 = doc->JavaScripts.begin(); itja0 != doc->JavaScripts.end(); ++itja0)
- {
- WritePDFStream(&itja0.data());
- }
- int Fjav = ObjCounter;
- QMap<QString,QString>::Iterator itja;
- for (itja = doc->JavaScripts.begin(); itja != doc->JavaScripts.end(); ++itja)
- {
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /S /JavaScript /JS "+IToStr(Fjav0)+" 0 R >>\n");
- PutDoc("endobj\n");
- Fjav0++;
- }
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Names [ ");
- QMap<QString,QString>::Iterator itja2;
- for (itja2 = doc->JavaScripts.begin(); itja2 != doc->JavaScripts.end(); ++itja2)
- {
- PutDoc(EncString("("+itja2.key()+")", 6)+" "+IToStr(Fjav)+" 0 R ");
- Fjav++;
- }
- PutDoc("] >>\nendobj\n");
- }
- XRef[6] = Dokument;
- PutDoc("7 0 obj\n<< ");
- if (doc->JavaScripts.count() != 0)
- PutDoc("/JavaScript "+IToStr(ObjCounter-1)+" 0 R");
- PutDoc(" >>\nendobj\n");
- if (Options->Articles)
- {
- Threads.clear();
- for (uint pgs = 0; pgs < view->Pages.count(); ++pgs)
- {
- for (uint ele = 0; ele < view->Pages.at(pgs)->Items.count(); ++ele)
- {
- PageItem* tel = view->Pages.at(pgs)->Items.at(ele);
- if ((tel->PType == 4) && (tel->BackBox == 0) && (tel->NextBox != 0) && (!tel->Redrawn))
- {
- StartObj(ObjCounter);
- Threads.append(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Type /Thread\n");
- PutDoc(" /F "+IToStr(ObjCounter)+" 0 R\n");
- PutDoc(">>\nendobj\n");
- Beads.clear();
- struct Bead bd;
- int fir = ObjCounter;
- int ccb = ObjCounter;
- bd.Parent = ObjCounter-1;
- while (tel->NextBox != 0)
- {
- bd.Next = ccb + 1;
- bd.Prev = ccb - 1;
- ccb++;
- bd.Page = PageTree.Kids[pgs];
- bd.Recht = QRect(static_cast<int>(tel->Xpos), static_cast<int>(doc->PageH - tel->Ypos), static_cast<int>(tel->Width), static_cast<int>(tel->Height));
- tel->Redrawn = true;
- tel = tel->NextBox;
- Beads.append(bd);
- }
- bd.Next = ccb + 1;
- bd.Prev = ccb - 1;
- bd.Page = PageTree.Kids[pgs];
- bd.Recht = QRect(static_cast<int>(tel->Xpos), static_cast<int>(doc->PageH - tel->Ypos), static_cast<int>(tel->Width), static_cast<int>(tel->Height));
- tel->Redrawn = true;
- Beads.append(bd);
- Beads[0].Prev = fir + Beads.count()-1;
- Beads[Beads.count()-1].Next = fir;
- for (uint beac = 0; beac < Beads.count(); ++beac)
- {
- StartObj(ObjCounter);
- ObjCounter++;
- PutDoc("<< /Type /Bead\n");
- PutDoc(" /T "+IToStr(Beads[beac].Parent)+" 0 R\n");
- PutDoc(" /N "+IToStr(Beads[beac].Next)+" 0 R\n");
- PutDoc(" /V "+IToStr(Beads[beac].Prev)+" 0 R\n");
- PutDoc(" /P "+IToStr(Beads[beac].Page)+" 0 R\n");
- PutDoc(" /R [ "+IToStr(Beads[beac].Recht.x())+" "+IToStr(Beads[beac].Recht.y())+" ");
- PutDoc(IToStr(Beads[beac].Recht.bottomRight().x())+" "+IToStr(Beads[beac].Recht.y()-Beads[beac].Recht.height())+" ]\n");
- PutDoc(">>\nendobj\n");
- }
- }
- }
- }
- for (uint pgs = 0; pgs < view->Pages.count(); ++pgs)
- {
- for (uint ele = 0; ele < view->Pages.at(pgs)->Items.count(); ++ele)
- {
- view->Pages.at(pgs)->Items.at(ele)->Redrawn = false;
- }
- }
- XRef[7] = Dokument;
- PutDoc("8 0 obj\n[");
- for (uint th = 0; th < Threads.count(); ++th)
- {
- PutDoc(IToStr(Threads[th])+" 0 R ");
- }
- PutDoc("]\nendobj\n");
- }
- if (Options->Version == 12)
- {
- StartObj(ObjCounter);
- ObjCounter++;
- QString dataP;
- loadText(PrintPr, &dataP);
- PutDoc("<<\n");
- if ((Options->Compress) && (CompAvail))
- {
- PutDoc("/Filter /FlateDecode\n");
- dataP = CompressStr(&dataP);
- }
- PutDoc("/Length "+IToStr(dataP.length()+1)+"\n");
- PutDoc("/N "+IToStr(Components)+"\n");
- PutDoc(">>\nstream\n"+dataP+"\nendstream\nendobj\n");
- if (Options->Articles)
- {
- XRef[8] = Dokument;
- PutDoc("9 0 obj\n");
- }
- else
- {
- XRef[7] = Dokument;
- PutDoc("8 0 obj\n");
- }
- PutDoc("<<\n/Type /OutputIntent\n/S /GTS_PDFX\n");
- PutDoc("/DestOutputProfile "+IToStr(ObjCounter-1)+" 0 R\n");
- PutDoc("/OutputConditionIdentifier (Custom)\n");
- PutDoc("/Info ("+PDFEncode(Options->Info)+")\n");
- PutDoc("/OutputCondition ("+PDFEncode(Name)+")\n");
- PutDoc(">>\nendobj\n");
- }
- StX = Dokument;
- PutDoc("xref\n");
- PutDoc("0 "+IToStr(ObjCounter)+"\n");
- PutDoc("0000000000 65535 f \n");
- for (uint a = 0; a < XRef.count(); ++a)
- {
- tmp.sprintf("%10d", XRef[a]);
- tmp.replace(QRegExp(" "), "0");
- PutDoc(tmp+" 00000 n \n");
- }
- PutDoc("trailer\n<<\n/Size "+IToStr(XRef.count()+1)+"\n");
- QString IDs ="";
- for (uint cl = 0; cl < 16; ++cl)
- {
- IDs += FileID[cl];
- }
- IDs = String2Hex(&IDs);
- PutDoc("/Root 1 0 R\n/Info 2 0 R\n/ID [<"+IDs+"><"+IDs+">]\n");
- if (Options->Encrypt)
- PutDoc("/Encrypt "+IToStr(Encrypt)+" 0 R\n");
- PutDoc(">>\nstartxref\n");
- PutDoc(IToStr(StX)+"\n%%EOF\n");
- Spool.close();
-}
-
/Scribus/Scribus/scribus/libpdf/pdflib.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/picstatus.cpp
===================================================================
--- Scribus/Scribus/scribus/picstatus.cpp (revision 6)
+++ Scribus/Scribus/scribus/picstatus.cpp (nonexistent)
@@ -1,288 +0,0 @@
-/***************************************************************************
- picstatus.cpp - description
- -------------------
- begin : Fri Nov 29 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 "picstatus.h"
-#include "picstatus.moc"
-#include <qfileinfo.h>
-#include <qfiledialog.h>
-#include <qtoolbutton.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
-#include <cstdio>
-#include "picsearch.h"
-extern QPixmap loadIcon(QString nam);
-
-PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi)
- : QDialog( parent, "pic", true, 0 )
-{
- uint p, i;
- QString tmp;
- setCaption( tr( "Pictures" ) );
- setIcon(loadIcon("AppIcon.xpm"));
- doc = docu;
- view = viewi;
- ItemNrs.clear();
- FlagsPic.clear();
- PicStatusLayout = new QVBoxLayout( this );
- PicStatusLayout->setSpacing( 6 );
- PicStatusLayout->setMargin( 11 );
-
- PicTable = new QTable( this, "PicTable" );
- PicTable->setLeftMargin(0);
- PicTable->verticalHeader()->hide();
- PicTable->setNumCols( 7 );
- Header = PicTable->horizontalHeader();
- Header->setLabel(0, tr("Name"));
- Header->setLabel(1, tr("Path"));
- Header->setLabel(2, tr("Page"));
- Header->setLabel(3, tr(" "));
- Header->setLabel(4, tr("Print"));
- Header->setLabel(5, tr("Status"));
- Header->setLabel(6, tr(" "));
- Zeilen = 0;
- for (p=0; p<view->MasterPages.count(); p++)
- {
- for (i=0; i<view->MasterPages.at(p)->Items.count(); i++)
- {
- if (view->MasterPages.at(p)->Items.at(i)->PType == 2)
- {
- Zeilen++;
- ItemNrs.append(i);
- }
- }
- }
- for (p=0; p<view->Pages.count(); p++)
- {
- for (i=0; i<view->Pages.at(p)->Items.count(); i++)
- {
- if (view->Pages.at(p)->Items.at(i)->PType == 2)
- {
- Zeilen++;
- ItemNrs.append(i);
- }
- }
- }
- PicTable->setNumRows(Zeilen);
- int Zeilen2 = 0;
- for (p=0; p<view->MasterPages.count(); p++)
- {
- for (i=0; i<view->MasterPages.at(p)->Items.count(); i++)
- {
- if (view->MasterPages.at(p)->Items.at(i)->PType == 2)
- {
- QFileInfo fi = QFileInfo(view->MasterPages.at(p)->Items.at(i)->Pfile);
- PicTable->setText(Zeilen2, 0, fi.fileName());
- PicTable->setText(Zeilen2, 1, fi.dirPath());
- PicTable->setText(Zeilen2, 2, tmp.setNum(p+1));
- QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
- tb2->setText(tr("Goto"));
- tb2->setEraseColor(white);
- tb2->setEnabled(false);
- PicTable->setColumnWidth(3, tb2->fontMetrics().width(tr("Goto"))+10);
- PicTable->setCellWidget(Zeilen2, 3, tb2);
- connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
- QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
- cp2->setText(tr("Yes"));
- cp2->setChecked(view->MasterPages.at(p)->Items.at(i)->isPrintable);
- cp2->setEraseColor(white);
- FlagsPic.append(cp2);
- PicTable->setCellWidget(Zeilen2, 4, cp2);
- connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
- if (view->MasterPages.at(p)->Items.at(i)->PicAvail)
- PicTable->setText(Zeilen2, 5, tr("OK"));
- else
- PicTable->setText(Zeilen2, 5, tr("Missing"));
- QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
- tb->setText(tr("Search"));
- PicTable->setColumnWidth(6, tb2->fontMetrics().width(tr("Search"))+10);
- tb->setEraseColor(white);
- PicTable->setCellWidget(Zeilen2, 6, tb);
- connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
- Zeilen2++;
- }
- }
- }
- for (p=0; p<view->Pages.count(); p++)
- {
- for (i=0; i<view->Pages.at(p)->Items.count(); i++)
- {
- if (view->Pages.at(p)->Items.at(i)->PType == 2)
- {
- QFileInfo fi = QFileInfo(view->Pages.at(p)->Items.at(i)->Pfile);
- PicTable->setText(Zeilen2, 0, fi.fileName());
- PicTable->setText(Zeilen2, 1, fi.dirPath());
- PicTable->setText(Zeilen2, 2, tmp.setNum(p+1));
- QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
- tb2->setText(tr("Goto"));
- tb2->setEraseColor(white);
- PicTable->setColumnWidth(3, tb2->fontMetrics().width(tr("Goto"))+10);
- PicTable->setCellWidget(Zeilen2, 3, tb2);
- connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
- QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
- cp2->setText(tr("Yes"));
- cp2->setChecked(view->Pages.at(p)->Items.at(i)->isPrintable);
- cp2->setEraseColor(white);
- FlagsPic.append(cp2);
- PicTable->setCellWidget(Zeilen2, 4, cp2);
- connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
- if (view->Pages.at(p)->Items.at(i)->PicAvail)
- PicTable->setText(Zeilen2, 5, tr("OK"));
- else
- PicTable->setText(Zeilen2, 5, tr("Missing"));
- QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
- tb->setText(tr("Search"));
- PicTable->setColumnWidth(6, tb2->fontMetrics().width(tr("Search"))+10);
- tb->setEraseColor(white);
- PicTable->setCellWidget(Zeilen2, 6, tb);
- connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
- Zeilen2++;
- }
- }
- }
- PicTable->adjustColumn(0);
- PicTable->adjustColumn(1);
- PicTable->adjustColumn(2);
- PicTable->adjustColumn(4);
- PicTable->adjustColumn(5);
- PicTable->setSorting(false);
- PicTable->setSelectionMode(QTable::NoSelection);
- PicTable->setColumnMovingEnabled(false);
- PicTable->setRowMovingEnabled(false);
- Header->setMovingEnabled(false);
- PicStatusLayout->addWidget( PicTable );
-
- Layout2 = new QHBoxLayout;
- Layout2->setSpacing( 6 );
- Layout2->setMargin( 0 );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- Layout2->addItem( spacer );
-
- OkB = new QPushButton( this, "OkB" );
- OkB->setText( tr( "OK" ) );
- Layout2->addWidget( OkB );
- PicStatusLayout->addLayout( Layout2 );
-
- // signals and slots connections
- connect( OkB, SIGNAL( clicked() ), this, SLOT( accept() ) );
-}
-
-void PicStatus::GotoPic()
-{
- emit GotoSeite(PicTable->text(QString(sender()->name()).toInt(), 2).toInt()-1);
-}
-
-void PicStatus::SearchPic()
-{
- uint ZNr = QString(sender()->name()).toUInt();
- uint ItNr = ItemNrs[ZNr];
- uint PgNr = PicTable->text(ZNr, 2).toInt()-1;
- QString BildNam = PicTable->text(ZNr, 0);
- QString OldPfad = PicTable->text(ZNr, 1);
- QStringList Pfade;
- FILE *fp = popen("find /home /cdrom /floppy -name " + BildNam, "r");
- if (fp == NULL)
- return;
- QTextStream ts(fp, IO_ReadOnly);
- QString tmp = ts.read();
- Pfade = QStringList::split("\n", tmp);
- if (Pfade.count() > 1)
- {
- PicSearch *dia = new PicSearch(this, BildNam, Pfade);
- if (dia->exec())
- {
- QString fileName = dia->Bild;
- if (!fileName.isEmpty())
- {
- for (uint zz = 0; zz < uint(Zeilen); zz++)
- {
- if (PicTable->text(zz, 1) == OldPfad)
- {
- PgNr = PicTable->text(zz, 2).toInt()-1;
- ItNr = ItemNrs[zz];
- if (PicTable->cellWidget(zz, 3)->isEnabled())
- {
- view->Pages.at(PgNr)->LoadPict(fileName, ItNr);
- PicTable->setText(zz, 1, view->Pages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
- }
- else
- {
- view->MasterPages.at(PgNr)->LoadPict(fileName, ItNr);
- PicTable->setText(zz, 1, view->MasterPages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->MasterPages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
- }
- }
- }
- view->DrawNew();
- }
- }
- delete dia;
- }
- else
- {
- if (Pfade.count() == 1)
- {
- for (uint zz = 0; zz < uint(Zeilen); zz++)
- {
- if (PicTable->text(zz, 1) == OldPfad)
- {
- PgNr = PicTable->text(zz, 2).toInt()-1;
- ItNr = ItemNrs[zz];
- if (PicTable->cellWidget(zz, 3)->isEnabled())
- {
- view->Pages.at(PgNr)->LoadPict(Pfade[0], ItNr);
- PicTable->setText(zz, 1, view->Pages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->Pages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
- }
- else
- {
- view->MasterPages.at(PgNr)->LoadPict(Pfade[0], ItNr);
- PicTable->setText(zz, 1, view->MasterPages.at(PgNr)->Items.at(ItNr)->Pfile);
- if (view->MasterPages.at(PgNr)->Items.at(ItNr)->PicAvail)
- PicTable->setText(zz, 5, tr("OK"));
- else
- PicTable->setText(zz, 5, tr("Missing"));
- }
- }
- }
- view->DrawNew();
- }
- }
- pclose(fp);
-}
-
-void PicStatus::PrintPic()
-{
- uint ZNr = QString(sender()->name()).toUInt();
- uint ItNr = ItemNrs[ZNr];
- uint PgNr = PicTable->text(ZNr, 2).toInt()-1;
- if (PicTable->cellWidget(ZNr, 3)->isEnabled())
- view->Pages.at(PgNr)->Items.at(ItNr)->isPrintable = FlagsPic.at(ZNr)->isChecked();
- else
- view->MasterPages.at(PgNr)->Items.at(ItNr)->isPrintable = FlagsPic.at(ZNr)->isChecked();
-}
-
-
/Scribus/Scribus/scribus/picstatus.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/libabout/Makefile.am
===================================================================
--- Scribus/Scribus/scribus/libabout/Makefile.am (revision 6)
+++ Scribus/Scribus/scribus/libabout/Makefile.am (nonexistent)
@@ -1,15 +0,0 @@
-libdir = $(prefix)/lib/scribus/libs
-lib_LTLIBRARIES = libabout.la
-
-INCLUDES = $(LIBFREETYPE_CFLAGS) $(all_includes)
-
-libabout_la_LDFLAGS = -version-info 0:0:0
-
-libabout_la_METASOURCES = AUTO
-
-libabout_la_SOURCES = about.cpp
-KDE_OPTIONS = qtonly
-
-EXTRA_DIST = about.cpp about.h
-
-AM_LDFLAGS = -s $(LIBFREETYPE_LIBS)
/Scribus/Scribus/scribus/libabout/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/libabout/about.cpp
===================================================================
--- Scribus/Scribus/scribus/libabout/about.cpp (revision 6)
+++ Scribus/Scribus/scribus/libabout/about.cpp (nonexistent)
@@ -1,156 +0,0 @@
-#include "about.h"
-#include "about.moc"
-#include <qpixmap.h>
-#include "config.h"
-
-extern QPixmap loadIcon(QString nam);
-
-extern "C" void* Run(QWidget *d);
-
-void* Run(QWidget *d)
-{
- About *dia = new About(d);
- return dia;
-}
-
-About::About( QWidget* parent )
- : QDialog( parent, "About", true, 0 )
-{
- setCaption( tr( "About Scribus")+" "+VERSION );
- setIcon(loadIcon("AppIcon.xpm"));
- AboutLayout = new QVBoxLayout( this );
- AboutLayout->setSpacing( 6 );
- AboutLayout->setMargin( 10 );
- TabWidget2 = new QTabWidget( this, "TabWidget2" );
- TabWidget2->setMinimumSize( QSize( 438, 258 ) );
- tab = new QWidget( TabWidget2, "tab" );
- tabLayout1 = new QVBoxLayout( tab );
- tabLayout1->setSpacing( 6 );
- tabLayout1->setMargin( 10 );
- PixmapLabel1 = new QLabel( tab, "PixmapLabel1" );
- PixmapLabel1->setPixmap(loadIcon("scribus_logo.jpg"));
- tabLayout1->addWidget( PixmapLabel1 );
- BuildID = new QLabel( tab, "BB" );
- BuildID->setAlignment(Qt::AlignCenter);
- QString bu;
- bu.sprintf("%s %s ", __TIME__, __DATE__);
-#ifdef HAVE_FREETYPE
- bu += "F";
-#else
- bu += "*";
-#endif
- bu += "-";
-#ifdef HAVE_CMS
- bu += "C";
-#else
- bu += "*";
-#endif
- bu += "-";
-#ifdef HAVE_CUPS
- bu += "C";
-#else
- bu += "*";
-#endif
- bu += "-";
-#ifdef HAVE_TIFF
- bu += "T";
-#else
- bu += "*";
-#endif
-
- BuildID->setText("Scribus Version "+QString(VERSION)+"\nBuild-ID: "+bu);
- tabLayout1->addWidget( BuildID );
- TabWidget2->insertTab( tab, tr( "About" ) );
- tab_2 = new QWidget( TabWidget2, "tab_2" );
- tabLayout = new QHBoxLayout( tab_2 );
- tabLayout->setSpacing( 6 );
- tabLayout->setMargin( 10 );
- TextView1 = new QTextView( tab_2, "TextView1" );
- TextView1->setText( "<table><tr><td><b>" + tr("Programming:") + "</b></td><td> </td></tr>" +
- "<tr><td>Franz Schmid</td><td>Franz.Schmid@altmuehlnet.de</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Contributions from:") + "</b></td><td></td></tr>" +
- "<tr><td>Christian Töpp</td><td>mr-ct@gmx.de</td></tr>" +
- "<tr><td>Alastair Robinson</td><td>blackfive@fakenhamweb.co.uk</td></tr>" +
- "<tr><td>Paul Johnson</td><td>paulf.johnson@ukonline.co.uk</td></tr>" +
- "<tr><td></td><td> </td></tr>" +
- "<tr><td><b>" + tr("Documentation:") + "</b></td><td></td></tr>" +
- "<tr><td>Peter Linnell</td><td>scribusdocs@atlantictechsolutions.com</td></tr>" +
- "<tr><td>Yves Ceccone</td><td>yves@yeccoe.org</td></tr>" +
- "<tr><td>Thomas Zastrow</td><td>webmaster@thomas-zastrow.de</td></tr></table>");
- TextView1->setTextFormat( QTextView::RichText );
- tabLayout->addWidget( TextView1 );
- TabWidget2->insertTab( tab_2, tr( "Authors" ) );
- tab_3 = new QWidget( TabWidget2, "tab_3" );
- tabLayout_2 = new QHBoxLayout( tab_3 );
- tabLayout_2->setSpacing( 6 );
- tabLayout_2->setMargin( 10 );
- TextView2 = new QTextView( tab_3, "TextView1_2" );
- TextView2->setText( "<table><tr><td><b>" + tr("German:") + "</b></td><td> </td></tr>" +
- "<tr><td>Franz Schmid</td><td>Franz.Schmid@altmuehlnet.de</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("French:") + "</b></td><td> </td>" +
- "<tr><td>Michel Briand</td><td>michelbriand@free.fr</td></tr>" +
- "<tr><td>Yves Ceccone</td><td>yves@yeccoe.org</td></tr>" +
- "<tr><td>Nicolas Boos</td><td>nicolas.boos@wanadoo.fr</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Spanish and Catalan:") + "</b></td><td> </td></tr>" +
- "<tr><td>Josep Febrer</td><td>josep@linuxmail.org</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Hungarian and Italian:") + "</b></td><td> </td></tr>" +
- "<tr><td>Giovanni Biczó</td><td>gbiczo@freestart.hu</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Ukrainian:") + "</b></td><td> </td></tr>" +
- "<tr><td>Sergiy Kudryk</td><td>kudryk@yahoo.com</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Bulgarian:") + "</b></td><td> </td></tr>" +
- "<tr><td>Vasko Tomanov</td><td>vasko@web.bg</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Galician:") + "</b></td><td> </td></tr>" +
- "<tr><td>Manuel Anxo Rei</td><td>manxopar@avogaciagalega.org</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Turkish:") + "</b></td><td> </td></tr>" +
- "<tr><td>Erkan Kaplan</td><td>Selamsana@uni.de</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Lithuanian:") + "</b></td><td> </td></tr>" +
- "<tr><td>Aivaras Kirejevas</td><td>kiras@mail.lt</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Polish:") + "</b></td><td> </td></tr>" +
- "<tr><td>Maciej Hañski</td><td>m.hanski@gmx.at</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Slovak:") + "</b></td><td></td></tr>" +
- "<tr><td>Zdenko Podobný</td><td>zdpo@mailbox.sk</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("Danish:") + "</b></td><td></td></tr>" +
- "<tr><td>Morten Langlo</td><td>mlanglo@post6.tele.dk</td></tr>" +
- "<tr><td> </td><td> </td></tr>" +
- "<tr><td><b>" + tr("English:") + "</b></td><td></td></tr>" +
- "<tr><td>Paul F. Johnson</td><td>paulf.johnson@ukonline.co.uk</td></tr></table>");
- TextView2->setTextFormat( QTextView::RichText );
- tabLayout_2->addWidget( TextView2 );
- TabWidget2->insertTab( tab_3, tr( "Translations" ) );
- AboutLayout->addWidget( TabWidget2 );
- Layout2 = new QHBoxLayout;
- Layout2->setSpacing( 6 );
- Layout2->setMargin( 0 );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- Layout2->addItem( spacer );
- PushButton1 = new QPushButton( this, "PushButton1" );
- PushButton1->setText( tr( "Close" ) );
- PushButton1->setDefault( true );
- Layout2->addWidget( PushButton1 );
- AboutLayout->addLayout( Layout2 );
- setMaximumSize(sizeHint());
-
- // signals and slots connections
- connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) );
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-About::~About()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
/Scribus/Scribus/scribus/libabout/about.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/libabout/about.h
===================================================================
--- Scribus/Scribus/scribus/libabout/about.h (revision 6)
+++ Scribus/Scribus/scribus/libabout/about.h (nonexistent)
@@ -1,39 +0,0 @@
-#ifndef ABOUT_H
-#define ABOUT_H
-
-#include <qdialog.h>
-#include <qlabel.h>
-#include <qtabwidget.h>
-#include <qwidget.h>
-#include <qtextview.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-
-class About : public QDialog
-{
- Q_OBJECT
-
-public:
- About( QWidget* parent );
- ~About();
-
- QLabel* PixmapLabel1;
- QLabel* BuildID;
- QPushButton* PushButton1;
- QTabWidget* TabWidget2;
- QWidget* tab;
- QWidget* tab_2;
- QWidget* tab_3;
- QTextView* TextView1;
- QTextView* TextView2;
-
-protected:
- QVBoxLayout* AboutLayout;
- QHBoxLayout* tabLayout;
- QVBoxLayout* tabLayout1;
- QHBoxLayout* tabLayout_2;
- QHBoxLayout* Layout2;
-
-};
-
-#endif // ABOUT_H
/Scribus/Scribus/scribus/libabout/about.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/fmitem.cpp
===================================================================
--- Scribus/Scribus/scribus/fmitem.cpp (revision 6)
+++ Scribus/Scribus/scribus/fmitem.cpp (nonexistent)
@@ -1,38 +0,0 @@
-/***************************************************************************
- fmitem.cpp - 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. *
- * *
- ***************************************************************************/
-
-#include "fmitem.h"
-#include <qfontmetrics.h>
-#include <qapplication.h>
-
-FmItem::FmItem(const QString& s, const QFont& f)
-{
- string = s;
- font = f;
- font.setPointSize(qApp->font().pointSize());
-}
-
-void FmItem::paint(QPainter *p, const QColorGroup&, bool, bool, int x, int y, int w, int h)
-{
- p->setFont(font);
- p->drawText(x, y, w, h, AlignLeft | AlignVCenter | ShowPrefix | DontClip, string);
-}
-
-QSize FmItem::sizeHint()
-{
- return QFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip, string);
-}
/Scribus/Scribus/scribus/fmitem.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/newtemp.h
===================================================================
--- Scribus/Scribus/scribus/newtemp.h (revision 6)
+++ Scribus/Scribus/scribus/newtemp.h (nonexistent)
@@ -1,40 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'Query.ui'
-**
-** Created: Mon Apr 23 20:48:47 2001
-** by: The User Interface Compiler (uic)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-#ifndef QUERY_H
-#define QUERY_H
-
-#include <qdialog.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include "scribusdoc.h"
-
-class NewTm : public QDialog
-{
-
-public:
- NewTm( QWidget* parent, QString text, QString titel, ScribusDoc *doc );
- ~NewTm() {};
-
- QPushButton* PushButton1;
- QPushButton* PushButton2;
- QLineEdit* Answer;
- QLabel* Frage;
- QComboBox* Links;
-
-protected:
- QVBoxLayout* QueryLayout;
- QHBoxLayout* Layout3;
- QHBoxLayout* Layout2;
- QHBoxLayout* Layout1;
-};
-
-#endif // QUERY_H
/Scribus/Scribus/scribus/newtemp.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/buttonicon.h
===================================================================
--- Scribus/Scribus/scribus/buttonicon.h (revision 6)
+++ Scribus/Scribus/scribus/buttonicon.h (nonexistent)
@@ -1,56 +0,0 @@
-#ifndef BUTTONICON_H
-#define BUTTONICON_H
-
-#include <qdialog.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include "pageitem.h"
-
-class ButtonIcon : public QDialog
-{
- Q_OBJECT
-
-public:
- ButtonIcon(QWidget* parent, PageItem* ite);
- ~ButtonIcon() {};
-
- QLabel* TextLabel1_2;
- QComboBox* Place;
- QLabel* TextLabel1;
- QComboBox* ScaleW;
- QLabel* TextLabel2;
- QComboBox* ScaleH;
- QGroupBox* GroupButton;
- QLabel* TextLabel3;
- QSlider* SliderX;
- QSlider* SliderY;
- QPushButton* OK;
- QPushButton* Cancel;
- QPushButton* Reset;
- PageItem* Item;
- int IcPlace;
- int IcScaleW;
- int IcScaleH;
- float IcPlaceX;
- float IcPlaceY;
-
-private slots:
- void MoveIconY(int y);
- void MoveIconX(int x);
- void SetAllVals();
- void SetScaleHow(int s);
-
-protected:
- QVBoxLayout* ButtonIconLayout;
- QGridLayout* Layout1;
- QHBoxLayout* Layout5;
- QGridLayout* Layout3;
- QHBoxLayout* Layout4;
-};
-
-#endif // BUTTONICON_H
/Scribus/Scribus/scribus/buttonicon.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-10ps.enc
===================================================================
--- Scribus/Scribus/scribus/iso8859-10ps.enc (revision 6)
+++ Scribus/Scribus/scribus/iso8859-10ps.enc (nonexistent)
@@ -1,96 +0,0 @@
-16#A0 /space
-16#A1 /Aogonek
-16#A2 /Emacron
-16#A3 /Gcedilla
-16#A4 /Imacron
-16#A5 /Itilde
-16#A6 /Kcedilla
-16#A7 /Lcedilla
-16#A8 /acute
-16#A9 /Rcedilla
-16#AA /Scaron
-16#AB /Tbar
-16#AC /Zcaron
-16#AD /hyphen
-16#AE /kra
-16#AF /Eng
-16#B0 /Dbar
-16#B1 /aogonek
-16#B2 /emacron
-16#B3 /gcedilla
-16#B4 /imacron
-16#B5 /itilde
-16#B6 /kcedilla
-16#B7 /lcedilla
-16#B8 /nacute
-16#B9 /rcedilla
-16#BA /scaron
-16#BB /tbar
-16#BC /zcaron
-16#BD /section
-16#BE /germandbls
-16#BF /eng
-16#C0 /Amacron
-16#C1 /Aacute
-16#C2 /Acircumflex
-16#C3 /Atilde
-16#C4 /Adieresis
-16#C5 /Aring
-16#C6 /AE
-16#C7 /Iogonek
-16#C8 /Ccaron
-16#C9 /Eacute
-16#CA /Eogonek
-16#CB /Edieresis
-16#CC /Edotaccent
-16#CD /Iacute
-16#CE /Icircumflex
-16#CF /Idieresis
-16#D0 /Dbar
-16#D1 /Ncedilla
-16#D2 /Omacron
-16#D3 /Oacute
-16#D4 /Ocircumflex
-16#D5 /Otilde
-16#D6 /Odieresis
-16#D7 /Utilde
-16#D8 /Oslash
-16#D9 /Uogonek
-16#DA /Uacute
-16#DB /Ucircumflex
-16#DC /Udieresis
-16#DD /Yacute
-16#DE /Thorn
-16#DF /Umacron
-16#E0 /amacron
-16#E1 /aacute
-16#E2 /acircumflex
-16#E3 /atilde
-16#E4 /adieresis
-16#E5 /aring
-16#E6 /ae
-16#E7 /iogonek
-16#E8 /ccaron
-16#E9 /eacute
-16#EA /eogonek
-16#EB /edieresis
-16#EC /edotaccent
-16#ED /iacute
-16#EE /icircumflex
-16#EF /idieresis
-16#F0 /eth
-16#F1 /ncedilla
-16#F2 /omacron
-16#F3 /oacute
-16#F4 /ocircumflex
-16#F5 /otilde
-16#F6 /odieresis
-16#F7 /utilde
-16#F8 /oslash
-16#F9 /uogonek
-16#FA /uacute
-16#FB /ucircumflex
-16#FC /udieresis
-16#FD /yacute
-16#FE /thorn
-16#FF /umacron
/Scribus/Scribus/scribus/iso8859-10ps.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/newfile.h
===================================================================
--- Scribus/Scribus/scribus/newfile.h (revision 6)
+++ Scribus/Scribus/scribus/newfile.h (nonexistent)
@@ -1,103 +0,0 @@
-#ifndef NEWDOC_H
-#define NEWDOC_H
-
-#include <qdialog.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include "mspinbox.h"
-#include "scribusdoc.h"
-
-class NewDoc : public QDialog
-{
- Q_OBJECT
-
-public:
- NewDoc( QWidget* parent, preV *Vor );
- ~NewDoc() {};
-
- QButtonGroup* ButtonGroup1_2;
- QGroupBox* GroupBox7;
- QGroupBox* GroupBox3;
- QGroupBox* GroupBox4;
- QLabel* TextLabel1;
- QLabel* TextLabel2;
- QLabel* TextLabel3;
- QLabel* TextLabel4;
- QLabel* TextLabel5;
- QLabel* TextLabel6;
- QLabel* TextLabel7;
- QLabel* TextLabel8;
- QLabel* TextLabel1_2;
- QLabel* TextLabel1_3;
- QLabel* TextLabel2_2;
- QLabel* TextLabel2_3;
- QComboBox* ComboBox1;
- QComboBox* ComboBox2;
- QComboBox* ComboBox3;
- QCheckBox* Doppelseiten;
- QCheckBox* ErsteSeite;
- QCheckBox* AutoFrame;
- MSpinBox* TopR;
- MSpinBox* BottomR;
- MSpinBox* LeftR;
- MSpinBox* RightR;
- MSpinBox* Distance;
- QSpinBox* SpinBox10;
- QSpinBox* PgNr;
- MSpinBox* Breite;
- MSpinBox* Hoehe;
- QPushButton* OKButton;
- QPushButton* CancelB;
- float Umrech;
- int Orient;
- float Pagebr;
- float Pageho;
- float Top;
- float Bottom;
- float Left;
- float Right;
- float Dist;
- QString ein;
- int einheit;
- void setSize(int gr);
-
-public slots:
- void setTop(int v);
- void setBottom(int v);
- void setLeft(int v);
- void setRight(int v);
- void setDist(int v);
- void setUnit(int u);
- void ExitOK();
- void setOrien(int ori);
- void setPGsize();
- void setDS();
- void setAT();
-
-protected:
- QGridLayout* Layout4;
- QGridLayout* Layout3;
- QHBoxLayout* NewDocLayout;
- QVBoxLayout* Layout9;
- QVBoxLayout* ButtonGroup1_2Layout;
- QGridLayout* Layout6;
- QHBoxLayout* Layout5;
- QHBoxLayout* Layout8;
- QHBoxLayout* GroupBox7Layout;
- QVBoxLayout* Layout10;
- QGridLayout* GroupBox3Layout;
- QHBoxLayout* GroupBox4Layout;
- QGridLayout* Layout2;
- QHBoxLayout* Layout1;
-
-};
-
-#endif // NEWDOC_H
/Scribus/Scribus/scribus/newfile.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/navigator.h
===================================================================
--- Scribus/Scribus/scribus/navigator.h (revision 6)
+++ Scribus/Scribus/scribus/navigator.h (nonexistent)
@@ -1,51 +0,0 @@
-/***************************************************************************
- navigator.h - 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. *
- * *
- ***************************************************************************/
-
-#ifndef NAVIGATOR_H
-#define NAVIGATOR_H
-
-#include <qlabel.h>
-#include <qpixmap.h>
-#include "scribusview.h"
-
-/**
- *@author Franz Schmid
- */
-
-class Navigator : public QLabel {
-
-Q_OBJECT
-
-public:
- Navigator(QWidget *parent, int Size, int Seite, ScribusView* vie);
- ~Navigator() {};
- void mouseMoveEvent(QMouseEvent *m);
- void mousePressEvent(QMouseEvent *m);
- void mouseReleaseEvent(QMouseEvent *m);
- void paintEvent(QPaintEvent *e);
- void drawMark(int x, int y);
- void SetSeite(int Seite, int Size);
- int Xp;
- int Yp;
- ScribusView* view;
- QPixmap pmx;
-
-signals:
- void Coords(float x, float y);
-};
-
-#endif
/Scribus/Scribus/scribus/navigator.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/pageitem.h
===================================================================
--- Scribus/Scribus/scribus/pageitem.h (revision 6)
+++ Scribus/Scribus/scribus/pageitem.h (nonexistent)
@@ -1,243 +0,0 @@
-/***************************************************************************
- pageitem.h - description
- -------------------
- begin : Sat Apr 7 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 PAGEITEM_H
-#define PAGEITEM_H
-
-#include <qobject.h>
-#include <qwidget.h>
-#include <qpointarray.h>
-#include <qptrlist.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qfont.h>
-#include <qvaluestack.h>
-#include <qvaluelist.h>
-#include "scribusdoc.h"
-/**
- *@author Franz Schmid
- */
-
-class PageItem : public QObject {
-
-public:
- PageItem(Page* pa, int art, float x, float y, float w, float h, float w2, QString fill, QString outline, ScribusDoc *doc);
- ~PageItem() {};
- struct ZZ { QString Zeich;
- QColor Farb;
- QFont Zsatz;
- QString ZFo;
- float xco;
- float yco;
- bool Sele;
- int Siz;
- float wide;
- };
- /** Zeichnet das Item */
- void paintObj(QRect e=QRect(), QPixmap *ppX = 0);
- void CopyIt(struct CLBuf *Buffer);
- void SetZeichAttr(QPainter *p, QFont *ffo, struct Pti *hl, int *chs, QString *chx);
- void SetFarbe(QColor *tmp, QString farbe, int shad);
- void DrawZeichen(QPainter *p, struct Pti *hl);
- void DrawZeichen(QPainter *p, struct ZZ *hl);
- void DrawPoly(QPainter *p, QPointArray pts, QColor BackF, bool bitm = false);
- void DrawPolyL(QPainter *p, QPointArray pts);
- QString ExpandToken(uint base);
- bool Locked;
- bool Reverse;
- /** X-Position auf der Seite */
- float Xpos;
- /** Y-Position auf der Seite */
- float Ypos;
- /** Breite des Elements */
- float Width;
- /** Hoehe des Elements */
- float Height;
- /** Eckrundung von Rechtecken */
- float RadRect;
- /** Art des Items */
- int PType;
- /** Winkel um den das Item gedreht wird */
- float Rot;
- /** Enthaelt das uebergeordnete Objekt */
- QWidget *Parent;
- /** Enthaelt das Dokument */
- ScribusDoc *Doc;
- QString GrColor;
- QString GrColor2;
- int GrShade;
- int GrShade2;
- int GrType;
- /** Fuellfarbe */
- QString Pcolor;
- /** Abstufung fuer Füllfarbe */
- int Shade;
- /** Zeichenfarbe fuer Elemente */
- QString Pcolor2;
- /** Abstufung fuer Zeichenfarbe */
- int Shade2;
- /** Strichstaerke */
- float Pwidth;
- /** Linienart */
- PenStyle PLineArt;
- PenCapStyle PLineEnd;
- PenJoinStyle PLineJoin;
- /** Element selektiert Ja/Nein */
- bool Select;
- /** Definiert die Clipping-Region des Elements; */
- QPointArray Clip;
- FPointArray PoLine;
- QValueList<uint> Segments;
- bool PoShow;
- float BaseOffs;
- bool ClipEdited;
- int FrameType;
- /** Interne Item-Nummer */
- uint ItemNr;
- /** Hat Element Rahmen? */
- bool Frame;
- /** Seite zu der das Element gehoert */
- Page *OwnPage;
- /** Darzustellendes Bild */
- QImage pixm;
-// QPixmap pixm;
- /** Dateiname des Bildes */
- QString Pfile;
- QString Pfile2;
- QString Pfile3;
- QString IProfile;
- bool UseEmbedded;
- QString EmProfile;
- int IRender;
- /** Darstellungsart Bild/Titel */
- bool PicArt;
- /** Bild verfuegbar */
- bool PicAvail;
- /** Lokales Scaling x*/
- float LocalScX;
- float LocalViewX;
- /** Lokales Scaling y*/
- float LocalScY;
- float LocalViewY;
- /** Lokales X */
- float LocalX;
- /** Lokales Y */
- float LocalY;
- int OrigW;
- int OrigH;
- /** Anzahl horizontaler Spiegelungen */
- int flippedH;
- /** Anzahl vertikaler Spiegelungen */
- int flippedV;
- /** BoundigBox-X */
- float BBoxX;
- /** BoundingBox-H */
- float BBoxH;
- /** Extra Abstand vom Rand */
- float Extra;
- float TExtra;
- float BExtra;
- float RExtra;
- /** Linespacing */
- float LineSp;
- /** Zeichen X-Position */
- float CurX;
- /** Zeichen Y-Position */
- float CurY;
- /** Cursorposition */
- int CPos;
- /** Text des Elements */
- QPtrList<Pti> Ptext;
- /** Flag ob Element gedruckt wird */
- bool isPrintable;
- /** Flag fuer PDF-Bookmark */
- bool isBookmark;
- int BMnr;
- /** Flag fuer PDF-Annotation */
- bool isAnnotation;
- int AnType;
- int AnActType;
- QString AnAction;
- QString An_E_act;
- QString An_X_act;
- QString An_D_act;
- QString An_Fo_act;
- QString An_Bl_act;
- QString An_K_act;
- QString An_F_act;
- QString An_V_act;
- QString An_C_act;
- QString AnName;
- QString AnToolTip;
- QString AnRollOver;
- QString AnDown;
- QString AnBColor;
- int AnBsty;
- int AnBwid;
- int AnFeed;
- int AnZiel;
- int AnFlag;
- int AnMaxChar;
- int AnVis;
- int AnChkStil;
- int AnFont;
- bool AnIsChk;
- bool AnAAact;
- bool AnHTML;
- bool AnUseIcons;
- int AnIPlace;
- int AnScaleW;
- int AnFormat;
- /** Flag fuer neuzeichnen im EditMode */
- bool Dirty;
- /** Item Font */
- QString IFont;
- /** Item Fontgroesse */
- int ISize;
- /** Flag fuer Auswahl */
- bool HasSel;
- /** Flag fuer Textfluss */
- bool Textflow;
- bool FrameOnly;
- PageItem *BackBox;
- PageItem *NextBox;
- int NextIt;
- int NextPg;
- bool Tinput;
- bool isAutoText;
- int Ausrich;
- uint MaxChars;
- bool Redrawn;
- float ExtraV;
- bool isRaster;
- float OldB;
- float OldH;
- float OldB2;
- float OldH2;
- bool Sizing;
- bool toPixmap;
- float DevRes;
- int DevResX;
- int DevResY;
- int LayerNr;
- bool ScaleType;
- bool AspectRatio;
- float Transparency;
- QValueStack<int> Groups;
-};
-
-#endif
/Scribus/Scribus/scribus/pageitem.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/scribusdoc.cpp
===================================================================
--- Scribus/Scribus/scribus/scribusdoc.cpp (revision 6)
+++ Scribus/Scribus/scribus/scribusdoc.cpp (nonexistent)
@@ -1,211 +0,0 @@
-/***************************************************************************
- scribusdoc.cpp - description
- -------------------
- begin : Fre Apr 6 21:47:55 CEST 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 "scribusdoc.h"
-#include <qfile.h>
-
-ScribusDoc::ScribusDoc()
-{
- modified = false;
- MasterP = false;
- Marks = true;
- Guides = true;
- GuideLock = false;
- SnapGuides = false;
- ShowPic = true;
- Raster = false;
- useRaster = false;
- EditClip = false;
- EditClipMode = 0;
- loading = false;
- minorGrid = 20;
- majorGrid = 100;
- minorColor = QColor(green);
- majorColor = QColor(green);
- guideColor = QColor(darkBlue);
- GuideRad = 10;
- Scale = 1.0;
- Dpen = "Black";
- Dshade2 = 100;
- Dbrush = "Black";
- Dshade = 100;
- Dwidth = 1;
- DLineArt = SolidLine;
- DocName = "Document-";
- UsedFonts.clear();
- Dfont = "";
- Dsize = 12;
- CurrentSel = -1;
- DocTitel = "";
- DocAutor = "";
- DocComments = "";
- PageC = 0;
- LastAuto = 0;
- FirstAuto = 0;
- DraggedElem = 0;
- GroupCounter = 1;
- Vorlagen.clear();
- struct StVorL vg;
- vg.Vname = "Normal Internal";
- vg.LineSpa = 15;
- vg.Ausri = 0;
- vg.Indent = 0;
- vg.First = 0;
- vg.Avor = 0;
- vg.Anach = 0;
- vg.Font = "";
- vg.FontSize = Dsize;
- Vorlagen.append(vg);
- vg.Vname = "Center Internal";
- vg.Ausri = 1;
- Vorlagen.append(vg);
- vg.Vname = "Rechts Internal";
- vg.Ausri = 2;
- Vorlagen.append(vg);
- vg.Vname = "Block Internal";
- vg.Ausri = 3;
- Vorlagen.append(vg);
- vg.Vname = "EBlock Internal";
- vg.Ausri = 4;
- Vorlagen.append(vg);
- Layers.clear();
- struct Layer ll;
- ll.LNr = 0;
- ll.Level = 0;
- ll.Name = tr("Background");
- ll.Sichtbar = true;
- ll.Drucken = true;
- Layers.append(ll);
- ActiveLayer = 0;
- JavaScripts.clear();
- UnDoValid = false;
- UnData.UnCode = -1;
- CurrentStyle = 0;
- CurrentABStil = 0;
- TotalItems = 0;
- TemplateMode = false;
- PDF_Optionen.Thumbnails = false;
- PDF_Optionen.Articles = false;
- PDF_Optionen.Compress = true;
- PDF_Optionen.RecalcPic = false;
- PDF_Optionen.Bookmarks = false;
- PDF_Optionen.PicRes = 300;
- PDF_Optionen.Version = 13;
- PDF_Optionen.Resolution = 300;
- PDF_Optionen.Binding = 0;
- PDF_Optionen.EmbedList.clear();
- PDF_Optionen.PresentMode = false;
- PDF_Optionen.Datei = "";
- PDF_Optionen.PresentVals.clear();
- PDF_Optionen.UseRGB = false;
- PDF_Optionen.UseProfiles = false;
- PDF_Optionen.UseProfiles2 = false;
- PDF_Optionen.SolidProf = "";
- PDF_Optionen.SComp = 3;
- PDF_Optionen.ImageProf = "";
- PDF_Optionen.PrintProf = "";
- PDF_Optionen.Info = "";
- PDF_Optionen.Intent = 0;
- PDF_Optionen.Intent2 = 0;
- PDF_Optionen.BleedTop = 0;
- PDF_Optionen.BleedLeft = 0;
- PDF_Optionen.BleedRight = 0;
- PDF_Optionen.BleedBottom = 0;
- PDF_Optionen.EmbeddedI = false;
- PDF_Optionen.Encrypt = false;
- PDF_Optionen.PassOwner = "";
- PDF_Optionen.PassUser = "";
- PDF_Optionen.Permissions = -4;
- RePos = false;
- BookMarks.clear();
- OldBM = false;
- hasName = false;
- RotMode = 0;
- ASaveTimer = new QTimer(this);
-#ifdef HAVE_FREETYPE
- FT_Init_FreeType( &library );
-#endif
-}
-
-ScribusDoc::~ScribusDoc()
-{
-#ifdef HAVE_FREETYPE
- FT_Done_FreeType( library );
-#endif
-}
-
-void ScribusDoc::setModified()
-{
- modified = true;
-}
-
-void ScribusDoc::setUnModified()
-{
- modified = false;
-}
-
-bool ScribusDoc::isModified() const
-{
- return modified;
-}
-/** Setzt die Seitenattribute */
-void ScribusDoc::setPage(float b, float h, float t, float l, float r, float bo, float sp, float ab, bool atf, bool fp)
-{
- PageB = b;
- PageH = h;
- PageM.Top = t;
- PageM.Left = l;
- PageM.Right = r;
- PageM.Bottom = bo;
- PageSp = sp;
- PageSpa = ab;
- PageFP = fp;
- PageAT = atf;
-}
-
-void ScribusDoc::resetPage(float t, float l, float r, float bo, bool fp)
-{
- PageM.Top = t;
- PageM.Left = l;
- PageM.Right = r;
- PageM.Bottom = bo;
- PageFP = fp;
-}
-
-void ScribusDoc::AddFont(QString name, QFont fo)
-{
-#ifdef HAVE_FREETYPE
- FT_Face face;
- FT_New_Face( library, (*AllFonts)[name]->Datei, 0, &face );
- FFonts[name] = face;
-#endif
- UsedFonts[name] = fo;
- (*AllFonts)[name]->ReadMetrics();
- (*AllFonts)[name]->CharWidth[13] = 0;
-#ifdef HAVE_FREETYPE
- QString afnm = (*AllFonts)[name]->Datei.left((*AllFonts)[name]->Datei.length()-3);
- QFile afm(afnm+"afm");
- if(!(afm.exists()))
- {
- afm.setName(afnm+"Afm");
- if(!(afm.exists()))
- afm.setName(afnm+"AFM");
- }
- if (afm.exists())
- FT_Attach_File(face, afm.name());
-#endif
-}
/Scribus/Scribus/scribus/scribusdoc.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/.directory
===================================================================
--- Scribus/Scribus/scribus/.directory (revision 6)
+++ Scribus/Scribus/scribus/.directory (nonexistent)
@@ -1,971 +0,0 @@
-[IconPosition::CVS]
-X=28
-Y=5
-
-[IconPosition::ISOenc.txt]
-X=363
-Y=1298
-
-[IconPosition::Makefile]
-X=281
-Y=1442
-
-[IconPosition::Makefile.am]
-X=359
-Y=1442
-
-[IconPosition::Makefile.in]
-X=14
-Y=1499
-
-[IconPosition::Stdenc.txt]
-X=278
-Y=3077
-
-[IconPosition::TTFenc.txt]
-X=276
-Y=3134
-
-[IconPosition::align.cpp]
-X=279
-Y=62
-
-[IconPosition::align.h]
-X=373
-Y=62
-
-[IconPosition::align.moc]
-X=17
-Y=119
-
-[IconPosition::align.o]
-X=112
-Y=121
-
-[IconPosition::applytemplate.cpp]
-X=183
-Y=119
-
-[IconPosition::applytemplate.h]
-X=270
-Y=119
-
-[IconPosition::applytemplate.moc]
-X=357
-Y=119
-
-[IconPosition::applytemplate.o]
-X=9
-Y=193
-
-[IconPosition::cmykcolor.cpp]
-X=94
-Y=191
-
-[IconPosition::cmykcolor.h]
-X=184
-Y=191
-
-[IconPosition::cmykcolor.o]
-X=271
-Y=193
-
-[IconPosition::cmykfw.cpp]
-X=359
-Y=191
-
-[IconPosition::cmykfw.h]
-X=18
-Y=263
-
-[IconPosition::cmykfw.moc]
-X=97
-Y=263
-
-[IconPosition::cmykfw.o]
-X=192
-Y=265
-
-[IconPosition::colorchart.cpp]
-X=268
-Y=263
-
-[IconPosition::colorchart.h]
-X=359
-Y=263
-
-[IconPosition::colorchart.moc]
-X=6
-Y=335
-
-[IconPosition::colorchart.o]
-X=98
-Y=337
-
-[IconPosition::colorm.cpp]
-X=187
-Y=335
-
-[IconPosition::colorm.h]
-X=281
-Y=335
-
-[IconPosition::colorm.moc]
-X=360
-Y=335
-
-[IconPosition::colorm.o]
-X=20
-Y=409
-
-[IconPosition::cpalette.cpp]
-X=97
-Y=407
-
-[IconPosition::cpalette.h]
-X=191
-Y=407
-
-[IconPosition::cpalette.moc]
-X=270
-Y=407
-
-[IconPosition::cpalette.o]
-X=365
-Y=409
-
-[IconPosition::customfdialog.cpp]
-X=6
-Y=479
-
-[IconPosition::customfdialog.h]
-X=93
-Y=479
-
-[IconPosition::customfdialog.moc]
-X=180
-Y=479
-
-[IconPosition::customfdialog.moc.cpp]
-X=267
-Y=479
-
-[IconPosition::customfdialog.o]
-X=354
-Y=481
-
-[IconPosition::dcolor.cpp]
-X=14
-Y=551
-
-[IconPosition::dcolor.h]
-X=108
-Y=551
-
-[IconPosition::dcolor.moc]
-X=187
-Y=551
-
-[IconPosition::dcolor.o]
-X=282
-Y=553
-
-[IconPosition::delpages.cpp]
-X=354
-Y=551
-
-[IconPosition::delpages.h]
-X=13
-Y=608
-
-[IconPosition::delpages.moc]
-X=96
-Y=608
-
-[IconPosition::delpages.o]
-X=187
-Y=610
-
-[IconPosition::docinfo.cpp]
-X=272
-Y=608
-
-[IconPosition::docinfo.h]
-X=366
-Y=608
-
-[IconPosition::docinfo.o]
-X=18
-Y=682
-
-[IconPosition::docs]
-X=115
-Y=5
-
-[IconPosition::druck.cpp]
-X=103
-Y=680
-
-[IconPosition::druck.h]
-X=197
-Y=680
-
-[IconPosition::druck.moc]
-X=276
-Y=680
-
-[IconPosition::druck.o]
-X=371
-Y=682
-
-[IconPosition::edit1format.cpp]
-X=9
-Y=752
-
-[IconPosition::edit1format.h]
-X=96
-Y=752
-
-[IconPosition::edit1format.moc]
-X=182
-Y=752
-
-[IconPosition::edit1format.o]
-X=270
-Y=754
-
-[IconPosition::editformats.cpp]
-X=354
-Y=752
-
-[IconPosition::editformats.h]
-X=9
-Y=824
-
-[IconPosition::editformats.moc]
-X=95
-Y=824
-
-[IconPosition::editformats.o]
-X=183
-Y=826
-
-[IconPosition::fmitem.cpp]
-X=276
-Y=824
-
-[IconPosition::fmitem.h]
-X=370
-Y=824
-
-[IconPosition::fmitem.o]
-X=22
-Y=898
-
-[IconPosition::fontprefs.cpp]
-X=95
-Y=896
-
-[IconPosition::fontprefs.h]
-X=189
-Y=896
-
-[IconPosition::fontprefs.o]
-X=276
-Y=898
-
-[IconPosition::fpalettev.cpp]
-X=356
-Y=896
-
-[IconPosition::fpalettev.h]
-X=15
-Y=953
-
-[IconPosition::fpalettev.moc]
-X=94
-Y=953
-
-[IconPosition::fpalettev.o]
-X=189
-Y=955
-
-[IconPosition::frameedit.cpp]
-X=268
-Y=953
-
-[IconPosition::frameedit.h]
-X=362
-Y=953
-
-[IconPosition::frameedit.moc]
-X=6
-Y=1010
-
-[IconPosition::frameedit.o]
-X=101
-Y=1012
-
-[IconPosition::helpbrowser.cpp]
-X=182
-Y=1010
-
-[IconPosition::helpbrowser.h]
-X=269
-Y=1010
-
-[IconPosition::helpbrowser.moc]
-X=356
-Y=1010
-
-[IconPosition::helpbrowser.o]
-X=8
-Y=1084
-
-[IconPosition::hruler.cpp]
-X=103
-Y=1082
-
-[IconPosition::hruler.h]
-X=197
-Y=1082
-
-[IconPosition::hruler.moc]
-X=276
-Y=1082
-
-[IconPosition::hruler.o]
-X=371
-Y=1084
-
-[IconPosition::iconmenubutton.cpp]
-X=7
-Y=1154
-
-[IconPosition::iconmenubutton.h]
-X=94
-Y=1154
-
-[IconPosition::iconmenubutton.o]
-X=181
-Y=1156
-
-[IconPosition::icons]
-X=202
-Y=5
-
-[IconPosition::icons2.h]
-X=281
-Y=1154
-
-[IconPosition::icons4a.h]
-X=365
-Y=1154
-
-[IconPosition::icons5.h]
-X=20
-Y=1226
-
-[IconPosition::icons6.h]
-X=107
-Y=1226
-
-[IconPosition::icontbutton.cpp]
-X=182
-Y=1226
-
-[IconPosition::icontbutton.h]
-X=269
-Y=1226
-
-[IconPosition::icontbutton.o]
-X=356
-Y=1228
-
-[IconPosition::inspage.cpp]
-X=10
-Y=1298
-
-[IconPosition::inspage.h]
-X=104
-Y=1298
-
-[IconPosition::inspage.moc]
-X=183
-Y=1298
-
-[IconPosition::inspage.o]
-X=278
-Y=1300
-
-[IconPosition::libabout]
-X=283
-Y=5
-
-[IconPosition::libpostscript]
-X=359
-Y=5
-
-[IconPosition::libprefs]
-X=24
-Y=62
-
-[IconPosition::linecombo.cpp]
-X=7
-Y=1370
-
-[IconPosition::linecombo.h]
-X=97
-Y=1370
-
-[IconPosition::linecombo.o]
-X=184
-Y=1372
-
-[IconPosition::linkbutton.cpp]
-X=270
-Y=1370
-
-[IconPosition::linkbutton.h]
-X=360
-Y=1370
-
-[IconPosition::linkbutton.o]
-X=12
-Y=1444
-
-[IconPosition::main.cpp]
-X=106
-Y=1442
-
-[IconPosition::main.o]
-X=200
-Y=1444
-
-[IconPosition::mdup.cpp]
-X=104
-Y=1499
-
-[IconPosition::mdup.h]
-X=198
-Y=1499
-
-[IconPosition::mdup.o]
-X=285
-Y=1501
-
-[IconPosition::missing.cpp]
-X=359
-Y=1499
-
-[IconPosition::missing.h]
-X=18
-Y=1556
-
-[IconPosition::missing.moc]
-X=97
-Y=1556
-
-[IconPosition::missing.o]
-X=192
-Y=1558
-
-[IconPosition::modify.cpp]
-X=275
-Y=1556
-
-[IconPosition::modify.h]
-X=369
-Y=1556
-
-[IconPosition::modify.moc]
-X=13
-Y=1613
-
-[IconPosition::modify.o]
-X=108
-Y=1615
-
-[IconPosition::movepage.cpp]
-X=180
-Y=1613
-
-[IconPosition::movepage.h]
-X=271
-Y=1613
-
-[IconPosition::movepage.moc]
-X=357
-Y=1613
-
-[IconPosition::movepage.o]
-X=10
-Y=1687
-
-[IconPosition::mpal.cpp]
-X=106
-Y=1685
-
-[IconPosition::mpal.h]
-X=200
-Y=1685
-
-[IconPosition::mpal.moc]
-X=279
-Y=1685
-
-[IconPosition::mpal.o]
-X=374
-Y=1687
-
-[IconPosition::mspinbox.cpp]
-X=6
-Y=1742
-
-[IconPosition::mspinbox.h]
-X=100
-Y=1742
-
-[IconPosition::mspinbox.o]
-X=187
-Y=1744
-
-[IconPosition::muster.cpp]
-X=275
-Y=1742
-
-[IconPosition::muster.h]
-X=369
-Y=1742
-
-[IconPosition::muster.moc]
-X=13
-Y=1799
-
-[IconPosition::muster.o]
-X=108
-Y=1801
-
-[IconPosition::newfile.cpp]
-X=186
-Y=1799
-
-[IconPosition::newfile.h]
-X=280
-Y=1799
-
-[IconPosition::newfile.moc]
-X=359
-Y=1799
-
-[IconPosition::newfile.o]
-X=19
-Y=1858
-
-[IconPosition::newtemp.cpp]
-X=94
-Y=1856
-
-[IconPosition::newtemp.h]
-X=188
-Y=1856
-
-[IconPosition::newtemp.o]
-X=275
-Y=1858
-
-[IconPosition::page.cpp]
-X=366
-Y=1856
-
-[IconPosition::page.h]
-X=25
-Y=1913
-
-[IconPosition::page.moc]
-X=104
-Y=1913
-
-[IconPosition::page.o]
-X=199
-Y=1915
-
-[IconPosition::pageback.cpp]
-X=269
-Y=1913
-
-[IconPosition::pageback.h]
-X=359
-Y=1913
-
-[IconPosition::pageback.o]
-X=11
-Y=1987
-
-[IconPosition::pageitem.cpp]
-X=94
-Y=1985
-
-[IconPosition::pageitem.h]
-X=188
-Y=1985
-
-[IconPosition::pageitem.o]
-X=275
-Y=1987
-
-[IconPosition::pdfopts.cpp]
-X=360
-Y=1985
-
-[IconPosition::pdfopts.h]
-X=19
-Y=2042
-
-[IconPosition::pdfopts.moc]
-X=98
-Y=2042
-
-[IconPosition::pdfopts.o]
-X=193
-Y=2044
-
-[IconPosition::picsearch.cpp]
-X=269
-Y=2042
-
-[IconPosition::picsearch.h]
-X=359
-Y=2042
-
-[IconPosition::picsearch.moc]
-X=7
-Y=2114
-
-[IconPosition::picsearch.o]
-X=98
-Y=2116
-
-[IconPosition::picstatus.cpp]
-X=181
-Y=2114
-
-[IconPosition::picstatus.h]
-X=275
-Y=2114
-
-[IconPosition::picstatus.moc]
-X=354
-Y=2114
-
-[IconPosition::picstatus.o]
-X=14
-Y=2188
-
-[IconPosition::plugins]
-X=111
-Y=62
-
-[IconPosition::pslib.o]
-X=287
-Y=2188
-
-[IconPosition::query.cpp]
-X=364
-Y=2186
-
-[IconPosition::query.h]
-X=23
-Y=2243
-
-[IconPosition::query.o]
-X=110
-Y=2245
-
-[IconPosition::reformdoc.cpp]
-X=182
-Y=2243
-
-[IconPosition::reformdoc.h]
-X=272
-Y=2243
-
-[IconPosition::reformdoc.moc]
-X=355
-Y=2243
-
-[IconPosition::reformdoc.o]
-X=11
-Y=2317
-
-[IconPosition::scfonts.cpp]
-X=99
-Y=2315
-
-[IconPosition::scfonts.h]
-X=193
-Y=2315
-
-[IconPosition::scfonts.o]
-X=280
-Y=2317
-
-[IconPosition::scfonts_encoding.cpp]
-X=355
-Y=2315
-
-[IconPosition::scfonts_encoding.h]
-X=7
-Y=2387
-
-[IconPosition::scfonts_encoding.o]
-X=94
-Y=2389
-
-[IconPosition::scfonts_ttf.cpp]
-X=182
-Y=2387
-
-[IconPosition::scfonts_ttf.h]
-X=272
-Y=2387
-
-[IconPosition::scfonts_ttf.o]
-X=359
-Y=2389
-
-[IconPosition::scfonts_ttftypes.h]
-X=8
-Y=2459
-
-[IconPosition::scrap.cpp]
-X=103
-Y=2459
-
-[IconPosition::scrap.h]
-X=197
-Y=2459
-
-[IconPosition::scrap.moc]
-X=276
-Y=2459
-
-[IconPosition::scrap.o]
-X=371
-Y=2461
-
-[IconPosition::scribus]
-X=24
-Y=2533
-
-[IconPosition::scribus.bg.qm]
-X=93
-Y=2531
-
-[IconPosition::scribus.bg_BG.po]
-X=182
-Y=2531
-
-[IconPosition::scribus.ca.po]
-X=268
-Y=2531
-
-[IconPosition::scribus.ca.qm]
-X=354
-Y=2531
-
-[IconPosition::scribus.cpp]
-X=12
-Y=2603
-
-[IconPosition::scribus.de.qm]
-X=93
-Y=2603
-
-[IconPosition::scribus.de_DE.po]
-X=181
-Y=2603
-
-[IconPosition::scribus.es.qm]
-X=267
-Y=2603
-
-[IconPosition::scribus.es_ES.po]
-X=356
-Y=2603
-
-[IconPosition::scribus.fr.po]
-X=10
-Y=2675
-
-[IconPosition::scribus.fr.qm]
-X=96
-Y=2675
-
-[IconPosition::scribus.galician.po]
-X=181
-Y=2675
-
-[IconPosition::scribus.gl.qm]
-X=269
-Y=2675
-
-[IconPosition::scribus.h]
-X=367
-Y=2675
-
-[IconPosition::scribus.hu.po]
-X=7
-Y=2747
-
-[IconPosition::scribus.hu.qm]
-X=93
-Y=2747
-
-[IconPosition::scribus.it.po]
-X=185
-Y=2747
-
-[IconPosition::scribus.it.qm]
-X=271
-Y=2747
-
-[IconPosition::scribus.moc]
-X=359
-Y=2747
-
-[IconPosition::scribus.o]
-X=19
-Y=2806
-
-[IconPosition::scribus.sk.qm]
-X=94
-Y=2804
-
-[IconPosition::scribus.sk_SK.po]
-X=183
-Y=2804
-
-[IconPosition::scribus.uk.po]
-X=268
-Y=2804
-
-[IconPosition::scribus.uk.qm]
-X=354
-Y=2804
-
-[IconPosition::scribusXml.cpp]
-X=182
-Y=2948
-
-[IconPosition::scribusXml.h]
-X=269
-Y=2948
-
-[IconPosition::scribusXml.moc]
-X=355
-Y=2948
-
-[IconPosition::scribusXml.o]
-X=8
-Y=3022
-
-[IconPosition::scribusdoc.cpp]
-X=8
-Y=2876
-
-[IconPosition::scribusdoc.h]
-X=95
-Y=2876
-
-[IconPosition::scribusdoc.o]
-X=182
-Y=2878
-
-[IconPosition::scribusview.cpp]
-X=267
-Y=2876
-
-[IconPosition::scribusview.h]
-X=354
-Y=2876
-
-[IconPosition::scribusview.moc]
-X=9
-Y=2948
-
-[IconPosition::scribusview.o]
-X=93
-Y=2950
-
-[IconPosition::serializer.cpp]
-X=94
-Y=3020
-
-[IconPosition::serializer.h]
-X=188
-Y=3020
-
-[IconPosition::serializer.o]
-X=275
-Y=3022
-
-[IconPosition::spalette.cpp]
-X=358
-Y=3020
-
-[IconPosition::spalette.h]
-X=17
-Y=3077
-
-[IconPosition::spalette.moc]
-X=96
-Y=3077
-
-[IconPosition::spalette.o]
-X=191
-Y=3079
-
-[IconPosition::templates]
-X=192
-Y=62
-
-[IconPosition::tree.cpp]
-X=369
-Y=3077
-
-[IconPosition::tree.h]
-X=28
-Y=3134
-
-[IconPosition::tree.moc]
-X=107
-Y=3134
-
-[IconPosition::tree.o]
-X=202
-Y=3136
-
-[IconPosition::util.cpp]
-X=372
-Y=3134
-
-[IconPosition::util.o]
-X=29
-Y=3193
-
-[IconPosition::vruler.cpp]
-X=103
-Y=3191
-
-[IconPosition::vruler.h]
-X=197
-Y=3191
-
-[IconPosition::vruler.moc]
-X=276
-Y=3191
-
-[IconPosition::vruler.o]
-X=371
-Y=3193
/Scribus/Scribus/scribus/.directory
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/icons5.h
===================================================================
--- Scribus/Scribus/scribus/icons5.h (revision 6)
+++ Scribus/Scribus/scribus/icons5.h (nonexistent)
@@ -1,59 +0,0 @@
-static const char *dashdotL[]={
-"73 7 2 1",
-". c None",
-"# c #000000",
-".........................................................................",
-".........................................................................",
-"..#########...###...#########...###...#########...###...#########...###..",
-"..#########...###...#########...###...#########...###...#########...###..",
-"..#########...###...#########...###...#########...###...#########...###..",
-".........................................................................",
-"........................................................................."};
-
-static const char *dashdotdotL[]={
-"73 7 2 1",
-". c None",
-"# c #000000",
-".........................................................................",
-".........................................................................",
-"..#########...###...###...#########...###...###...#########...###...###..",
-"..#########...###...###...#########...###...###...#########...###...###..",
-"..#########...###...###...#########...###...###...#########...###...###..",
-".........................................................................",
-"........................................................................."};
-
-static const char *dotL[]={
-"73 7 2 1",
-". c None",
-"# c #000000",
-".........................................................................",
-".........................................................................",
-"..###...###...###...###...###...###...###...###...###...###...###...###..",
-"..###...###...###...###...###...###...###...###...###...###...###...###..",
-"..###...###...###...###...###...###...###...###...###...###...###...###..",
-".........................................................................",
-"........................................................................."};
-
-static const char *solidL[]={
-"73 7 2 1",
-". c None",
-"# c #000000",
-".........................................................................",
-".........................................................................",
-"..#####################################################################..",
-"..#####################################################################..",
-"..#####################################################################..",
-".........................................................................",
-"........................................................................."};
-
-static const char *dashL[]={
-"73 7 2 1",
-". c None",
-"# c #000000",
-".........................................................................",
-".........................................................................",
-"..#########...#########...#########...#########...#########...#########..",
-"..#########...#########...#########...#########...#########...#########..",
-"..#########...#########...#########...#########...#########...#########..",
-".........................................................................",
-"........................................................................."};
/Scribus/Scribus/scribus/icons5.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/werktoolb.cpp
===================================================================
--- Scribus/Scribus/scribus/werktoolb.cpp (revision 6)
+++ Scribus/Scribus/scribus/werktoolb.cpp (nonexistent)
@@ -1,284 +0,0 @@
-/***************************************************************************
- texttoolb.cpp - description
- -------------------
- begin : Sun Mar 10 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 "werktoolb.h"
-#include "werktoolb.moc"
-#include "polyprops.h"
-
-extern int PolyC;
-extern int PolyFd;
-extern float PolyF;
-extern bool PolyS;
-extern float PolyR;
-extern QPixmap loadIcon(QString nam);
-
-WerkToolB::WerkToolB(QMainWindow* parent) : QToolBar(tr("Tools"), parent)
-{
- Select = new QToolButton(loadIcon("Kreuz.xpm"), tr("Select Items"), QString::null, this, SLOT(ModeFromTB()), this);
- Select->setToggleButton(true);
- Select->setOn(true);
- Rotiere = new QToolButton(loadIcon("Rotieren.xpm"), tr("Rotate Item"), QString::null, this, SLOT(ModeFromTB()), this);
- Rotiere->setToggleButton( true );
- Rotiere->setEnabled(false);
- Textedit = new QToolButton(loadIcon("Editm.xpm"),tr("Edit Contents of Frame"), QString::null, this, SLOT(ModeFromTB()), this);
- Textedit->setToggleButton( true );
- Textedit->setEnabled( FALSE );
- Zoom = new QToolButton(loadIcon("Lupe.xpm"),tr("Zooms in or out"), QString::null, this, SLOT(ModeFromTB()), this);
- Zoom->setToggleButton( true );
- Texte = new QToolButton(loadIcon("Text.xpm"),tr("Insert Textbox"), QString::null, this, SLOT(ModeFromTB()), this);
- Texte->setToggleButton( true );
- BildB = new QToolButton(loadIcon("Bild.xpm"),tr("Insert Picture"), QString::null, this, SLOT(ModeFromTB()), this);
- BildB->setToggleButton( true );
- Rechteck = new QToolButton(loadIcon("Rechtecke.xpm"),tr("Insert Rectangles"), QString::null, this, SLOT(ModeFromTB()), this);
- Rechteck->setToggleButton( true );
- Kreis = new QToolButton(loadIcon("Kreise.xpm"),tr("Insert Ovals"), QString::null, this, SLOT(ModeFromTB()), this);
- Kreis->setToggleButton( true );
- PolyM = new QPopupMenu();
- PolyM->insertItem(tr("Properties..."), this, SLOT(GetPolyProps()));
- Polygon = new QToolButton(loadIcon("spline.png"),tr("Insert Polygons"), QString::null, this, SLOT(ModeFromTB()), this);
- Polygon->setToggleButton( true );
- Polygon->setPopup(PolyM);
- Polygon->setPopupDelay(0);
- Linien = new QToolButton(loadIcon("Stift.xpm"),tr("Insert Lines"), QString::null, this, SLOT(ModeFromTB()), this);
- Linien->setToggleButton( true );
- PolyLin = new QToolButton(loadIcon("beziertool.png"),tr("Insert Bezier Curves"), QString::null, this, SLOT(ModeFromTB()), this);
- PolyLin->setToggleButton( true );
- KetteEin = new QToolButton(loadIcon("Lock.xpm"),tr("Create Textchains"), QString::null, this, SLOT(ModeFromTB()), this);
- KetteEin->setToggleButton( true );
- KetteEin->setEnabled(false);
- KetteAus = new QToolButton(loadIcon("Unlock.xpm"),tr("Break Textchains"), QString::null, this, SLOT(ModeFromTB()), this);
- KetteAus->setToggleButton( true );
- KetteAus->setEnabled(false);
- PDFM = new QPopupMenu();
- PDFM->insertItem(loadIcon("pushbutton.png"), tr("Button"));
- PDFM->insertItem(loadIcon("textview.png"), tr("Text Field"));
- PDFM->insertItem(loadIcon("checkbox.png"), tr("Check Box"));
- PDFM->insertItem(loadIcon("combobox.png"), tr("Combo Box"));
- PDFM->insertItem(loadIcon("listbox.png"), tr("List Box"));
- PDFTool = new QToolButton(loadIcon("pushbutton.png"),tr("Insert PDF-Fields"), QString::null, this, SLOT(ModeFromTB()), this);
- PDFTool->setToggleButton(true);
- PDFTool->setPopup(PDFM);
- PDFTool->setPopupDelay(0);
- PDFwerkz = 0;
- PDFA = new QPopupMenu();
- PDFA->insertItem(loadIcon("charset.png"), tr("Text"));
- PDFA->insertItem(loadIcon("goto.png"), tr("Link"));
- PDFaTool = new QToolButton(loadIcon("charset.png"),tr("Insert PDF-Annotations"), QString::null, this, SLOT(ModeFromTB()), this);
- PDFaTool->setToggleButton(true);
- PDFaTool->setPopup(PDFA);
- PDFaTool->setPopupDelay(0);
- PDFnotiz = 0;
- setCloseMode(QDockWindow::Undocked);
- connect(this, SIGNAL(placeChanged(QDockWindow::Place)), this, SLOT(Docken(QDockWindow::Place)));
- connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(Verbergen(bool)));
- connect(PDFM, SIGNAL(activated(int)), this, SLOT(setPDFtool(int)));
- connect(PDFA, SIGNAL(activated(int)), this, SLOT(setPDFnotiz(int)));
-}
-
-void WerkToolB::setPDFnotiz(int id)
-{
- int c = PDFA->indexOf(id);
- PDFnotiz = c;
- switch (c)
- {
- case 0:
- PDFaTool->setPixmap(loadIcon("charset.png"));
- break;
- case 1:
- PDFaTool->setPixmap(loadIcon("goto.png"));
- break;
- }
- Select->setOn(false);
- Rotiere->setOn(false);
- Textedit->setOn(false);
- Zoom->setOn(false);
- Texte->setOn(false);
- BildB->setOn(false);
- Rechteck->setOn(false);
- Kreis->setOn(false);
- Linien->setOn(false);
- KetteEin->setOn(false);
- KetteAus->setOn(false);
- Polygon->setOn(false);
- PolyLin->setOn(false);
- PDFTool->setOn(false);
- PDFaTool->setOn(true);
- emit NewMode(19+PDFnotiz);
-}
-
-void WerkToolB::setPDFtool(int id)
-{
- int c = PDFM->indexOf(id);
- PDFwerkz = c;
- switch (c)
- {
- case 0:
- PDFTool->setPixmap(loadIcon("pushbutton.png"));
- break;
- case 1:
- PDFTool->setPixmap(loadIcon("textview.png"));
- break;
- case 2:
- PDFTool->setPixmap(loadIcon("checkbox.png"));
- break;
- case 3:
- PDFTool->setPixmap(loadIcon("combobox.png"));
- break;
- case 4:
- PDFTool->setPixmap(loadIcon("listbox.png"));
- break;
- }
- Select->setOn(false);
- Rotiere->setOn(false);
- Textedit->setOn(false);
- Zoom->setOn(false);
- Texte->setOn(false);
- BildB->setOn(false);
- Rechteck->setOn(false);
- Kreis->setOn(false);
- Linien->setOn(false);
- KetteEin->setOn(false);
- KetteAus->setOn(false);
- Polygon->setOn(false);
- PolyLin->setOn(false);
- PDFTool->setOn(true);
- PDFaTool->setOn(false);
- emit NewMode(14+PDFwerkz);
-}
-
-void WerkToolB::Docken(QDockWindow::Place p)
-{
- if (p == InDock)
- setOrientation(Horizontal);
- else
- setOrientation(Vertical);
-}
-
-void WerkToolB::Verbergen(bool vis)
-{
- if (!vis)
- emit Schliessen();
-}
-
-void WerkToolB::GetPolyProps()
-{
- PolygonProps* dia = new PolygonProps(this);
- if (dia->exec())
- {
- PolyC = dia->Ecken->value();
- PolyF = dia->PFactor;
- PolyS = dia->Konvex->isChecked();
- PolyFd = dia->Slider1->value();
- PolyR = dia->Faktor2->value();
- }
- delete dia;
-}
-
-void WerkToolB::ModeFromTB()
-{
- Select->setOn(false);
- Rotiere->setOn(false);
- Textedit->setOn(false);
- Zoom->setOn(false);
- Texte->setOn(false);
- BildB->setOn(false);
- Rechteck->setOn(false);
- Kreis->setOn(false);
- Linien->setOn(false);
- KetteEin->setOn(false);
- KetteAus->setOn(false);
- Polygon->setOn(false);
- PolyLin->setOn(false);
- PDFTool->setOn(false);
- PDFaTool->setOn(false);
- if (Select == sender())
- {
- Select->setOn(true);
- emit NewMode(1);
- }
- if (Rotiere == sender())
- {
- Rotiere->setOn(true);
- emit NewMode(9);
- }
- if (Textedit == sender())
- {
- Textedit->setOn(true);
- emit NewMode(7);
- }
- if (Zoom == sender())
- {
- Zoom->setOn(true);
- emit NewMode(6);
- }
- if (Texte == sender())
- {
- Texte->setOn(true);
- emit NewMode(5);
- }
- if (BildB == sender())
- {
- BildB->setOn(true);
- emit NewMode(4);
- }
- if (Rechteck == sender())
- {
- Rechteck->setOn(true);
- emit NewMode(2);
- }
- if (Kreis == sender())
- {
- Kreis->setOn(true);
- emit NewMode(3);
- }
- if (Linien == sender())
- {
- Linien->setOn(true);
- emit NewMode(8);
- }
- if (KetteEin == sender())
- {
- KetteEin->setOn(true);
- emit NewMode(10);
- }
- if (KetteAus == sender())
- {
- KetteAus->setOn(true);
- emit NewMode(11);
- }
- if (Polygon == sender())
- {
- Polygon->setOn(true);
- emit NewMode(12);
- }
- if (PolyLin == sender())
- {
- PolyLin->setOn(true);
- emit NewMode(13);
- }
- if (PDFTool == sender())
- {
- PDFTool->setOn(true);
- emit NewMode(14+PDFwerkz);
- }
- if (PDFaTool == sender())
- {
- PDFaTool->setOn(true);
- emit NewMode(19+PDFnotiz);
- }
-}
-
/Scribus/Scribus/scribus/werktoolb.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/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 */