Skip to content

Commit

Permalink
Refactored libqgis into two roughly inequal parts.
Browse files Browse the repository at this point in the history
libqgis_core is intended to have non gui code
libqgis_gui is intended to have gui related code
Updated makefiles and code throughout in order for it to build with this new arrangemetn
Code in src/ will be moved into src/gui in a follow up commit




git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4502 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 8, 2006
1 parent 3bd5440 commit 0c94f82
Show file tree
Hide file tree
Showing 100 changed files with 16,727 additions and 0 deletions.
191 changes: 191 additions & 0 deletions src/core/Makefile.am
@@ -0,0 +1,191 @@
# Copyright (C) 2003 Gary Sherman <sherman at mrcc.com>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

##
## ----------------------------------------------------------------------
## Initial setup
## ----------------------------------------------------------------------
##
if HAVE_QTMAC
MAC = mac
endif


if !HAVE_QTMAC
PREFIX=-DPREFIX=\"$(prefix)\"
PLUGINPATH=-DPLUGINPATH=\"$(pkglibdir)\"
PKGDATAPATH=-DPKGDATAPATH=\"$(pkgdatadir)\"
endif

%.moc.cpp: %.h
$(MOC) -o $@ $<

##
## ----------------------------------------------------------------------
## Define Targets
## ----------------------------------------------------------------------
##
lib_LTLIBRARIES = libqgis_core.la


##
## ----------------------------------------------------------------------
## libqgis_core stuff starts here
## ----------------------------------------------------------------------
##

libqgis_coreHEADERS = \
qgis.h \
qgsacetatelines.h \
qgsacetateobject.h \
qgsacetaterectangle.h \
qgsapplication.h \
qgsattributeaction.h \
qgsbookmarkitem.h \
qgsclipboard.h \
qgsclipper.h \
qgscolortable.h \
qgscontexthelp.h \
qgscoordinatetransform.h \
qgscsexception.h \
qgscustomsymbol.h \
qgsdatamanager.h \
qgsdataprovider.h \
qgsdatasource.h \
qgsdatasourceuri.h \
qgsdistancearea.h \
qgsexception.h \
qgsfeatureattribute.h \
qgsfield.h \
qgsfile.h \
qgsgeometry.h \
qgsgeometryvertexindex.h \
qgslabelattributes.h \
qgsline.h \
qgslinesymbol.h \
qgsmaptopixel.h \
qgsmarkercatalogue.h \
qgsmarkersymbol.h \
qgsnumericsortlistviewitem.h\
qgspluginitem.h \
qgspluginregistry.h \
qgspoint.h \
qgspolygonsymbol.h \
qgsprojectproperty.h \
qgsprovidercountcalcevent.h \
qgsproviderextentcalcevent.h\
qgsprovidermetadata.h \
qgsproviderregistry.h \
qgsrangerenderitem.h \
qgsrasterdataprovider.h \
qgsrect.h \
qgsrenderer.h \
qgsrenderitem.h \
qgsscalecalculator.h \
qgssearchstring.h \
qgssearchtreenode.h \
qgssinglesymrenderer.h \
qgssvgcache.h \
qgssymbol.h \
qgssymbologyutils.h \
qgsvectordataprovider.h

## files generated from MOC
libqgis_core_la_MOC = \
qgscoordinatetransform.moc.cpp \
qgscontexthelp.moc.cpp \
qgsdataprovider.moc.cpp \
qgsrasterdataprovider.moc.cpp

libqgis_core_la_SOURCES =\
qgsacetatelines.cpp \
qgsacetateobject.cpp \
qgsacetaterectangle.cpp \
qgsapplication.cpp \
qgsattributeaction.cpp \
qgsbookmarkitem.cpp \
qgsclipboard.cpp \
qgsclipper.cpp \
qgscolortable.cpp \
qgscontexthelp.cpp \
qgscoordinatetransform.cpp \
qgscustomsymbol.cpp \
qgsdatamanager.cpp \
qgsdatasource.cpp \
qgsdistancearea.cpp \
qgsexception.cpp \
qgsfeatureattribute.cpp \
qgsfield.cpp \
qgsfile.cpp \
qgsgeometry.cpp \
qgsgeometryvertexindex.cpp \
qgslabelattributes.cpp \
qgsline.cpp \
qgslinesymbol.cpp \
qgsmaptopixel.cpp \
qgsmarkercatalogue.cpp \
qgsmarkersymbol.cpp \
qgsnumericsortlistviewitem.cpp \
qgspluginitem.cpp \
qgspluginregistry.cpp \
qgspoint.cpp \
qgspolygonsymbol.cpp \
qgsprojectproperty.cpp \
qgsprovidercountcalcevent.cpp \
qgsproviderextentcalcevent.cpp \
qgsprovidermetadata.cpp \
qgsproviderregistry.cpp \
qgsrangerenderitem.cpp \
qgsrasterdataprovider.cpp \
qgsrect.cpp \
qgsrenderer.cpp \
qgsrenderitem.cpp \
qgsscalecalculator.cpp \
qgssearchstring.cpp \
qgssearchstringlexer.ll \
qgssearchstringparser.yy \
qgssearchtreenode.cpp \
qgssvgcache.cpp \
qgssymbol.cpp \
qgssymbologyutils.cpp \
qgsvectordataprovider.cpp


AM_YFLAGS = -d
qgis_YACC = qgssearchstringparser.h


nodist_libqgis_core_la_SOURCES = $(libqgis_core_la_MOC)

