This file is indexed.

/usr/include/qedjerealpart.h is in libqedje-dev 0.4.0+lgpl-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
/*
 * Copyright (C) 2008 Instituto Nokia de Tecnologia. All rights reserved.
 *
 * This file is part of QEdje.
 *
 * QEdje is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * QEdje is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with QEdje.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __QEDJE_REALPART_H__
#define __QEDJE_REALPART_H__

#include "qzion.h"
#include "qedjeimage.h"

class QEdje;
class QRunningProgram;
class QEdjePart;
class QEdjePartDescription;
class QEdjeCalcParams;

/*!
  \class QEdjeRealPart
  \brief Control the runtime state of a QEdjePart.

  QEdjeRealPart instances hold and control the behaviour of the Edje parts
  statically described by QEdjePart objects.

  Each QEdjeRealPart is associated to one, and only one, QEdjePart.

  \todo Attributes: 'EvasList extraobjects', 'clicked button', 'gradient_id', \
'still_in'
  \todo Runtime change of swallowed object parameters (size, etc).
  \todo Drag.
  \todo Text struct data
  \todo eventsTo
 */

class QEdjeRealPart
{
public:
    struct {
        QEdjePartDescription *description;
        QEdjeRealPart *rel1ToX;
        QEdjeRealPart *rel1ToY;
        QEdjeRealPart *rel2ToX;
        QEdjeRealPart *rel2ToY;
    } param1, param2, custom;

    struct {
        QSize min;
        QSize max;
    } swallowParams;

    QEdjeRealPart(QEdje *edje, QEdjePart *part);
    virtual ~QEdjeRealPart();

    void setInitialState(const QString &name, double value);
    void setFinalState(const QString &name, double value);
    void unsetFinalState();

    QPoint pos();
    void setPos(const QPoint pos);

    QEdje *edje();
    QEdjePart *part();

    void setClipTo(QEdjeRealPart *clipTo);

    QRunningProgram *runningProgram();
    void setRunningProgram(QRunningProgram *rp);
    void setDescriptionPos(const double value);

    QEdjePartDescription *findDescription(QString &name, double value);

    virtual QSize size() const = 0;
    virtual void setSize(const QSize &size) = 0;

    virtual QColor color() const = 0;
    virtual void setColor(const QColor &color) = 0;

    virtual QZionObject *object() = 0;

    void swallow(QZionObject *objSwallow);
    QZionObject *unswallow(const bool recalc = true);
    QZionObject *embeddedObject();

    QSize fixedMinSize() const { return swallowParams.min; }
    QSize fixedMaxSize() const { return swallowParams.max; }
    void setFixedMinSize(const QSize &size) { swallowParams.min = size; }
    void setFixedMaxSize(const QSize &size) { swallowParams.max = size; }

protected:
    QEdje *_edje;
    QEdjePart *_part;
    QEdjeRealPart *_confineTo;
    QRunningProgram *_runningProgram;

    double _descriptionPos;
    QEdjePartDescription *_chosenDescription;

private:
    int calculated;
    int calculating;
    /* Accepted values: FLAG_NONE, FLAG_X, FLAG_Y, FLAG_XY */

    void recalculate(int flags);
    void recalculateRelativeTo(int flags);

    void recalculateSingle(QEdjePartDescription *desc,
                           QEdjePartDescription *chosen_desc,
                           QEdjeRealPart *rel1_to_x,
                           QEdjeRealPart *rel1_to_y,
                           QEdjeRealPart *rel2_to_x,
                           QEdjeRealPart *rel2_to_y,
                           QEdjeRealPart *confine_to,
                           QEdjeCalcParams *params,
                           int flags);

    void recalculateSingleGeometry(QEdjePartDescription *desc,
                                   QEdjeRealPart *rel1_to_x,
                                   QEdjeRealPart *rel1_to_y,
                                   QEdjeRealPart *rel2_to_x,
                                   QEdjeRealPart *rel2_to_y,
                                   QEdjeCalcParams *params,
                                   int flags);

    void recalculateSingleColors(QEdjePartDescription *desc,
                                 QEdjeCalcParams *params);

    void recalculateSingleMinMax(QEdjePartDescription *desc,
                                 QEdjeCalcParams *params);

    void recalculateSingleMinMaxApply(QEdjePartDescription *desc,
                                      QEdjeCalcParams *params, int flags);

    void recalculateSingleFill(QEdjePartDescription *desc,
                               QEdjeCalcParams *params,
                               int flags);

    void recalculateImageApply(QEdje *edje,
                               QEdjeRealPart *part,
                               QEdjeCalcParams *params,
                               QEdjePartDescription *desc,
                               double pos);

    void setSwallowParamsFromObject(QZionObject *obj);

    friend class QEdje;
};


#define QEDJE_REAL_PART_OVERLOAD_EVENTS(cls)         \
    virtual void mouseMoveEvent(QMouseEvent *) {}    \
    virtual void mousePressEvent(QMouseEvent *) {}   \
    virtual void mouseReleaseEvent(QMouseEvent *) {} \
    virtual void wheelEvent(QWheelEvent *) {}


#define QEDJE_REAL_PART_OVERLOAD_METHODS(cls)                           \
    virtual QZionObject *object() { return this; }                      \
    virtual QColor color() const { return cls::color(); }               \
    virtual void setColor(const QColor &color) { cls::setColor(color); } \
    virtual QSize size() const { return cls::size(); }                  \
    virtual void setSize(const QSize &size) { cls::setSize(size); }


/*!
  \class QEdjeRealPartRectangle
  \brief Represents a QEdjeRealPart specialization for a QZionRectangle.
*/
class QEdjeRealPartRectangle : public QZionRectangle, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartRectangle(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_EVENTS(QZionRectangle)
    QEDJE_REAL_PART_OVERLOAD_METHODS(QZionRectangle)
};


/*!
  \class QEdjeRealPartImage
  \brief Represents a QEdjeRealPart specialization for a QEdjeImage.
*/
class QEdjeRealPartImage : public QEdjeImage, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartImage(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_EVENTS(QEdjeImage)
    QEDJE_REAL_PART_OVERLOAD_METHODS(QEdjeImage)
};


/*!
  \class QEdjeRealPartText
  \brief Represents a QEdjeRealPart specialization for a QZionText.
*/
class QEdjeRealPartText : public QZionText, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartText(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_EVENTS(QZionText)
    QEDJE_REAL_PART_OVERLOAD_METHODS(QZionText)
};


/*!
  \class QEdjeRealPartTextBlock
  \brief Represents a QEdjeRealPart specialization for a QZionTextBlock.
*/
class QEdjeRealPartTextBlock : public QZionTextBlock, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartTextBlock(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_EVENTS(QZionTextBlock)
    QEDJE_REAL_PART_OVERLOAD_METHODS(QZionTextBlock)
};


/*!
  \class QEdjeRealPartGroup
  \brief Represents a QEdjeRealPart specialization for a QZionGroup.
*/
class QEdjeRealPartGroup : public QZionGroup, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartGroup(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_METHODS(QZionGroup)

public Q_SLOTS:
    void signalProxy(const QString &emission, const QString &source);
};


/*!
  \class QEdjeRealPartSwallow
  \brief Represents a QEdjeRealPart specialization for a QZionGroup.
*/
class QEdjeRealPartSwallow : public QZionGroup, public QEdjeRealPart
{
    Q_OBJECT

public:
    QEdjeRealPartSwallow(QEdje *edje, QEdjePart *part);

    QEDJE_REAL_PART_OVERLOAD_METHODS(QZionGroup)
};

#endif