r15854 by jghali - merge trunk revisions up to r15853
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 14 12:41:11 CET 2010
Author: jghali
Date: Sun Nov 14 11:41:11 2010
New Revision: 15854
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15854
Log:
merge trunk revisions up to r15853
Added:
branches/ScribusOIF/doc/en/images/alert.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/alert.png
branches/ScribusOIF/doc/en/images/cmyk.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/cmyk.png
branches/ScribusOIF/doc/en/images/colrs-caricature.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/colrs-caricature.png
branches/ScribusOIF/doc/en/images/editcols1.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/editcols1.png
branches/ScribusOIF/doc/en/images/editcols1a.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/editcols1a.png
branches/ScribusOIF/doc/en/images/editcols2.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/editcols2.png
branches/ScribusOIF/doc/en/images/editcols3.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/editcols3.png
branches/ScribusOIF/doc/en/images/register.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/register.png
branches/ScribusOIF/doc/en/images/rgb.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/rgb.png
branches/ScribusOIF/doc/en/images/spot.png
- copied unchanged from r15853, trunk/Scribus/doc/en/images/spot.png
branches/ScribusOIF/resources/icons/16/draw-calligraphic.png
- copied unchanged from r15853, trunk/Scribus/resources/icons/16/draw-calligraphic.png
branches/ScribusOIF/resources/icons/22/draw-calligraphic.png
- copied unchanged from r15853, trunk/Scribus/resources/icons/22/draw-calligraphic.png
branches/ScribusOIF/resources/swatches/Munsell_Soil_Colors.xml
- copied unchanged from r15853, trunk/Scribus/resources/swatches/Munsell_Soil_Colors.xml
branches/ScribusOIF/scribus/canvasmode_drawcalligraphic.cpp
- copied unchanged from r15853, trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
branches/ScribusOIF/scribus/canvasmode_drawcalligraphic.h
- copied unchanged from r15853, trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
Modified:
branches/ScribusOIF/doc/en/color1.html
branches/ScribusOIF/scribus/CMakeLists.txt
branches/ScribusOIF/scribus/actionmanager.cpp
branches/ScribusOIF/scribus/canvas.cpp
branches/ScribusOIF/scribus/canvas.h
branches/ScribusOIF/scribus/canvasmode.cpp
branches/ScribusOIF/scribus/canvasmode_drawfreehand.cpp
branches/ScribusOIF/scribus/canvasmode_drawfreehand.h
branches/ScribusOIF/scribus/collect4output.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
branches/ScribusOIF/scribus/prefsmanager.cpp
branches/ScribusOIF/scribus/prefsstructs.h
branches/ScribusOIF/scribus/scribus.cpp
branches/ScribusOIF/scribus/scribusdoc.cpp
branches/ScribusOIF/scribus/scribusstructs.h
branches/ScribusOIF/scribus/ui/about.cpp
branches/ScribusOIF/scribus/ui/modetoolbar.cpp
branches/ScribusOIF/scribus/ui/modetoolbar.h
branches/ScribusOIF/scribus/ui/prefs_itemtools.cpp
branches/ScribusOIF/scribus/ui/prefs_itemtoolsbase.ui
branches/ScribusOIF/win32/vc8/Scribus.vcproj
Modified: branches/ScribusOIF/doc/en/color1.html
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/doc/en/color1.html
==============================================================================
--- branches/ScribusOIF/doc/en/color1.html (original)
+++ branches/ScribusOIF/doc/en/color1.html Sun Nov 14 11:41:11 2010
@@ -1,51 +1,87 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <title>Editing and Importing Colors, Scribus Color Sets</title>
+ <title>Editing and Managing Solid Colors</title>
</head>
-<h3>Solid Colors</h3>
-<p>Within Scribus there are several methods to create, import and edit solid colors and color sets in a document. Moreover, Scribus has a well developed tool, the Color Wheel plug-in, which helps with creating creating color harmonies and even testing them for people with colour blindness.</p>
-<h4>Managing Color Sets</h4>
-<p>By default, Scribus comes with a handful of very useful color sets, which can be used as a basis for creating new colors or color sets. You can then reuse these sets in all future documents. It is helpful to understand the differences between RGB and CMYK color models, and it is recommended you have color management properly set up and enabled. Remember, true CMYK colors cannot be shown directly on a computer monitor; they can only be simulated. Color Management, when enabled, presents a truer representation of colors when printed using CMYK inks. Note that most common desktop inkjet printers are actually what is called an RGB device, like a monitor. This is because their drivers expect RGB color data and do the RGB to CMYK conversion internally via the driver and/or a combination of driver/firmware in the printer.</p>
-<p>One other term which is handy to know in page layout is <em>color sets</em>, also known as <em>palettes</em> or <em>swatches</em>, much like swatch books of fabrics or paints.</p>
-<ul>
- <li><strong>Scribus Small</strong> is a set of primary CMYK colors. These are based on a mix of percentages of the standard CMYK inks. </li>
-<li><strong>Scribus Basic</strong> is a set of primary CMYK and RGB colors, as well as two variants of black, namely "Cool Black" and "Warm Black." The latter consists of a mix of C, M, Y and K colours instead of just 100% K (K=Black).</li>
- <li><strong>Scribus Gnome</strong> is a set of named RGB colors, which are standard on recent Gnome Desktops. </li>
- <li><strong>Scribus OpenOffice</strong> is a set of CMYK colors which are based on the standard colors found in OpenOffice.org.</li>
- <li><strong>Scribus SVG</strong> is a set of RGB colors based on the named colors from the <a href="http://www.w3.org/TR/css3-color/#svg-color">SVG specification</a>.</li>
-<li><strong>Scribus Splash</strong> is a set of the colours in the Scribus logo and the splashscreen. Its main purpose is to guarantee a consistent use of colors in Scribus-related publications.</li>
- <li><strong>Scribus X11</strong> is a set of RGB colors based on the named colors from X-Window.</li>
- <li><strong>Scribus X11</strong> is a set of Grey Scale shades based on the named shades from X-Window.</li>
-<li><strong>Scribus Xfig</strong> is a set of the RGB colors used by Xfig.</li>
-<li>Some of the swatches also contain a color called "Registration." Since this one is only used for printing marks in offset printing, you cannot edit the color.</li>
- </ul>
-<p>You can choose the default color set for all new documents by closing all documents and then picking one from the Color Editor Palette (Edit > Colors).</p>
-<table width="100%"><tr><td align="center"><img src="images/colormanager1.png" title="Scribus Color Manager" alt="Scribus Color Manager" /></td></tr></table><br />
-<h4>Importing Colors</h4>
-<p>From the Color Manager you can import colors from other Scribus documents or from vector based EPS, PostScript or AI (Adobe Illustrator®) files, as well as OpenOffice.org (SOC) and GIMP (GPL) palettes, and also spot colors. The latter are colors that are only identified by their name, hence the alternative term "Named Colors." It's up to the printer to reproduce any such color with the help of a color fan and/or a specialized ink vendor.</p>
-<p>To import colors, click the "Import" button and then change the file type drop down to show non-Scribus files. </p>
-<p>Sometimes, colors cannot be imported from a file, even if it's PostScript based. Why? Not all programs save <a href="http://en.wikipedia.org/wiki/Document_structure_convention">DSC</a> (Document Structure Convention) comments properly and incompatible proprietary extensions which do not follow the Postscript specification properly.</p>
-<p>Note that colors in imported vector files will be added automatically to the color set of the current document.</p>
-<h4>Creating New Color Sets</h4>
-<p>To create a new color set, close all documents and open the Color Manager. Choose any palette from the list. Now you can add, remove or import colors. Finally, click on "Save Color Set." Scribus will ask for a name, and after clicking "OK," the new palette is saved. You can now use it in all documents.</p>
-<h4>Replacing Colors</h4>
-<p>It is possible to replace all instances of a solid color in a Scribus document. Just open the replacement dialog (Edit > Replace Colors).</p>
-<table width="100%"><tr><td align="center"><img src="images/replace_colors.png" title="Replacing Colors" alt="Replacing Colors" /></td></tr></table>
+<body>
+<h3>Editing and Managing Solid Colors (1)</h3>
+<table border="1" align="center">
+ <tbody>
+ <tr>
+ <td><i><b>Please note that this section is not about color management, but about the editing and managing of color <a href="WwFill.html">fills</a>. Color management is described in a <a href="cms.html">separate chapter</a>.</b></i></td>
+ </tr>
+ </tbody>
+</table>
+<p>Within Scribus there are several methods to create, import and edit solid colors and color sets. Moreover, Scribus has a well developed tool, the Color Wheel plug-in, which helps with creating color harmonies and even testing them for people with color blindness.</p>
+<h3>Why Color Sets?</h3>
+<p>The answer to the question in the headline is closely related to the answer to a more basic question, namely: “What is a color?” The truth is, there is no simple answer to that question, as a “color” can be described in hundreds of ways, for example as a combination of wavelengths, a combination of color values within a certain “color model”, as a category in a framework based on aesthetical rules etc. As a result, many different so-called “color models” have been developed over the course of time, many of which have become part of a discipline called “color science”, a science that is itself a “meta-science”, as it requires input from many different disciplines, including physics, neuro-science, biology, mathematics, engineering, and even art, artisanry or literature. “Color” is actually one of a few cases, in which artists like Johann Wolfgang von Goethe or Albert Henry Munsell contributed significantly to scientific progress.</p>
+<p>Users of graphics-related programs like Scribus shouldn’t be required to learn the ins and outs of color science, although some theoretical knowledge doesn’t hurt. On a more basic level, however, some awareness of the issues mentioned above certainly helps a lot when working with colors, and the caricature below may be a first step to understand what it’s all about:</p>
+
+<table width="100%"><tr><td align="center"><img src="images/colrs-caricature.png" title="Color Names – Courtesy of http://www.thedoghousediaries.com" alt="Color Names – Courtesy of http://www.thedoghousediaries.com" /></td></tr></table><br>
+<p>As is often true with good cartoons, there is some relevant truth behind it, in that there are different levels of differentiating and categorizing colors, which are often highly subjective. Imagine two persons, one in the “Girls” column, the other in the “Boys” column, talking on the phone about a color choice for a project – it will be virtually impossible, since both the (subjective) color names and the color perception are quite different. Thus, pre-defined color sets are actually a way to <b><i>communicate</i></b> about colors without referring to either a subjective color model or sophisticated color science, and using meaningful names for colors within a given color set can facilitate communication about colors even further.</p>
+<p>Creating color sets also helps vendors or projects to define a limited set of colors that are allowed for use, which helps to maintain visual uniformity across publications</p>
+<p>As a practical matter, the colors available in a color palette or colors you create yourself (and thus add to an existing palette) are the only ones that can be used as text, fill, line or gradient colors.</p>
+
+<h4>Colors in Scribus Color Palettes</h4>
+<p>Scribus is shipped with a huge collection of useful color sets, also called âpalettesâ or (somehow misleading) âswatches.â These palettes serve different purposes, most of which will be described in a <a href="color3.html">separate document</a>. There are palettes of different sizes available, ranging from “Scribus Basic”, a collection of primary RGB and CMYK colors to, for instance, “Scribus X11”, which includes a huge number of (RGB) Colors.</p><br>
+<table border="1" align="center">
+ <tbody>
+ <tr>
+ <td><i><b>Please note that “Scribus X11” used to be the default palette in earlier versions of Scribus, whereas the default set has been changed to “Scribus Basic” since 1.3.6.</i></b>.</td>
+</tr>
+ </tbody>
+</table>
<br>
-<p>The dialog provides three editing options:</p>
-<ul>
-<li><strong>Add...</strong> allows for adding a new color and its substitution.</li>
-<li><strong>Remove</strong> removes a selected color substitution.</li>
-<li><strong>Edit</strong> allows for editing a color substitution.</li>
-</ul>
-<p><em>Note that clicking OK removes all colors in the left column of the dialog shown above from the document irreversibly!</em>
-</p>
-<h4>Removing Colors</h4>
-<p>There are two ways to remove colors from a document, and they serve different purposes.</p>
-<ul>
-<li>To remove a color that's used in a document, use color replacement as described above and choose "None" as the replacement color.</li>
-<li>To remove all colors in a color set that aren't used in the current document, open the Color Manager and click "Remove Unused."</li>
-</ul>
-</body>
-</html>
+<p>Color palettes in Scribus can contain four different types of colors, each of which uses a different visual indicator in Scribus color dialogs:</p>
+
+<table border="0">
+ <col width=2*>
+ <col width=2*>
+ <col width=auto>
+ <tbody>
+ <tr valign=top>
+ <td><img src="images/rgb.png"></td>
+ <td> </td>
+ <td><b>RGB Colors</b>: These colours are defined in the RGB color model. Every color is described by the three primary colors red, green and blue.</td>
+ </tr>
+ <tr valign=top>
+ <td><img src="images/cmyk.png" align="top"></td>
+ <td></td>
+ <td><b>CMYK Colors</b>: These colors are defined in the CMYK color model. Every color is described by the four ink colors used in color printing: Cyan, Magenta, Yellow and Key (=Black).</td>
+ </tr>
+ <tr valign=top>
+ <td><img src="images/spot.png"></td>
+ <td></td>
+ <td><b>Spot Colors</b>: These are also referred to as “named colors”, but since other (RGB/CMYK) colors can also have a name, the term “spot color” is to be preferred for unambiguousness. While a spot color can be either defined in the RGB or CMYK color model, its main purpose is to be stored with its <i>name</i> in a PDF or PostScript file (hence the term ânamed colorâ). The name does refer to a real world color reference, like a printed color fan, and a printing company can mix or buy a special ink, which will match exactly the color as specified by the reference. Each spot color requires a separate printing plate, which is why you should use spot colors carefully, because their use makes a printing process more expensive. Typical use cases for spot colors would be very specific hues in corporate logos. The red dot beside a color model icon (RGB or CMYK) indicates that the respective color is a spot color.</td>
+ </tr>
+ <tr valign=top>
+ <td><img src="images/register.png"></td>
+ <td></td>
+ <td><b>Registration Color</b>: This is a special case of a CMYK color, which is used for registration marks. The latter are used by printers to determine whether a four-color print run has been successful. Each palette can only have one registration color, which is indicated by a “bull’s eye” icon.</td>
+ <td></td>
+ </tr>
+ <tr valign=top>
+ <td><img src="images/alert.png"></td>
+ <td></td>
+ <td>If you are working with activated <a href="cms.html">color management</a>, some or even all colors in a palette may be “out of gamut,” i.e., depending on a selected ICC profile, a color can’t be “translated” from one color model into another, and a color shift can occur. In such a case you will see a warning sign placed beside the color in the list.</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<h4>Editing Colors and Color Palettes</h4>
+<p>When you create and save a new document, all the colors that are availabe in the dialog <i>Edit > Colors</i> will be stored in that document. This is an important detail, because any changes to a color palette will only affect the current document. The selection or creation of a new default palette will be described in the <a href="color2.html">next section</a>.</p>
+<p>If you choose <i>Edit > Colors</i> from the menu bar for the first time and with a new document open, Scribus will bring up the following dialog:</p><br>
+
+<table width="100%"><tr><td align="center"><img src="images/editcols1.png"/></td></tr></table><br>
+<p>To the left you see the list of colors in the selected default color set, which is the palette “Scribus Basic”. The list view contains a preview of every color, a color model indicator, indicators for special colors (spot, registration), and finally the name of the color. If color management is active, you may also see a warning sign between the color preview and the color model icon, indicating that a color is out of gamut.</p>
+<p>To the right you see various editing options for your color palette, starting with the “Import” button at the top. Clicking on it brings up a file dialog, where you can select various sources for colors. These sources can either be existing Scribus files or color palettes in one of the following formats: <b>Encapsulated PostScript (EPS)</b>, <b>PostScript (PS)</b>, <b>Adobe Illustrator (AI)</b>, <b>OpenDocument Color Palettes (SOC)</b> or <b>GIMP Color Palettes (GPL)</b>. Note that importing a color palette does <i><b>not</b></i> replace the existing colors. Instead, the colors will be <i><b>added</b></i> to the existing palette:</p>
+<table width="100%"><tr><td align="center"><img src="images/editcols1a.png"/></td></tr></table><br>
+<p>You can also create a new color yourself and add it to the existing palette by clicking on the “New” button. This will bring up the color editor:</p>
+<table width="100%"><tr><td align="center"><img src="images/editcols2.png"/></td></tr></table><br>
+<p>Here you can insert a name for the new color and select a color model (CMYK, RGB and web-safe RGB, the latter being almost irrelevant today, even if you are creating a PDF for the world-wide web). In the lower right section you see three or four (depending on the selected color model) color sliders to modify the color values. Of course you can also insert numerical color values directly. At the top of the dialog you see a so-called “HSV Color Map”, which allows for creating a color by clicking somewhere on the colored field. “HSV” is an abbreviation for “Hue, Saturation, Value”, which is another way to describe colors in the RGB color model. If you click on the drop-down list, you will see that you can also select a color from one of the installed color palettes.</p>
+<p>To use the “Edit” and “Duplicate” options you have to select a color from the list. The dialog that will appear is identical to the one for new colors.</p>
+<p>Deleting a color from the list can be risky, since the color may have already been applied to an item or text in a document. Thus, Scribus will always ask for a replacement color, a mechanism that’s similar to <i>Edit > Replace Colors</i>, which is described in the section on <a href="importhints2.html">importing vector drawings</a>:</p><br>
+<table width="100%"><tr><td align="center"><img src="images/editcols3.png"/></td></tr></table><br>
+<p>The final editing option is called “Remove Unused”, which is also described in the vector import section.</p>
+<p>If you click “OK”, the changes to the color list will be saved in your Scribus document, while clicking “Cancel” will leave the list untouched.</p>
Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Sun Nov 14 11:41:11 2010
@@ -444,6 +444,7 @@
canvasmode_copyproperties.cpp
canvasmode_create.cpp
canvasmode_drawbezier.cpp
+ canvasmode_drawcalligraphic.cpp
canvasmode_drawfreehand.cpp
canvasmode_eyedropper.cpp
canvasmode_framelinks.cpp
Modified: branches/ScribusOIF/scribus/actionmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/actionmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/actionmanager.cpp (original)
+++ branches/ScribusOIF/scribus/actionmanager.cpp Sun Nov 14 11:41:11 2010
@@ -712,6 +712,8 @@
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-path.png"), loadIcon("22/draw-path.png"), "", defaultKey(name), mainWindow, modeDrawBezierLine));
name="toolsInsertFreehandLine";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-freehand.png"), loadIcon("22/draw-freehand.png"), "", defaultKey(name), mainWindow, modeDrawFreehandLine));
+ name="toolsInsertCalligraphicLine";
+ scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-calligraphic.png"), loadIcon("22/draw-calligraphic.png"), "", defaultKey(name), mainWindow, modeDrawCalligraphicLine));
name="toolsRotate";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/transform-rotate.png"), loadIcon("22/transform-rotate.png"), "", defaultKey(name), mainWindow, modeRotation));
name="toolsZoom";
@@ -780,7 +782,7 @@
*modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
- *modeActionNames << "toolsInsertFreehandLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
+ *modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
*modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
*modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
*modeActionNames << "toolsPDFPushButton" << "toolsPDFTextField" << "toolsPDFCheckBox" << "toolsPDFComboBox" << "toolsPDFListBox" << "toolsPDFAnnotText" << "toolsPDFAnnotLink";
@@ -1471,6 +1473,7 @@
(*scrActions)["toolsInsertShape"]->setText( tr("Insert &Shape"));
(*scrActions)["toolsInsertPolygon"]->setText( tr("Insert &Polygon"));
(*scrActions)["toolsInsertLine"]->setText( tr("Insert &Line"));
+ (*scrActions)["toolsInsertCalligraphicLine"]->setText( tr("Insert Calligraphic Line"));
(*scrActions)["toolsInsertBezier"]->setText( tr("Insert &Bezier Curve"));
(*scrActions)["toolsInsertFreehandLine"]->setText( tr("Insert &Freehand Line"));
@@ -1641,6 +1644,7 @@
defKeys.insert("toolsInsertLine", Qt::Key_L);
defKeys.insert("toolsInsertBezier", Qt::Key_B);
defKeys.insert("toolsInsertFreehandLine", Qt::Key_F);
+
defKeys.insert("toolsInsertRenderFrame", Qt::Key_D); //TODO: First free key. Select a meaningful
defKeys.insert("toolsRotate", Qt::Key_R);
defKeys.insert("toolsZoom", Qt::Key_Z);
@@ -1861,6 +1865,7 @@
<< "toolsInsertLine"
<< "toolsInsertBezier"
<< "toolsInsertFreehandLine"
+ << "toolsInsertCalligraphicLine"
<< "toolsInsertRenderFrame"
<< "stickyTools"
<< "insertGlyph"
Modified: branches/ScribusOIF/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/canvas.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvas.cpp (original)
+++ branches/ScribusOIF/scribus/canvas.cpp Sun Nov 14 11:41:11 2010
@@ -1047,7 +1047,7 @@
{
if (!m_viewMode.redrawPolygon.isEmpty())
{
- if (m_viewMode.m_MouseButtonPressed && (m_doc->appMode == modeDrawFreehandLine))
+ if (m_viewMode.m_MouseButtonPressed && ((m_doc->appMode == modeDrawFreehandLine) || (m_doc->appMode == modeDrawCalligraphicLine)))
{
drawControlsFreehandLine(psx);
}
Modified: branches/ScribusOIF/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/canvas.h
==============================================================================
--- branches/ScribusOIF/scribus/canvas.h (original)
+++ branches/ScribusOIF/scribus/canvas.h Sun Nov 14 11:41:11 2010
@@ -101,6 +101,7 @@
friend class CanvasMode_Normal;
friend class CanvasMode_Rotate;
friend class FreehandMode;
+ friend class CalligraphicMode;
/* Dont rely on these codes!
* 2 8 3
Modified: branches/ScribusOIF/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/canvasmode.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode.cpp Sun Nov 14 11:41:11 2010
@@ -22,6 +22,7 @@
#include "canvasmode_create.h"
#include "canvasmode_drawbezier.h"
#include "canvasmode_drawfreehand.h"
+#include "canvasmode_drawcalligraphic.h"
#include "canvasmode_edit.h"
#include "canvasmode_editgradient.h"
#include "canvasmode_editmeshgradient.h"
@@ -123,6 +124,9 @@
case modeDrawFreehandLine:
result = new FreehandMode(view);
break;
+ case modeDrawCalligraphicLine:
+ result = new CalligraphicMode(view);
+ break;
case modeDrawLine:
case modeDrawShapes:
case modeDrawImage:
@@ -575,6 +579,7 @@
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
case modeDrawFreehandLine:
+ case modeDrawCalligraphicLine:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
break;
case modeImportObject:
Modified: branches/ScribusOIF/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_drawfreehand.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_drawfreehand.cpp Sun Nov 14 11:41:11 2010
@@ -60,16 +60,10 @@
FreehandMode::FreehandMode(ScribusView* view) : CanvasMode(view)
{
- GxM = GyM = -1;
Mxp = Myp = -1;
Dxp = Dyp = -1;
MoveGX = MoveGY = false;
- oldCp = Cp = -1;
- frameResizeHandle = -1;
- RotMode = 0;
- inItemCreation = false;
- shiftSelItems = false;
- FirstPoly = true;
+ m_MouseButtonPressed = false;
}
@@ -109,16 +103,10 @@
void FreehandMode::activate(bool flag)
{
// qDebug() << "FreehandMode::activate" << flag;
- GxM = GyM = -1;
Mxp = Myp = -1;
Dxp = Dyp = -1;
MoveGX = MoveGY = false;
- oldCp = Cp = -1;
- frameResizeHandle = -1;
- RotMode = 0;
- inItemCreation = false;
- shiftSelItems = false;
- FirstPoly = true;
+ m_MouseButtonPressed = false;
setModeCursor();
}
@@ -199,7 +187,7 @@
return;
}
- if ((GetItem(&currItem)) && (!shiftSelItems))
+ if (GetItem(&currItem))
{
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
@@ -225,7 +213,7 @@
}
else
{
- if ((m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton) && (GyM == -1) && (GxM == -1))
+ if ((m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
{
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
@@ -263,7 +251,6 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
MoveGX = MoveGY = false;
- inItemCreation = false;
// oldClip = 0;
m->accept();
m_view->registerMousePress(m->globalPos());
@@ -366,7 +353,6 @@
Um::Create + " " + currItem->getUName(), "", Um::ICreate);
//FIXME
m_canvas->m_viewMode.operItemResizing = false;
- inItemCreation = false;
m_doc->changed();
// m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()).adjusted(-10, -10, 20, 20));
}
@@ -381,598 +367,12 @@
return;
}
-
- assert(false);
- if (m_doc->appMode != modeDrawBezierLine) //FIXME: that should be dead - av
- {
- if (inItemCreation)
- {
- currItem = m_doc->m_Selection->itemAt(0);
- double itemX = 0.0;
- double itemY = 0.0;
- if (m_doc->appMode == modeDrawLine)
- {
- QTransform p = currItem->getTransform();
- FPoint np = m_doc->ApplyGridF(mousePointDoc).transformPoint(p, true);
- itemX = sqrt(pow(np.x(),2.0)+pow(np.y(),2.0));
- itemY = 1.0;
- }
- else if (m_doc->appMode == modeDrawRegularPolygon)
- {
- FPoint np1(mousePointDoc); //m_view->translateToDoc(m->x(), m->y()));
- np1 = m_doc->ApplyGridF(np1);
- itemX = fabs(np1.x() - currItem->xPos());
- itemY = fabs(np1.y() - currItem->yPos());
- }
- else
- {
- itemX = fabs(currItem->width());
- itemY = fabs(currItem->height());
- }
- if ((!m_view->moveTimerElapsed()) || ((itemX < 2.0) && (itemY < 2.0)) || ((m_doc->appMode == modeDrawLine) && (itemX < 2.0)))
- {
- int lmode = 0;
- if (m_doc->appMode == modeDrawLine)
- lmode = 1;
- PrefsContext* sizes = PrefsManager::instance()->prefsFile->getContext("ObjectSize");
- double xSize, ySize;
- int originPoint;
- if (lmode == 0)
- {
- xSize = sizes->getDouble("defWidth", 100.0);
- ySize = sizes->getDouble("defHeight", 100.0);
- originPoint = sizes->getInt("Origin", 0);
- }
- else
- {
- xSize = sizes->getDouble("defLength", 100.0);
- ySize = sizes->getDouble("defAngle", 0.0);
- originPoint = sizes->getInt("OriginL", 0);
- }
- bool doRemember = sizes->getBool("Remember", true);
- bool doCreate = false;
- if (m->modifiers() & (Qt::ShiftModifier | Qt::ControlModifier))
- doCreate = true;
- else
- {
- qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
- OneClick *dia = new OneClick(m_view, ScribusView::tr("Enter Object Size"), m_doc->unitIndex(), xSize, ySize, doRemember, originPoint, lmode);
- if (dia->exec())
- {
- doRemember = dia->checkRemember->isChecked();
- if (lmode == 0)
- {
- xSize = dia->spinWidth->value() / unitGetRatioFromIndex(m_doc->unitIndex());
- ySize = dia->spinHeight->value() / unitGetRatioFromIndex(m_doc->unitIndex());
- originPoint = dia->RotationGroup->checkedId();
- if (doRemember)
- {
- sizes->set("defWidth", xSize);
- sizes->set("defHeight", ySize);
- sizes->set("Origin", originPoint);
- }
- }
- else
- {
- xSize = dia->spinWidth->value() / unitGetRatioFromIndex(m_doc->unitIndex());
- ySize = dia->spinHeight->value();
- originPoint = dia->RotationGroup->checkedId();
- if (doRemember)
- {
- sizes->set("defLength", xSize);
- sizes->set("defAngle", ySize);
- sizes->set("OriginL", originPoint);
- }
- }
- sizes->set("Remember", doRemember);
- doCreate = true;
- }
- else
- {
- m_view->Deselect(false);
- m_doc->Items->removeAt(currItem->ItemNr);
- }
- delete dia;
- }
- if (doCreate)
- {
- bool oldSnap = m_doc->SnapGuides;
- m_doc->SnapGuides = false;
- m_doc->SizeItem(xSize, ySize, currItem->ItemNr, false, false, false);
- currItem->updateClip();
- currItem->ContourLine = currItem->PoLine.copy();
- switch (originPoint)
- {
- case 0:
- break;
- case 1:
- if (lmode == 0)
- m_doc->MoveItem(-currItem->width(), 0.0, currItem, false);
- else
- m_doc->MoveRotated(currItem, FPoint(-currItem->width() / 2.0, 0.0), false);
- break;
- case 2:
- if (lmode == 0)
- m_doc->MoveItem(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem, false);
- else
- m_doc->MoveRotated(currItem, FPoint(-currItem->width(), 0.0), false);
- break;
- case 3:
- m_doc->MoveItem(0.0, -currItem->height(), currItem, false);
- break;
- case 4:
- m_doc->MoveItem(-currItem->width(), -currItem->height(), currItem, false);
- break;
- }
- m_doc->setRedrawBounding(currItem);
- currItem->OwnPage = m_doc->OnPage(currItem);
- currItem->OldB2 = currItem->width();
- currItem->OldH2 = currItem->height();
- currItem->Sizing = false;
- m_doc->SnapGuides = oldSnap;
- if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
- {
- m_view->requestMode(modeNormal);
-// m_view->requestMode(submodePaintingDone);
- }
- else
- {
- int appMode = m_doc->appMode;
- if ((inItemCreation) && (appMode == modeNormal))
- {
- currItem = m_doc->m_Selection->itemAt(0);
- if (currItem->asTextFrame())
- appMode = modeDrawText;
- else if (currItem->asImageFrame())
- appMode = modeDrawImage;
- else if (m_doc->SubMode != -1)
- appMode = modeDrawShapes;
- }
- m_view->requestMode(appMode);
- }
- currItem->update();
- m_doc->changed();
-// emit DocChanged();
- }
- else
- {
- m_view->requestMode(submodePaintingDone);
-// emit HaveSel(-1);
- }
- inItemCreation = false;
- m_doc->DragP = false;
- m_doc->leaveDrag = false;
-//FIXME m_canvas->m_viewMode.operItemResizing = false;
- m_canvas->setRenderModeUseBuffer(false);
- m_view->MidButt = false;
- shiftSelItems = false;
- m_view->updateCanvas();
- qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
- }
- }
- if (m_view->moveTimerElapsed() && (GetItem(&currItem)))
- {
- m_canvas->setRenderModeUseBuffer(false);
- if (m_doc->m_Selection->isMultipleSelection())
- {
-
- }
- else
- {
- //Where a single frame resize stops when the mouse buttno is released
- //FIXME: reduce code!
- if (currItem->Sizing)
- {
- FPoint npx;
- double nx = mousePointDoc.x(); //m_view->translateToDoc(m->x(), m->y()).x();
- double ny = mousePointDoc.y(); //m_view->translateToDoc(m->x(), m->y()).y();
- if (m_doc->SnapGuides)
- {
- m_doc->ApplyGuides(&nx, &ny);
- npx = FPoint(nx, ny, currItem->xPos(), currItem->yPos(), currItem->rotation(), 1, 1, true);
- }
- else
- {
- npx = m_doc->ApplyGridF(FPoint(nx, ny));
- npx = FPoint(npx.x(), npx.y(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1, 1, true);
- }
- if ((frameResizeHandle == 1) && !(currItem->asLine()) && (m_doc->SnapGuides))
- m_doc->SizeItem(npx.x(), npx.y(), currItem->ItemNr);
- bool sav = m_doc->SnapGuides;
- m_doc->SnapGuides = false;
- UndoTransaction* activeTransaction = NULL;
- if (UndoManager::undoEnabled())
- {
- activeTransaction = new UndoTransaction(m_view->undoManager->beginTransaction(currItem->getUName(), currItem->getUPixmap(),
- Um::Resize, QString(Um::ResizeFromTo).arg(currItem->width()).arg(currItem->height()).arg(currItem->width() - npx.x()).arg(currItem->height() - npx.y()), Um::IResize));
- }
-// m_canvas->m_viewMode.operItemResizing = false;
- switch (frameResizeHandle)
- {
- case 1:
- if (!currItem->asLine())
- {
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
- if (currItem->imageFlippedH())
- currItem->moveImageInFrame(-(currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- if (currItem->imageFlippedV())
- currItem->moveImageInFrame(0, -(currItem->height() - currItem->OldH2)/currItem->imageYScale());
- }
- else
- {
- if (sav)
- {
- double nx = mousePointDoc.x(); //m_view->translateToDoc(m->x(), m->y()).x();
- double ny = mousePointDoc.y(); //m_view->translateToDoc(m->x(), m->y()).y();
- if (m_doc->useRaster)
- {
- FPoint ra(m_doc->ApplyGridF(FPoint(nx, ny)));
- nx = ra.x();
- ny = ra.y();
- }
- m_doc->SnapGuides = sav;
- m_doc->ApplyGuides(&nx, &ny);
- m_doc->SnapGuides = false;
- double r = atan2(ny - currItem->yPos(), nx - currItem->xPos())*(180.0/M_PI);
- m_doc->RotateItem(r, currItem->ItemNr);
- double w = sqrt(pow(nx - currItem->xPos(), 2) + pow(ny - currItem->yPos(),2));
- m_doc->SizeItem(w, currItem->height(), currItem->ItemNr, true);
- }
- }
- currItem->Sizing = false;
- break;
- case 2:
- if (!currItem->asLine())
- {
- m_doc->MoveSizeItem(npx, npx, currItem->ItemNr);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- if (!currItem->imageFlippedH())
- {
- currItem->moveImageInFrame((currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- currItem->update();
- }
- if (!currItem->imageFlippedV())
- {
- currItem->moveImageInFrame(0, (currItem->height() - currItem->OldH2)/currItem->imageYScale());
- currItem->update();
- }
- }
- else
- {
- if (sav)
- {
- double nx = mousePointDoc.x(); //m_view->translateToDoc(m->x(), m->y()).x();
- double ny = mousePointDoc.y(); //m_view->translateToDoc(m->x(), m->y()).y();
- if (m_doc->useRaster)
- {
- FPoint ra(m_doc->ApplyGridF(FPoint(nx, ny)));
- nx = ra.x();
- ny = ra.y();
- }
- m_doc->SnapGuides = sav;
- m_doc->ApplyGuides(&nx, &ny);
- m_doc->SnapGuides = false;
- QTransform ma;
- ma.translate(currItem->xPos(), currItem->yPos());
- ma.rotate(currItem->rotation());
- double mx = ma.m11() * currItem->width() + ma.m21() * currItem->height() + ma.dx();
- double my = ma.m22() * currItem->height() + ma.m12() * currItem->width() + ma.dy();
- double r = atan2(my-ny,mx-nx)*(180.0/M_PI);
- double w = sqrt(pow(mx-nx,2)+pow(my-ny,2));
- m_doc->MoveItem(nx - currItem->xPos(), ny - currItem->yPos(), currItem, true);
- m_doc->SizeItem(w, currItem->height(), currItem->ItemNr, true);
- m_doc->RotateItem(r, currItem->ItemNr);
- currItem->Sizing = false;
- }
- }
- break;
- case 3:
- m_doc->MoveSizeItem(FPoint(0, npx.y()), FPoint(currItem->width() - npx.x(), npx.y()), currItem->ItemNr);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- if (currItem->imageFlippedH())
- currItem->moveImageInFrame(-(currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- if (!currItem->imageFlippedV())
- currItem->moveImageInFrame(0, (currItem->height() - currItem->OldH2)/currItem->imageYScale());
- break;
- case 4:
-
- m_doc->MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), currItem->height() - npx.y()), currItem->ItemNr);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- if (!currItem->imageFlippedH())
- currItem->moveImageInFrame((currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- if (currItem->imageFlippedV())
- currItem->moveImageInFrame(0, -(currItem->height() - currItem->OldH2)/currItem->imageYScale());
- break;
- case 5:
- m_doc->MoveSizeItem(FPoint(0, 0), FPoint(0, currItem->height() - npx.y()), currItem->ItemNr);
- if (currItem->imageFlippedV())
- currItem->moveImageInFrame(0, -(currItem->height() - currItem->OldH2)/currItem->imageYScale());
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- break;
- case 6:
- m_doc->MoveSizeItem(FPoint(0, 0), FPoint(currItem->width() - npx.x(), 0), currItem->ItemNr);
- if (currItem->imageFlippedH())
- currItem->moveImageInFrame(-(currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- break;
- case 7:
- m_doc->MoveSizeItem(FPoint(npx.x(), 0), FPoint(npx.x(), 0), currItem->ItemNr);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- if (!currItem->imageFlippedH())
- currItem->moveImageInFrame((currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- if (currItem->imageFlippedV())
- currItem->moveImageInFrame(0, -(currItem->height() - currItem->OldH2)/currItem->imageYScale());
- break;
- case 8:
- m_doc->MoveSizeItem(FPoint(0, npx.y()), FPoint(0, npx.y()), currItem->ItemNr);
-
- //<<Swap location if width/height is <0
- if (currItem->width()<0)
- {
- currItem->setWidth(-currItem->width());
- currItem->setXPos(currItem->xPos()-currItem->width());
- }
- if (currItem->height()<0)
- {
- currItem->setHeight(-currItem->height());
- currItem->setYPos(currItem->yPos()-currItem->height());
- }
- //>>
-
- currItem->Sizing = false;
- if (currItem->imageFlippedH())
- currItem->moveImageInFrame(-(currItem->width() - currItem->OldB2)/currItem->imageXScale(), 0);
- if (!currItem->imageFlippedV())
- currItem->moveImageInFrame(0, (currItem->height() - currItem->OldH2)/currItem->imageYScale());
- break;
- }
-
- currItem->updateClip();
-// emit ItemTextCols(currItem->Cols, currItem->ColGap);
- m_doc->SnapGuides = sav;
-// evSpon = false;
- currItem->update(); // MoveSizeItem *should* call PageItem::update
- m_view->updateCanvas();
-// emit DocChanged();
- currItem->checkChanges();
- if (activeTransaction)
- {
- activeTransaction->commit();
- delete activeTransaction;
- activeTransaction = NULL;
- }
- }
- m_doc->setRedrawBounding(currItem);
- currItem->OwnPage = m_doc->OnPage(currItem);
-// m_canvas->m_viewMode.operItemResizing = false;
- if (currItem->asLine())
- m_view->updateCanvas();
- }
- }
- //CB Drag selection performed here
- if (((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt)) || ((shiftSelItems) && (m_view->HaveSelRect) && (!m_view->MidButt)))
- {
- QRectF Sele = QRectF(Dxp, Dyp, SeRx-Dxp, SeRy-Dyp).normalized();
- if (!m_doc->masterPageMode())
- {
- uint docPagesCount=m_doc->Pages->count();
- uint docCurrPageNo=m_doc->currentPageNumber();
- for (uint i = 0; i < docPagesCount; ++i)
- {
- if (QRectF(m_doc->Pages->at(i)->xOffset(), m_doc->Pages->at(i)->yOffset(), m_doc->Pages->at(i)->width(), m_doc->Pages->at(i)->height()).intersects(Sele))
- {
- if (docCurrPageNo != i)
- {
- m_doc->setCurrentPage(m_doc->Pages->at(i));
- m_view->setMenTxt(i);
- }
- break;
- }
- }
-//FIXME m_view->setRulerPos(m_view->contentsX(), m_view->contentsY());
- }
-/* FIXME
- int docItemCount=m_doc->Items->count();
- if (docItemCount != 0)
- {
- m_doc->m_Selection->setIsGUISelection(false);
- for (int a = 0; a < docItemCount; ++a)
- {
- PageItem* docItem = m_doc->Items->at(a);
- QTransform p;
- m_canvas->Transform(docItem, p);
- QRegion apr = QRegion(docItem->Clip * p);
- QRect apr2(docItem->getRedrawBounding(1.0));
- if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
- continue;
- //CB Finally Items are selected here
- if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
- {
- //CB set draw to true to (dis)enable some actions via emit to HaveNewSel in scapp.
- //CB FIXME emit from selection when multiple selected instead
- //CB #3523 bool redrawSelection=(a==docItemCount-1);
- bool redrawSelection=false;
- m_view->SelectItemNr(a, redrawSelection);
- }
- }
- m_doc->m_Selection->setIsGUISelection(true);
- m_doc->m_Selection->connectItemToGUI();
- if (m_doc->m_Selection->count() > 1)
- {
- m_doc->m_Selection->setGroupRect();
- double x, y, w, h;
- m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-// emit ItemPos(x, y);
-// emit ItemGeom(w, h);
- m_view->getGroupRectScreen(&x, &y, &w, &h);
- }
-// if (m_doc->m_Selection->count() > 0)
-// emit HaveSel(m_doc->m_Selection->itemAt(0)->itemType());
- }*/
-
- m_view->HaveSelRect = false;
- shiftSelItems = false;
- m_view->redrawMarker->hide();
- m_view->updateCanvas();
- }
- if (m_doc->appMode != modeEdit)
- {
- if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
- {
-// qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
- m_view->requestMode(modeNormal);
-// m_view->requestMode(submodePaintingDone);
- }
- else
- {
- int appMode = m_doc->appMode;
- if ((inItemCreation) && (appMode == modeNormal))
- {
- currItem = m_doc->m_Selection->itemAt(0);
- if (currItem->asTextFrame())
- appMode = modeDrawText;
- else if (currItem->asImageFrame())
- appMode = modeDrawImage;
- else if (m_doc->SubMode != -1)
- appMode = modeDrawShapes;
- }
- m_view->requestMode(appMode);
- }
- }
- if (GetItem(&currItem))
- {
- if (m_doc->m_Selection->count() > 1)
- {
- m_doc->m_Selection->setGroupRect();
- //CB shouldnt need this i think
- //emit HaveSel(currItem->itemType());
- double x, y, w, h;
- m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-// emit ItemPos(x, y);
-// emit ItemGeom(w, h);
-// m_view->getGroupRectScreen(&x, &y, &w, &h);
-
-// m_canvas->m_viewMode.operItemResizing = false;
- m_canvas->update(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
- }
- else
- currItem->emitAllToGUI();
-
- /*else
- {
- //CB Dont think we need this here with the new selection code
- //For a select, deselect operation, this will cause 2x emit
- //emit HaveSel(currItem->itemType());
- //EmitValues(currItem);
- //currItem->emitAllToGUI();
- }*/
- }
- }
-
-
m_canvas->setRenderModeUseBuffer(false);
m_doc->DragP = false;
m_doc->leaveDrag = false;
// m_canvas->m_viewMode.operItemResizing = false;
m_view->MidButt = false;
- shiftSelItems = false;
- inItemCreation = false;
// m_doc->SubMode = -1;
if (m_view->groupTransactionStarted())
{
Modified: branches/ScribusOIF/scribus/canvasmode_drawfreehand.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/canvasmode_drawfreehand.h
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_drawfreehand.h (original)
+++ branches/ScribusOIF/scribus/canvasmode_drawfreehand.h Sun Nov 14 11:41:11 2010
@@ -49,14 +49,8 @@
inline bool GetItem(PageItem** pi);
void selectPage(QMouseEvent *m);
- int Cp, oldCp;
- bool inItemCreation, shiftSelItems, FirstPoly;
- bool m_MouseButtonPressed;
- int frameResizeHandle;
- int RotMode;
- int dragConstrainInitPtX, dragConstrainInitPtY;
+ bool m_MouseButtonPressed;
double Mxp, Myp, Dxp, Dyp;
- int GxM, GyM;
double SeRx, SeRy;
bool MoveGX, MoveGY;
FPointArray RecordP;
Modified: branches/ScribusOIF/scribus/collect4output.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/collect4output.cpp
==============================================================================
--- branches/ScribusOIF/scribus/collect4output.cpp (original)
+++ branches/ScribusOIF/scribus/collect4output.cpp Sun Nov 14 11:41:11 2010
@@ -342,7 +342,9 @@
{
QStringList metricsFiles;
QString basePath = baseDir + "/" + baseName;
- QString afnm = basePath.left(basePath.length()-3);
+ QString afnm(basePath);
+ afnm.chop(3);
+
// Look for afm files
QString afmName(afnm+"afm");
if(QFile::exists(afmName))
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Nov 14 11:41:11 2010
@@ -920,6 +920,14 @@
doc->itemToolPrefs().shapeLineColorShade = attrs.valueAsInt("PENSHADE", 100);
doc->itemToolPrefs().lineColorShade = attrs.valueAsInt("LINESHADE", 100);
doc->itemToolPrefs().shapeFillColorShade = attrs.valueAsInt("BRUSHSHADE", 100);
+ doc->itemToolPrefs().calligrapicPenFillColor = attrs.valueAsString("calligrapicPenFillColor", "Black");
+ doc->itemToolPrefs().calligrapicPenLineColor = attrs.valueAsString("calligrapicPenLineColor", "Black");
+ doc->itemToolPrefs().calligrapicPenFillColorShade = attrs.valueAsInt("calligrapicPenFillColorShade", 100);
+ doc->itemToolPrefs().calligrapicPenLineColorShade = attrs.valueAsInt("calligrapicPenLineColorShade", 100);
+ doc->itemToolPrefs().calligrapicPenLineWidth = attrs.valueAsDouble("calligrapicPenLineWidth", 1.0);
+ doc->itemToolPrefs().calligrapicPenAngle = attrs.valueAsDouble("calligrapicPenAngle", 0.0);
+ doc->itemToolPrefs().calligrapicPenWidth = attrs.valueAsDouble("calligrapicPenWidth", 10.0);
+ doc->itemToolPrefs().calligrapicPenStyle = static_cast<Qt::PenStyle>(attrs.valueAsInt("calligrapicPenStyle"));
doc->opToolPrefs().magMin = attrs.valueAsInt("MAGMIN", 1);
doc->opToolPrefs().magMax = attrs.valueAsInt("MAGMAX", 3200);
doc->opToolPrefs().magStep = attrs.valueAsInt("MAGSTEP", 200);
Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun Nov 14 11:41:11 2010
@@ -235,6 +235,14 @@
docu.writeAttribute("MARGC",m_Doc->guidesPrefs().marginColor.name());
docu.writeAttribute("RANDF", static_cast<int>(m_Doc->marginColored()));
docu.writeAttribute("currentProfile", m_Doc->curCheckProfile());
+ docu.writeAttribute("calligrapicPenFillColor", m_Doc->itemToolPrefs().calligrapicPenFillColor);
+ docu.writeAttribute("calligrapicPenLineColor", m_Doc->itemToolPrefs().calligrapicPenLineColor);
+ docu.writeAttribute("calligrapicPenFillColorShade", m_Doc->itemToolPrefs().calligrapicPenFillColorShade);
+ docu.writeAttribute("calligrapicPenLineColorShade", m_Doc->itemToolPrefs().calligrapicPenLineColorShade);
+ docu.writeAttribute("calligrapicPenLineWidth", m_Doc->itemToolPrefs().calligrapicPenLineWidth);
+ docu.writeAttribute("calligrapicPenAngle", m_Doc->itemToolPrefs().calligrapicPenAngle);
+ docu.writeAttribute("calligrapicPenWidth", m_Doc->itemToolPrefs().calligrapicPenWidth);
+ docu.writeAttribute("calligrapicPenStyle", m_Doc->itemToolPrefs().calligrapicPenStyle);
writeCheckerProfiles(docu);
writeLinestyles(docu);
Modified: branches/ScribusOIF/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/prefsmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/prefsmanager.cpp (original)
+++ branches/ScribusOIF/scribus/prefsmanager.cpp Sun Nov 14 11:41:11 2010
@@ -220,6 +220,16 @@
appPrefs.itemToolPrefs.textStrokeShade = 100;
appPrefs.itemToolPrefs.textTabFillChar = "";
appPrefs.itemToolPrefs.textTabWidth = 36.0;
+ // defaults for calligraphic pen
+ appPrefs.itemToolPrefs.calligrapicPenFillColor = "Black";
+ appPrefs.itemToolPrefs.calligrapicPenLineColor = "Black";
+ appPrefs.itemToolPrefs.calligrapicPenFillColorShade = 100;
+ appPrefs.itemToolPrefs.calligrapicPenLineColorShade = 100;
+ appPrefs.itemToolPrefs.calligrapicPenLineWidth = 1.0;
+ appPrefs.itemToolPrefs.calligrapicPenAngle = 0.0;
+ appPrefs.itemToolPrefs.calligrapicPenWidth = 10.0;
+ appPrefs.itemToolPrefs.calligrapicPenStyle = Qt::SolidLine;
+
appPrefs.opToolPrefs.dispX = 10.0;
appPrefs.opToolPrefs.dispY = 10.0;
appPrefs.opToolPrefs.constrain = 15.0;
@@ -1068,6 +1078,10 @@
bool PrefsManager::isToolColor(const struct ItemToolPrefs& settings, const QString& name)
{
+ if (settings.calligrapicPenLineColor == name)
+ return true;
+ if (settings.calligrapicPenFillColor == name)
+ return true;
if (settings.textColor == name)
return true;
if (settings.textStrokeColor == name)
@@ -1110,6 +1124,10 @@
names.append(settings.lineColor);
if (!names.contains(settings.imageFillColor))
names.append(settings.imageFillColor);
+ if (!names.contains(settings.calligrapicPenFillColor))
+ names.append(settings.calligrapicPenFillColor);
+ if (!names.contains(settings.calligrapicPenLineColor))
+ names.append(settings.calligrapicPenLineColor);
return names;
}
@@ -1136,6 +1154,10 @@
settings.lineColor = replaceMap[settings.lineColor];
if (replaceMap.contains(settings.imageFillColor))
settings.imageFillColor = replaceMap[settings.imageFillColor];
+ if (replaceMap.contains(settings.calligrapicPenFillColor))
+ settings.calligrapicPenFillColor = replaceMap[settings.calligrapicPenFillColor];
+ if (replaceMap.contains(settings.calligrapicPenLineColor))
+ settings.calligrapicPenLineColor = replaceMap[settings.calligrapicPenLineColor];
}
void PrefsManager::setColorSet(const ColorList& colorSet)
@@ -1166,6 +1188,12 @@
QString brushPict = appPrefs.itemToolPrefs.imageFillColor;
if (!tmpSet.contains(brushPict) && brushPict != CommonStrings::None)
tmpSet[brushPict] = appPrefs.colorPrefs.DColors[brushPict];
+ QString brushCpen = appPrefs.itemToolPrefs.calligrapicPenFillColor;
+ if (!tmpSet.contains(brushCpen) && brushCpen != CommonStrings::None)
+ tmpSet[brushCpen] = appPrefs.colorPrefs.DColors[brushCpen];
+ QString brushCpen2 = appPrefs.itemToolPrefs.calligrapicPenLineColor;
+ if (!tmpSet.contains(brushCpen2) && brushCpen2 != CommonStrings::None)
+ tmpSet[brushCpen2] = appPrefs.colorPrefs.DColors[brushCpen2];
appPrefs.colorPrefs.DColors = tmpSet;
}
@@ -1447,6 +1475,14 @@
dcItemTools.setAttribute("LineEndArrow", appPrefs.itemToolPrefs.lineEndArrow);
dcItemTools.setAttribute("FontFace",appPrefs.itemToolPrefs.textFont);
dcItemTools.setAttribute("FontSize",appPrefs.itemToolPrefs.textSize / 10.0);
+ dcItemTools.setAttribute("calligrapicPenFillColor", appPrefs.itemToolPrefs.calligrapicPenFillColor);
+ dcItemTools.setAttribute("calligrapicPenLineColor", appPrefs.itemToolPrefs.calligrapicPenLineColor);
+ dcItemTools.setAttribute("calligrapicPenFillColorShade", appPrefs.itemToolPrefs.calligrapicPenFillColorShade);
+ dcItemTools.setAttribute("calligrapicPenLineColorShade", appPrefs.itemToolPrefs.calligrapicPenLineColorShade);
+ dcItemTools.setAttribute("calligrapicPenLineWidth", appPrefs.itemToolPrefs.calligrapicPenLineWidth);
+ dcItemTools.setAttribute("calligrapicPenAngle", appPrefs.itemToolPrefs.calligrapicPenAngle);
+ dcItemTools.setAttribute("calligrapicPenWidth", appPrefs.itemToolPrefs.calligrapicPenWidth);
+ dcItemTools.setAttribute("calligrapicPenStyle",appPrefs.itemToolPrefs.calligrapicPenStyle);
elem.appendChild(dcItemTools);
QDomElement dcOperatorTools=docu.createElement("OperatorTools");
@@ -1967,6 +2003,14 @@
if (dc.tagName()=="ItemTools")
{
+ appPrefs.itemToolPrefs.calligrapicPenFillColor = dc.attribute("calligrapicPenFillColor", "Black");
+ appPrefs.itemToolPrefs.calligrapicPenLineColor = dc.attribute("calligrapicPenLineColor", "Black");
+ appPrefs.itemToolPrefs.calligrapicPenFillColorShade = dc.attribute("calligrapicPenFillColorShade", "100").toInt();
+ appPrefs.itemToolPrefs.calligrapicPenLineColorShade = dc.attribute("calligrapicPenLineColorShade", "100").toInt();
+ appPrefs.itemToolPrefs.calligrapicPenLineWidth = ScCLocale::toDoubleC(dc.attribute("calligrapicPenLineWidth"), 1.0);
+ appPrefs.itemToolPrefs.calligrapicPenAngle = ScCLocale::toDoubleC(dc.attribute("calligrapicPenAngle"), 0.0);
+ appPrefs.itemToolPrefs.calligrapicPenWidth = ScCLocale::toDoubleC(dc.attribute("calligrapicPenWidth"), 10.0);
+ appPrefs.itemToolPrefs.calligrapicPenStyle = dc.attribute("calligrapicPenStyle").toInt();
appPrefs.itemToolPrefs.shapeLineColor = dc.attribute("ShapeLineColor");
appPrefs.itemToolPrefs.shapeFillColor = dc.attribute("ShapeFillColor", CommonStrings::None);
appPrefs.itemToolPrefs.lineColor = dc.attribute("LineColor");
Modified: branches/ScribusOIF/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/prefsstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/prefsstructs.h (original)
+++ branches/ScribusOIF/scribus/prefsstructs.h Sun Nov 14 11:41:11 2010
@@ -214,6 +214,15 @@
bool imageAspectRatio; //! Use stored aspect ratio for the image
int imageLowResType; //! Preview type for an image frame
bool imageUseEmbeddedPath; //! Use embedded path, eg from an EPS etc.
+ /* Calligraphic Pen Tool */
+ QString calligrapicPenFillColor; //! Default calligrapicPen fill color
+ QString calligrapicPenLineColor; //! Default calligrapicPen line color
+ int calligrapicPenFillColorShade; //! Default calligrapicPen fill shade
+ int calligrapicPenLineColorShade; //! Default calligrapicPen line shade
+ double calligrapicPenLineWidth; //! Width of line
+ double calligrapicPenAngle; //! Angle of the calligraphics Brush
+ double calligrapicPenWidth; //! Width of the calligraphics Brush
+ int calligrapicPenStyle; //! Line style of the calligraphics Brush
};
struct OperatorToolPrefs
Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Sun Nov 14 11:41:11 2010
@@ -791,6 +791,7 @@
scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert", false);
+ scrMenuMgr->addMenuItem(scrActions["toolsInsertCalligraphicLine"], "Insert", false);
scrMenuMgr->addMenuSeparator("Insert");
scrMenuMgr->addMenuItem(scrActions["stickyTools"], "Insert", true);
scrMenuMgr->addMenuSeparator("Insert");
@@ -2176,6 +2177,8 @@
tocGenerator->setDoc(doc);
styleManager->setDoc(doc);
symbolPalette->setDoc(doc);
+ modeToolBar->Angle->setValue(doc->itemToolPrefs().calligrapicPenAngle);
+ modeToolBar->PWidth->setValue(doc->itemToolPrefs().calligrapicPenWidth);
// Give plugins a chance to react on changing the current document
PluginManager& pluginManager(PluginManager::instance());
QStringList pluginNames(pluginManager.pluginNames(false));
@@ -2366,6 +2369,7 @@
scrActions["toolsInsertLine"]->setEnabled(true);
scrActions["toolsInsertBezier"]->setEnabled(true);
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsMeasurements"]->setEnabled(true);
@@ -4509,6 +4513,7 @@
scrActions["toolsInsertLine"]->setEnabled(false);
scrActions["toolsInsertBezier"]->setEnabled(false);
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
@@ -6044,6 +6049,7 @@
scrActions["toolsInsertLine"]->setEnabled(false);
scrActions["toolsInsertBezier"]->setEnabled(false);
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
@@ -6124,6 +6130,7 @@
scrActions["toolsInsertLine"]->setEnabled(true);
scrActions["toolsInsertBezier"]->setEnabled(true);
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsPDFPushButton"]->setEnabled(true);
@@ -6217,6 +6224,7 @@
scrActions["toolsInsertLine"]->setChecked(mode==modeDrawLine);
scrActions["toolsInsertBezier"]->setChecked(mode==modeDrawBezierLine);
scrActions["toolsInsertFreehandLine"]->setChecked(mode==modeDrawFreehandLine);
+ scrActions["toolsInsertCalligraphicLine"]->setChecked(mode == modeDrawCalligraphicLine);
scrActions["toolsInsertRenderFrame"]->setChecked(mode==modeDrawLatex);
scrActions["toolsRotate"]->setChecked(mode==modeRotation);
scrActions["toolsZoom"]->setChecked(mode==modeMagnifier);
@@ -6418,6 +6426,7 @@
case modeDrawBezierLine:
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
+ case modeDrawCalligraphicLine:
case modeDrawFreehandLine:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
break;
@@ -8954,6 +8963,7 @@
scrActions["toolsInsertLine"]->setEnabled(setter);
scrActions["toolsInsertBezier"]->setEnabled(setter);
scrActions["toolsInsertFreehandLine"]->setEnabled(setter);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(setter);
scrActions["toolsInsertPolygon"]->setEnabled(setter);
scrActions["toolsInsertRenderFrame"]->setEnabled(setter);
if (doc->masterPageMode())
Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Sun Nov 14 11:41:11 2010
@@ -397,6 +397,10 @@
docPrefsData.itemToolPrefs.textFillColor = appPrefsData.itemToolPrefs.textFillColor;
if (appPrefsData.itemToolPrefs.textLineColor != CommonStrings::None)
PageColors.insert(appPrefsData.itemToolPrefs.textLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textLineColor]);
+ if (appPrefsData.itemToolPrefs.calligrapicPenFillColor != CommonStrings::None)
+ PageColors.insert(appPrefsData.itemToolPrefs.calligrapicPenFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.calligrapicPenFillColor]);
+ if (appPrefsData.itemToolPrefs.calligrapicPenLineColor != CommonStrings::None)
+ PageColors.insert(appPrefsData.itemToolPrefs.calligrapicPenLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.calligrapicPenLineColor]);
ParagraphStyle pstyle;
Modified: branches/ScribusOIF/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/scribusstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusstructs.h (original)
+++ branches/ScribusOIF/scribus/scribusstructs.h Sun Nov 14 11:41:11 2010
@@ -497,7 +497,8 @@
modeDrawLatex,
modeImportObject,
modeInsertPDF3DAnnotation,
- modeEditMeshGradient
+ modeEditMeshGradient,
+ modeDrawCalligraphicLine
};
struct AlignObjs
Modified: branches/ScribusOIF/scribus/ui/about.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/ui/about.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/about.cpp (original)
+++ branches/ScribusOIF/scribus/ui/about.cpp Sun Nov 14 11:41:11 2010
@@ -114,7 +114,7 @@
buildID = new QLabel( tab );
buildID->setAlignment(Qt::AlignCenter);
buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
- QString BUILD_DAY = "7";
+ QString BUILD_DAY = "14";
QString BUILD_MONTH = CommonStrings::november;
QString BUILD_YEAR = "2010";
QString BUILD_TIME = "";
Modified: branches/ScribusOIF/scribus/ui/modetoolbar.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/ui/modetoolbar.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/modetoolbar.cpp (original)
+++ branches/ScribusOIF/scribus/ui/modetoolbar.cpp Sun Nov 14 11:41:11 2010
@@ -34,6 +34,7 @@
#include "scraction.h"
#include "scribus.h"
#include "scribusdoc.h"
+#include "scrspinbox.h"
#include "util.h"
ModeToolBar::ModeToolBar(ScribusMainWindow* parent) : ScToolBar( tr("Tools"), "Tools", parent, Qt::Vertical)
@@ -73,6 +74,31 @@
this->addAction(m_ScMW->scrActions["toolsInsertLine"]);
this->addAction(m_ScMW->scrActions["toolsInsertBezier"]);
this->addAction(m_ScMW->scrActions["toolsInsertFreehandLine"]);
+
+ propWidget = new QWidget();
+ group1Layout = new QGridLayout( propWidget );
+ group1Layout->setSpacing( 3 );
+ group1Layout->setMargin( 0 );
+ group1Layout->setAlignment( Qt::AlignTop );
+ Angle = new ScrSpinBox( -180, 180, propWidget, 6 );
+ Angle->setValue( 0 );
+ AngleTxt = new QLabel( tr("Angle:"), propWidget );
+ group1Layout->addWidget( Angle, 0, 1 );
+ group1Layout->addWidget( AngleTxt, 0 , 0 );
+ PWidth = new ScrSpinBox( 0, 100, propWidget, 0 );
+ PWidth->setValue( 5 );
+ PWidthTxt = new QLabel( tr("Width:"), propWidget );
+ group1Layout->addWidget( PWidth, 1, 1 );
+ group1Layout->addWidget( PWidthTxt, 1 , 0 );
+ calPop = new QMenu();
+ calValAct = new QWidgetAction(this);
+ calValAct->setDefaultWidget(propWidget);
+ calPop->addAction(calValAct);
+ this->addAction(m_ScMW->scrActions["toolsInsertCalligraphicLine"]);
+ m_ScMW->scrActions["toolsInsertCalligraphicLine"]->setMenu(calPop);
+ QToolButton* tb3 = dynamic_cast<QToolButton*>(this->widgetForAction(m_ScMW->scrActions["toolsInsertCalligraphicLine"]));
+ tb3->setPopupMode(QToolButton::MenuButtonPopup);
+
this->addAction(m_ScMW->scrActions["toolsRotate"]);
this->addAction(m_ScMW->scrActions["toolsZoom"]);
this->addAction(m_ScMW->scrActions["toolsEditContents"]);
@@ -85,6 +111,14 @@
languageChange();
connect(Rechteck, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(SelShape(int, int, qreal *)));
+ connect(Angle, SIGNAL(valueChanged(double)), this, SLOT(newCalValues()));
+ connect(PWidth, SIGNAL(valueChanged(double)), this, SLOT(newCalValues()));
+}
+
+void ModeToolBar::newCalValues()
+{
+ m_ScMW->doc->itemToolPrefs().calligrapicPenAngle = Angle->value();
+ m_ScMW->doc->itemToolPrefs().calligrapicPenWidth = PWidth->value();
}
void ModeToolBar::GetPolyProps()
@@ -118,6 +152,8 @@
void ModeToolBar::languageChange()
{
+ AngleTxt->setText(tr("Angle:"));
+ PWidthTxt->setText(tr("Width:"));
idInsertPolygonButtonMenu->setText( tr("Properties..."));
ScToolBar::languageChange();
}
Modified: branches/ScribusOIF/scribus/ui/modetoolbar.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/ui/modetoolbar.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/modetoolbar.h (original)
+++ branches/ScribusOIF/scribus/ui/modetoolbar.h Sun Nov 14 11:41:11 2010
@@ -29,6 +29,9 @@
#include <QAction>
#include <QMenu>
#include <QWidgetAction>
+#include <QGridLayout>
+#include <QLabel>
+#include <QWidget>
class QEvent;
@@ -36,6 +39,7 @@
class AutoformButtonGroup;
class ScribusMainWindow;
class WidgetPopupMenu2;
+class ScrSpinBox;
/**
*@author Franz Schmid
@@ -52,10 +56,13 @@
int SubMode;
int ValCount;
double *ShapeVals;
+ ScrSpinBox *Angle;
+ ScrSpinBox *PWidth;
virtual void changeEvent(QEvent *e);
public slots:
+ void newCalValues();
void GetPolyProps();
void SelShape(int s, int c, qreal *vals);
void languageChange();
@@ -67,6 +74,12 @@
QMenu* insertPolygonButtonMenu;
QAction* idInsertPolygonButtonMenu;
ScribusMainWindow* m_ScMW;
+ QWidget *propWidget;
+ QGridLayout* group1Layout;
+ QMenu* calPop;
+ QWidgetAction* calValAct;
+ QLabel *AngleTxt;
+ QLabel *PWidthTxt;
};
#endif
Modified: branches/ScribusOIF/scribus/ui/prefs_itemtools.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/ui/prefs_itemtools.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_itemtools.cpp (original)
+++ branches/ScribusOIF/scribus/ui/prefs_itemtools.cpp Sun Nov 14 11:41:11 2010
@@ -25,13 +25,24 @@
setupUi(this);
lineEndArrowComboBox->setStartDirection(false);
shapeLineWidthSpinBox->setNewUnit(0);
+ shapeLineWidthSpinBox->setMaximum(36);
+ shapeLineWidthSpinBox->setDecimals(1);
lineWidthSpinBox->setNewUnit(0);
- shapeLineWidthSpinBox->setMaximum(36);
lineWidthSpinBox->setMaximum(36);
- shapeLineWidthSpinBox->setDecimals(1);
lineWidthSpinBox->setDecimals(1);
+ calPenLineWidthSpinBox->setNewUnit(0);
+ calPenLineWidthSpinBox->setMaximum(36);
+ calPenLineWidthSpinBox->setDecimals(1);
+ calPenWidthSpinBox->setNewUnit(0);
+ calPenWidthSpinBox->setMaximum(100);
+ calPenWidthSpinBox->setDecimals(1);
+ calPenAngleSpinBox->setNewUnit(6);
+ calPenAngleSpinBox->setMaximum(180);
+ calPenAngleSpinBox->setMinimum(-180);
+ calPenAngleSpinBox->setDecimals(0);
shapeLineWidthSpinBox->setSpecialValueText( tr("Hairline"));
lineWidthSpinBox->setSpecialValueText( tr("Hairline"));
+ calPenLineWidthSpinBox->setSpecialValueText( tr("Hairline"));
textSizeSpinBox->setNewUnit(0);
textSizeSpinBox->setMinimum(0.5);
textSizeSpinBox->setMaximum(2048);
@@ -173,6 +184,15 @@
lineEndArrowComboBox->setCurrentIndex(prefsData->itemToolPrefs.lineEndArrow);
lineWidthSpinBox->setValue(prefsData->itemToolPrefs.lineWidth);
//
+ //Calligraphic Pen Tool
+ calPenFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligrapicPenFillColor);
+ calPenFillShadingSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenFillColorShade);
+ calPenColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligrapicPenLineColor);
+ calPenLineShadingSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenLineColorShade);
+ calPenStyleComboBox->setCurrentIndex(static_cast<int>(prefsData->itemToolPrefs.calligrapicPenStyle) - 1);
+ calPenLineWidthSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenLineWidth);
+ calPenAngleSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenAngle);
+ calPenWidthSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenWidth);
enableSignals(true);
}
@@ -279,6 +299,19 @@
prefsData->itemToolPrefs.lineWidth = lineWidthSpinBox->value();
prefsData->itemToolPrefs.lineStartArrow = lineStartArrowComboBox->currentIndex();
prefsData->itemToolPrefs.lineEndArrow = lineEndArrowComboBox->currentIndex();
+ //Calligraphic Pen Tool
+ prefsData->itemToolPrefs.calligrapicPenFillColor = calPenFillColorComboBox->currentText();
+ if (prefsData->itemToolPrefs.calligrapicPenFillColor == CommonStrings::tr_NoneColor)
+ prefsData->itemToolPrefs.calligrapicPenFillColor = CommonStrings::None;
+ prefsData->itemToolPrefs.calligrapicPenLineColor = calPenColorComboBox->currentText();
+ if (prefsData->itemToolPrefs.calligrapicPenLineColor == CommonStrings::tr_NoneColor)
+ prefsData->itemToolPrefs.calligrapicPenLineColor = CommonStrings::None;
+ prefsData->itemToolPrefs.calligrapicPenFillColorShade = calPenFillShadingSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenLineColorShade = calPenLineShadingSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenStyle = static_cast<Qt::PenStyle>(calPenStyleComboBox->currentIndex()) + 1;
+ prefsData->itemToolPrefs.calligrapicPenLineWidth = calPenLineWidthSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenAngle = calPenAngleSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenWidth = calPenWidthSpinBox->value();
}
void Prefs_ItemTools::enableSignals(bool on)
Modified: branches/ScribusOIF/scribus/ui/prefs_itemtoolsbase.ui
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/scribus/ui/prefs_itemtoolsbase.ui
==============================================================================
--- branches/ScribusOIF/scribus/ui/prefs_itemtoolsbase.ui (original)
+++ branches/ScribusOIF/scribus/ui/prefs_itemtoolsbase.ui Sun Nov 14 11:41:11 2010
@@ -79,8 +79,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>614</width>
- <height>720</height>
+ <width>637</width>
+ <height>632</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -651,8 +651,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>629</width>
- <height>622</height>
+ <width>637</width>
+ <height>632</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -1299,6 +1299,141 @@
<size>
<width>20</width>
<height>428</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_4">
+ <attribute name="title">
+ <string>Calligraphic Pen</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_45">
+ <property name="text">
+ <string>Fill Color:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="ColorCombo" name="calPenFillColorComboBox"/>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_49">
+ <property name="text">
+ <string>Shading:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QSpinBox" name="calPenFillShadingSpinBox">
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_50">
+ <property name="text">
+ <string>Line Color:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="ColorCombo" name="calPenColorComboBox"/>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_48">
+ <property name="text">
+ <string>Shading:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QSpinBox" name="calPenLineShadingSpinBox">
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_47">
+ <property name="text">
+ <string>Line Style:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="LineCombo" name="calPenStyleComboBox"/>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="label_51">
+ <property name="text">
+ <string>Pen Angle:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="ScrSpinBox" name="calPenAngleSpinBox"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_46">
+ <property name="text">
+ <string>Line Width:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="ScrSpinBox" name="calPenLineWidthSpinBox"/>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLabel" name="label_52">
+ <property name="text">
+ <string>Pen Width:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="ScrSpinBox" name="calPenWidthSpinBox"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_16">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>501</height>
</size>
</property>
</spacer>
Modified: branches/ScribusOIF/win32/vc8/Scribus.vcproj
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15854&path=/branches/ScribusOIF/win32/vc8/Scribus.vcproj
==============================================================================
--- branches/ScribusOIF/win32/vc8/Scribus.vcproj (original)
+++ branches/ScribusOIF/win32/vc8/Scribus.vcproj Sun Nov 14 11:41:11 2010
@@ -639,6 +639,10 @@
>
</File>
<File
+ RelativePath="..\..\scribus\canvasmode_drawcalligraphic.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\scribus\canvasmode_drawfreehand.cpp"
>
</File>
@@ -2844,6 +2848,10 @@
>
</File>
<File
+ RelativePath="..\..\scribus\canvasmode_drawcalligraphic.h"
+ >
+ </File>
+ <File
RelativePath="..\..\scribus\canvasmode_drawfreehand.h"
>
</File>
@@ -13320,11 +13328,11 @@
>
</File>
<File
+ RelativePath="..\..\resources\translations\po\scribus.de_1901.ts"
+ >
+ </File>
+ <File
RelativePath="..\..\resources\translations\po\scribus.de_CH.ts"
- >
- </File>
- <File
- RelativePath="..\..\resources\translations\po\scribus.de_ol.ts"
>
</File>
<File
More information about the scribus-commit
mailing list