BUILT_SOURCES = $(libqgis_core_la_MOC) $(qgis_YACC) $(postgresMOC)


#libqgis_core_la_LIBADD = ../raster/libqgis_raster.la ../legend/libqgis_legend.la ../composer/libqgis_composer.la ../widgets/projectionselector/libqgsprojectionselector.la $(QT_LDADD) $(GEOS_LDADD) $(GDAL_LDADD) $(PYTHON_LIB) -lsqlite3
libqgis_core_la_LIBADD = $(QT_LDADD) $(GEOS_LDADD) $(GDAL_LDADD) $(PYTHON_LIB) -lsqlite3
libqgis_core_la_LDFLAGS = -version-info $(INTERFACE_VERSION)

libqgis_core_la_CXXFLAGS = $(PREFIX) $(PLUGINPATH) $(PKGDATAPATH) $(GDAL_CFLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(PG_INC) $(DEBUG_QGIS) $(GEOS_CFLAGS) $(PYTHON_INCLUDE_DIR) $(HAVE_PYTHON) -I../ui/ -I../widgets/projectionselector/ -I../legend/ -I../raster/ -I../composer/

##
## ----------------------------------------------------------------------
## additional files that need to be installed go here
## ----------------------------------------------------------------------
##
pkginclude_HEADERS = $(qgisHEADERS)

pkginclude_dir = $(includedir)/qgis


CLEANFILES = $(BUILT_SOURCES)

EXTRA_DIST=


noinst_HEADERS = qgsdatasourceuri.h
66 changes: 66 additions & 0 deletions src/core/qgsacetatelines.cpp
@@ -0,0 +1,66 @@
/***************************************************************************
qgsacetatelines.cpp
A collection of lines that can be drawn on
the acetate layer of a QgsMapCanvas
-------------------
begin : June 10, 2004
copyright : (C) 2004 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */
#include <qstring.h>
#include <qpainter.h>
#include <qglobal.h>
#include <qgsmaptopixel.h>
#include <qgspoint.h>
#include <qgsrect.h>
#include "qgsline.h"
#include "qgsacetatelines.h"

QgsAcetateLines::QgsAcetateLines()
{
mLineCollection = new std::vector<QgsLine>;
}

QgsAcetateLines::~QgsAcetateLines()
{
delete mLineCollection;
}

void QgsAcetateLines::add(QgsLine &line)
{
mLineCollection->push_back(line);
}
void QgsAcetateLines::draw(QPainter *painter, QgsMapToPixel *cXf)
{
painter->setPen(QColor(255,0,0));
painter->setBrush(Qt::NoBrush);
// iterate through the lines in the vector and draw each
for(int i=0; i < mLineCollection->size(); i++)
{
QgsLine line = mLineCollection->at(i);
// get the begin and end points of the line
QgsPoint begin = line.begin();
QgsPoint end = line.end();
if(cXf)
{
// transform the points before drawing
cXf->transform(&begin);
cXf->transform(&end);
}
// TODO: Qt4 has delegated moveTo and lineTo to QPainterPath - need to refactor appropriately.
#if QT_VERSION < 0x040000
painter->moveTo(static_cast<int>(begin.x()), static_cast<int>(begin.y()));
painter->lineTo(static_cast<int>(end.x()), static_cast<int>(end.y()));
#endif
}
}
90 changes: 90 additions & 0 deletions src/core/qgsacetatelines.h
@@ -0,0 +1,90 @@
/***************************************************************************
qgsacetatelines.h
A collection of lines that can be drawn
on the acetate layer of a QgsMapCanvas
-------------------
begin : 2004-10-24
copyright : (C) 2004 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */

#ifndef QGSACETATELINES_H
#define QGSACETATELINES_H

class QgsPoint;
class QgsLine;
class QPainter;
class QgsMapToPixel;

#include <vector>
//#include "qgsline.h"
#include "qgsacetateobject.h"

/** \class QgsAcetateLines
* \brief A collection of lines drawn on the acetate layer of a map canvas
*
* An acetate object is a graphic or text object that is drawn on top of the map canvas
* after rendering of all map elements is completed. Acetate objects can be drawn in
* device coordinates or map coordinates. Drawing in map coordinates requires passing
* a QgsMapToPixel object to the draw function.
*
*/
class QgsAcetateLines : public QgsAcetateObject {
public:
/**
* Constructor
*/
QgsAcetateLines();
/**
* Destructor
*/
~QgsAcetateLines();
/**
* Draw the collection of lines using the Qpainter and applying a
* coordinate transform if specified.
* @param painter Painter to use for drawing
* @param cXf Coordinate transform to use in drawing map coordinate
* on the device. If this parameter is not specified, coordinates are
* assumed to be device coordinates
* rather than map coordinates.
*/
void draw (QPainter * painter, QgsMapToPixel * cXf=0);
/**
* Set the origin point
* @param value Point of origin
*/
void setOrigin (QgsPoint value );
/**
* Returns the point of origin
*/
QgsPoint origin();
/**
* Returns the line collection
*/
std::vector<QgsLine> * lines();
/** Sets the line collection
* @param col The line collection (vector)
*/
void setLines(std::vector<QgsLine> *lineCol);
/** Add a line to the line collection
* @param QgsLine to add to the collection
*/
void add(QgsLine &line);
private:
//! Origin of the object in device or map coordinates
QgsPoint mOrigin;
//! Lines collection
std::vector<QgsLine> *mLineCollection;
};
#endif //QGSACETATELINES_H

0 comments on commit 0c94f82

Please sign in to comment.