This file is indexed.

/usr/include/magics/QtDriver.h is in libmagics++-dev 2.30.0-5.

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
/*
 * (C) Copyright 1996-2016 ECMWF.
 * 
 * This software is licensed under the terms of the Apache Licence Version 2.0
 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
 * In applying this licence, ECMWF does not waive the privileges and immunities 
 * granted to it by virtue of its status as an intergovernmental organisation nor
 * does it submit to any jurisdiction.
 */

/*!
    \file QtDriver.h
    \brief Definition of QtDriver.
    \author Meteorological Visualisation Section, ECMWF

    Started: Mon Jan  4 20:28:15 2010
*/

#ifndef _MPP_QtDriver_H
#define _MPP_QtDriver_H

#include <BaseDriver.h>
#include <QtDriverAttributes.h>
#include <XmlNode.h>

#include <QColor>
#include <QMap>

//#include <Qt/qqwidget.h>

class QGraphicsItem;
class QGraphicsScene;
class QPainterPath;

class MgQHistoItem;
class MgQLayerItem;
class MgQLayoutItem;
class MgQMagnifierLayoutItem;
class MgQPatternManager;
class MgQPlotScene;
class MgQPolylineSetItem;
class MgQSceneItem;
class MgQStepItem;
class MgQSymbolItem;
class MgQSymbolManager;

class QPainterPath;

namespace magics
{

/*! \class QtDriver
    \brief This driver produces output for Qt
    \ingroup drivers

    This driver ...
*/
class QtDriver: public BaseDriver, public QtDriverAttributes
{
friend class MgQAnimationStep;
friend class MgQPlotScene;

public:
	QtDriver();
	~QtDriver();
	void open();
	void close();

	/*!
	  \brief sets a new XML node
	*/
	void set(const XmlNode& node)
	{
		if ( magCompare(node.name(), "binary") )
		{
			XmlNode basic = node;
			basic.name("driver");
			BaseDriver::set(basic);
			basic.name("qt");
			QtDriverAttributes::set(basic);
		}
	}

	/*!
	  \brief sets a new map
	*/
	void set(const map<std::string, std::string>& map)
	{
		BaseDriver::set(map);
		QtDriverAttributes::set(map);
	}
	
	MAGICS_NO_EXPORT void executeStep(int step) const;
	MAGICS_NO_EXPORT void executeStep(int step,MgQLayerItem *layerItem) const;	
	MAGICS_NO_EXPORT void executeStep(int step,MgQLayerItem *layerItem,const SceneLayer& sceneLayer) const;
	MAGICS_NO_EXPORT void executeMagnifier(Layer *,MgQMagnifierLayoutItem*) const;
	MAGICS_NO_EXPORT void executeHisto(Layer *,MgQHistoItem*,QString,QString) const;
	void setUpdateMode(bool mode) { updateMode_ = mode; }
	bool getUpdateMode() const    { return updateMode_; }

	void setScene(QGraphicsScene* sc) {scene_=sc;}

private:

	MAGICS_NO_EXPORT void startPage() const;
	MAGICS_NO_EXPORT void endPage() const;
	MAGICS_NO_EXPORT void project(const Layout&) const;
	MAGICS_NO_EXPORT void project(const PreviewLayout&) const;
	MAGICS_NO_EXPORT void project(const MagnifierLayout&) const;
	MAGICS_NO_EXPORT void project(const HistoLayout&) const;
	MAGICS_NO_EXPORT void project(const SceneLayout&) const;
	MAGICS_NO_EXPORT void unproject() const;
	MAGICS_NO_EXPORT void newLayer(Layer&) const;
	MAGICS_NO_EXPORT void newLayer(StaticLayer&) const;
	MAGICS_NO_EXPORT void newLayer(StepLayer&) const;
	MAGICS_NO_EXPORT void closeLayer(Layer&) const;
	MAGICS_NO_EXPORT void closeLayer(StaticLayer&) const;
	MAGICS_NO_EXPORT void closeLayer(StepLayer&) const;

	MAGICS_NO_EXPORT void setNewLineWidth(const MFloat) const;
	MAGICS_NO_EXPORT void setNewColour(const Colour &col) const;
	MAGICS_NO_EXPORT int setLineParameters(const LineStyle style, const MFloat w) const;

