~ubuntu-branches/ubuntu/wily/scribus/wily-proposed

« back to all changes in this revision

Viewing changes to scribus/pslib.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1018
1018
        PutStream("newpath\n");
1019
1019
}
1020
1020
 
1021
 
void PSLib::PS_MultiRadGradient(double w, double h, double x, double y, QList<double> Stops, QStringList Colors, QStringList colorNames, QList<int> colorShades)
 
1021
void PSLib::PS_MultiRadGradient(double w, double h, double x, double y, QList<double> Stops, QStringList Colors, QStringList colorNames, QList<int> colorShades, bool fillRule)
1022
1022
{
1023
1023
        bool first = true;
1024
1024
        bool oneSameSpot = false;
1031
1031
        int kc = 0;
1032
1032
        CMYKColor cmykValues;
1033
1033
        PutStream( "clipsave\n" );
1034
 
        PutStream("eoclip\n");
 
1034
        PutStream( fillRule ? "eoclip\n" : "clip\n" );
1035
1035
        for (int c = 0; c < Colors.count()-1; ++c)
1036
1036
        {
1037
1037
                oneSameSpot = false;
1198
1198
        PutStream("cliprestore\n");
1199
1199
}
1200
1200
 
1201
 
void PSLib::PS_MultiLinGradient(double w, double h, QList<double> Stops, QStringList Colors, QStringList colorNames, QList<int> colorShades)
 
1201
void PSLib::PS_MultiLinGradient(double w, double h, QList<double> Stops, QStringList Colors, QStringList colorNames, QList<int> colorShades, bool fillRule)
1202
1202
{
1203
1203
        bool first = true;
1204
1204
        bool oneSameSpot = false;
1211
1211
        int kc = 0;
1212
1212
        CMYKColor cmykValues;
1213
1213
        PutStream( "clipsave\n" );
1214
 
        PutStream("eoclip\n");
 
1214
        PutStream( fillRule ? "eoclip\n" : "clip\n");
1215
1215
        for (int c = 0; c < Colors.count()-1; ++c)
1216
1216
        {
1217
1217
                oneSameSpot = false;
1443
1443
                {
1444
1444
                        PutStream("currentfile 1 (%ENDEPSDATA) /SubFileDecode filter /ReusableStreamDecode filter\n");
1445
1445
                        PutStream("%%BeginDocument: " + fi.fileName() + "\n");
1446
 
                        if (getDouble(QString(tmp.mid(0, 4)), true) == 0xC5D0D3C6)
 
1446
                        if (getDouble(tmp.mid(0, 4), true) == 0xC5D0D3C6)
1447
1447
                        {
1448
1448
                                char* data = tmp.data();
1449
 
                                uint startPos = getDouble(QString(tmp.mid(4, 4)), false);
1450
 
                                uint length = getDouble(QString(tmp.mid(8, 4)), false);
 
1449
                                uint startPos = getDouble(tmp.mid(4, 4), false);
 
1450
                                uint length = getDouble(tmp.mid(8, 4), false);
1451
1451
                                PutStream(data+startPos, length, false);
1452
1452
                        }
1453
1453
                        else
1528
1528
                        else
1529
1529
                        {
1530
1530
                                PutStream("%%BeginDocument: " + fi.fileName() + "\n");
1531
 
                                        if (getDouble(QString(tmp.mid(0, 4)), true) == 0xC5D0D3C6)
 
1531
                                        if (getDouble(tmp.mid(0, 4), true) == 0xC5D0D3C6)
1532
1532
                                        {
1533
1533
                                                char* data = tmp.data();
1534
1534
                                                uint startPos = getDouble(tmp.mid(4, 4), false);
2556
2556
                        {
2557
2557
                                SetClipPath(&c->PoLine);
2558
2558
                                PS_closepath();
 
2559
                                fillRule = c->fillRule;
2559
2560
                                if (c->GrType != 0)
2560
2561
                                        HandleGradient(c, c->width(), c->height(), gcr);
2561
2562
                                else
2695
2696
                                        SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
2696
2697
                                        PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2697
2698
                                }
2698
 
                                if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
 
2699
                                if (hl->hasObject())
2699
2700
                                {
2700
2701
                                        PS_save();
2701
2702
                                        PutStream( MatrixToStr(1.0, 0.0, 0.0, -1.0, -hl->PDx, 0.0) + "\n");
3329
3330
                        patternMatrix.scale(pat->scaleX, pat->scaleY);
3330
3331
                        patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
3331
3332
                        PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
3332
 
                        if (fillRule)
3333
 
                                PutStream("eofill\n");
3334
 
                        else
3335
 
                                PutStream("fill\n");
 
3333
                        PutStream(fillRule ? "eofill\n" : "fill\n");
3336
3334
                        return;
3337
3335
                        break;
3338
3336
        }
3366
3364
                                colorShades.prepend(cstops.at(cst)->shade);
3367
3365
                        }
3368
3366
                }
3369
 
                PS_MultiRadGradient(w, -h, StartX, -StartY, StopVec, Gcolors, colorNames, colorShades);
 
3367
                PS_MultiRadGradient(w, -h, StartX, -StartY, StopVec, Gcolors, colorNames, colorShades, c->fillRule);
3370
3368
        }
3371
3369
        else
3372
3370
        {
3393
3391
                                colorShades.append(cstops.at(cst)->shade);
3394
3392
                        }
3395
3393
                }
3396
 
                PS_MultiLinGradient(w, -h, StopVec, Gcolors, colorNames, colorShades);
 
3394
                PS_MultiLinGradient(w, -h, StopVec, Gcolors, colorNames, colorShades, c->fillRule);
3397
3395
        }
3398
3396
}
3399
3397
 
3657
3655
                }
3658
3656
        }
3659
3657
        */
3660
 
        if ((hl->ch == SpecialChars::OBJECT) && (hl->embedded.hasItem()))
 
3658
        if (hl->hasObject())
3661
3659
        {
3662
3660
                QList<PageItem*> emG = hl->embedded.getGroupedItems();
3663
3661
                QStack<PageItem*> groupStack;