~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/imageplugins/decorate/inserttexttool.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Date        : 2005-02-14
7
7
 * Description : a plugin to insert a text over an image.
8
8
 *
9
 
 * Copyright (C) 2005-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
10
 
 * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 
9
 * Copyright (C) 2005-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2006-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
67
67
namespace DigikamDecorateImagePlugin
68
68
{
69
69
 
70
 
class InsertTextTool::InsertTextToolPriv
 
70
class InsertTextTool::Private
71
71
{
72
72
public:
73
73
 
74
 
    InsertTextToolPriv() :
 
74
    Private() :
75
75
        alignTextMode(0),
76
76
        defaultSizeFont(0),
77
77
        borderText(0),
113
113
    EditorToolSettings*  gboxSettings;
114
114
};
115
115
 
116
 
const QString InsertTextTool::InsertTextToolPriv::configGroupName("inserttext Tool");
117
 
const QString InsertTextTool::InsertTextToolPriv::configTextRotationEntry("Text Rotation");
118
 
const QString InsertTextTool::InsertTextToolPriv::configFontColorEntry("Font Color");
119
 
const QString InsertTextTool::InsertTextToolPriv::configTextStringEntry("Enter your text here.");
120
 
const QString InsertTextTool::InsertTextToolPriv::configFontPropertiesEntry("Font Properties");
121
 
const QString InsertTextTool::InsertTextToolPriv::configTextAlignmentEntry("Text Alignment");
122
 
const QString InsertTextTool::InsertTextToolPriv::configBorderTextEntry("Border Text");
123
 
const QString InsertTextTool::InsertTextToolPriv::configTransparentTextEntry("Transparent Text");
124
 
const QString InsertTextTool::InsertTextToolPriv::configPositionHintEntry("Position Hint");
 
116
const QString InsertTextTool::Private::configGroupName("inserttext Tool");
 
117
const QString InsertTextTool::Private::configTextRotationEntry("Text Rotation");
 
118
const QString InsertTextTool::Private::configFontColorEntry("Font Color");
 
119
const QString InsertTextTool::Private::configTextStringEntry("Enter your text here.");
 
120
const QString InsertTextTool::Private::configFontPropertiesEntry("Font Properties");
 
121
const QString InsertTextTool::Private::configTextAlignmentEntry("Text Alignment");
 
122
const QString InsertTextTool::Private::configBorderTextEntry("Border Text");
 
123
const QString InsertTextTool::Private::configTransparentTextEntry("Transparent Text");
 
124
const QString InsertTextTool::Private::configPositionHintEntry("Position Hint");
125
125
 
126
126
// --------------------------------------------------------
127
127
 
128
 
InsertTextTool::InsertTextTool(QObject* parent)
 
128
InsertTextTool::InsertTextTool(QObject* const parent)
129
129
    : EditorTool(parent),
130
 
      d(new InsertTextToolPriv)
 
130
      d(new Private)
131
131
{
132
132
    setObjectName("inserttext");
133
133
    setToolName(i18n("Insert Text"));
289
289
    QColor black(0, 0, 0);
290
290
    QFont  defaultFont;
291
291
 
292
 
    int orgW = d->previewWidget->imageIface()->originalWidth();
293
 
    int orgH = d->previewWidget->imageIface()->originalHeight();
 
292
    int orgW = d->previewWidget->imageIface()->originalSize().width();
 
293
    int orgH = d->previewWidget->imageIface()->originalSize().height();
294
294
 
295
295
    if ( orgW > orgH )
296
296
    {
408
408
{
409
409
    kapp->setOverrideCursor( Qt::WaitCursor );
410
410
 
411
 
    ImageIface iface(0, 0);
 
411
    ImageIface iface;
412
412
    DImg dest = d->previewWidget->makeInsertText();
413
413
 
414
414
    FilterAction action("digikam:insertTextTool", 1);
424
424
    action.addParameter("borderText", d->borderText->isChecked());
425
425
    action.addParameter("transparentText", d->transparentText->isChecked());
426
426
 
427
 
    iface.putOriginalImage(i18n("Insert Text"), action, dest.bits(), dest.width(), dest.height());
 
427
    iface.setOriginal(i18n("Insert Text"), action, dest);
428
428
 
429
429
    kapp->restoreOverrideCursor();
430
430
}