	MAGICS_NO_EXPORT void renderPolyline(const int, MFloat *, MFloat *) const;
	MAGICS_NO_EXPORT void renderPolyline2(const int n, MFloat *x, MFloat *y) const;
	MAGICS_NO_EXPORT void renderSimplePolygon(const int, MFloat *, MFloat *) const;
	MAGICS_NO_EXPORT void renderSimplePolygon(const Polyline&) const;
	MAGICS_NO_EXPORT void renderText(const Text& text) const;
	MAGICS_NO_EXPORT void circle(const MFloat x, const MFloat y, const MFloat r, const int) const;
	MAGICS_NO_EXPORT void renderImage(const ImportObject&) const;
	MAGICS_NO_EXPORT bool renderPixmap(MFloat,MFloat,MFloat,MFloat,int,int,unsigned char*,int,bool) const;
	MAGICS_NO_EXPORT bool renderCellArray(const Image& obj) const;
	MAGICS_NO_EXPORT void renderSymbols(const Symbol&) const;

	//! Methods to redisplay an object (virtual).
	MAGICS_NO_EXPORT void redisplay(const Layer&) const;
	MAGICS_NO_EXPORT void redisplay(const PreviewLayout&) const;
	MAGICS_NO_EXPORT void redisplay(const MagnifierLayout&) const;
	MAGICS_NO_EXPORT void redisplay(const HistoLayout&) const;
	MAGICS_NO_EXPORT void redisplay(const SceneLayout&) const;
	MAGICS_NO_EXPORT void redisplay(const SceneLayer&) const;
	MAGICS_NO_EXPORT void redisplay(const StaticLayer&) const;
	MAGICS_NO_EXPORT void redisplay(const StepLayer&) const;
	MAGICS_NO_EXPORT void redisplay(const PolylineSet&) const;
	MAGICS_NO_EXPORT void redisplay(const Arrow&) const;
	MAGICS_NO_EXPORT void redisplay(const Flag&) const;


	// QtDriver specific member functions BEGIN
	MAGICS_NO_EXPORT void project(MgQLayoutItem*) const;
	MAGICS_NO_EXPORT void newLayer(MgQLayerItem*) const;
	MAGICS_NO_EXPORT void closeLayer(MgQLayerItem*) const;	
	MAGICS_NO_EXPORT void generateSymbolPath(MgQSymbolItem *,svgSymbol) const;
	MAGICS_NO_EXPORT void textToUnicode(const string&,QString &) const;
	MAGICS_NO_EXPORT void circle(const MFloat x, const MFloat y, const MFloat r, const int,MgQSymbolItem*) const;
	MAGICS_NO_EXPORT void snowflake(const MFloat, const MFloat, const MFloat,MgQSymbolItem*) const;
	MAGICS_NO_EXPORT void drizzle(const MFloat, const MFloat, const MFloat,MgQSymbolItem*) const;
	MAGICS_NO_EXPORT void triangle(const MFloat, const MFloat, const MFloat, const int, const int,MgQSymbolItem*) const;
	MAGICS_NO_EXPORT void lightning(const MFloat x, const MFloat y, const MFloat size,MgQSymbolItem*) const;

//void executeStep(const MgQAnimationStep&,MgQStepItem*) const;
	//mutable QGraphicsScene* scene_;
	// QtDriver specific member functions END

	QColor getQtColour(const Colour &) const;

	//! Method to print string about this class on to a stream of type ostream (virtual).
	void print(ostream&) const;
	MAGICS_NO_EXPORT void debugOutput(const string &s) const;

	//! Copy constructor - No copy allowed
	QtDriver(const QtDriver&);
	//! Overloaded << operator to copy - No copy allowed
	QtDriver& operator=(const QtDriver&);

	// -- Friends
	//! Overloaded << operator to call print().
	friend ostream& operator<<(ostream& s,const QtDriver& p)
		{ p.print(s); return s; }

	QGraphicsScene *scene_;
	mutable int stepToRender_;
	mutable std::stack<MgQLayoutItem*>  layoutItemStack_;
	mutable std::stack<MgQLayerItem*>   layerItemStack_;
	mutable MgQSceneItem* currentSceneItem_;
	mutable QGraphicsItem* currentItem_;
	mutable bool initialized_;
	mutable bool magnifierIsBeingRedisplayed_;
	mutable MFloat magnifierZoomFactor_;
	mutable MgQSymbolManager* symbolManager_;
	mutable MgQPatternManager* patternManager_;
	mutable MgQPolylineSetItem *currentPolylineSetItem_;
	
	mutable QMap<LineStyle,Qt::PenStyle> penStyle_;
	mutable Qt::PenStyle currentPenStyle_;

	bool updateMode_;

	MFloat lineWidthFactor_;
	MFloat fontSizeFactor_;
	MFloat dpiResolutionRatio_;
};

} // namespace magics
#endif