mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-18 00:06:00 -04:00
removed stale files
git-svn-id: http://svn.osgeo.org/qgis/trunk@524 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
078c15b733
commit
07451fb893
@ -1 +1 @@
|
||||
SUBDIRS = example spit
|
||||
SUBDIRS = example maplayer spit
|
||||
|
@ -1,4 +0,0 @@
|
||||
#include "qgisplugingui.h"
|
||||
#include "qgispluginguielement.h"
|
||||
QgisPluginGui::QgisPluginGui(){
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#ifndef QGISPLUGINGUI_H
|
||||
#define QGISPLUGINGUI_H
|
||||
|
||||
#include <vector>
|
||||
class QgisPluginGuiElement;
|
||||
|
||||
/*! \class QgisPluginGui
|
||||
* \brief Class to encapsulate the gui elements of a plugin
|
||||
*
|
||||
* QgsPluginGui encapsulates all the GUI elements a plugin supports,
|
||||
* including menu items, toolbar buttons, and associated graphics
|
||||
*/
|
||||
class QgisPluginGui {
|
||||
public:
|
||||
//! Constructor
|
||||
QgisPluginGui();
|
||||
//! Returns the number of GUI elements in the plugin
|
||||
int elementCount();
|
||||
//! Returns a specific GUI element by index from the vector
|
||||
QgisPluginGuiElement element(int index);
|
||||
//! Adds a new element
|
||||
void addElement(QgisPluginGuiElement);
|
||||
//! Destructor
|
||||
virtual ~QgisPluginGui();
|
||||
private:
|
||||
std::vector<QgisPluginGuiElement> elements;
|
||||
};
|
||||
|
||||
#endif // QGISPLUGINGUI_H
|
@ -1,22 +0,0 @@
|
||||
#ifndef QGISPLUGINGUIELEMENT_H
|
||||
#define QGISPLUGINGUIELEMENT_H
|
||||
#include "qgispluginns.h"
|
||||
/*! \class QgisPluginGuiElement
|
||||
* \brief Base class for a GUI element (menu, toolbar, etc) of a plugin
|
||||
*
|
||||
* QgsPluginGuiElement provides information about a GUI element that
|
||||
* will be added to the QGis interface when the plugin is loaded
|
||||
*/
|
||||
class QgisPluginGuiElement {
|
||||
public:
|
||||
//! Constructor
|
||||
QgisPluginGuiElement();
|
||||
//! Type of element (see ELEMENTS enum in qgisplugin.h)
|
||||
virtual QGIS_GUI_TYPE elementType();
|
||||
//! destructor
|
||||
virtual ~QgisPluginGuiElement();
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // QGISPLUGINGUIELEMENT_H
|
@ -1,26 +0,0 @@
|
||||
#ifndef QGISPLUGINMENU_H
|
||||
#define QGISPLUGINMENU_H
|
||||
|
||||
#include <map>
|
||||
#include "qgispluginguielement"
|
||||
/*! \class QgisPluginMenu
|
||||
* \brief Class to define a plugin menu
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class QgisPluginMenu : public QgisPluginGuiElement {
|
||||
public:
|
||||
//! Constructor
|
||||
QgisPluginMenu();
|
||||
//! Type of element (see ELEMENTS enum in qgisplugin.h)
|
||||
QGIS_GUI_TYPE type();
|
||||
//! destructor
|
||||
virtual ~QgisPluginMenu();
|
||||
private:
|
||||
//! Map to define slot called when a menu item is activated
|
||||
std::map<QString menuItemName, QString menuItemSlot> itemSlots;
|
||||
};
|
||||
|
||||
#endif QGISPLUGINMENU_H
|
||||
|
@ -1,25 +0,0 @@
|
||||
#ifndef QGISPLUGINNS_H
|
||||
#define QGISPLUGINNS_H
|
||||
/*! \mainpage Quantum GIS
|
||||
*
|
||||
* \section about About QGis
|
||||
* QGis aims to be an easy to use desktop GIS tool. Initial focus is on viewing spatial
|
||||
* and tabular data from common data stores, including Shapefiles and PostGIS.
|
||||
*
|
||||
* This API documentation provides information about all classes that make up QGis.
|
||||
*
|
||||
*/
|
||||
//! Element type corresponding to one of the values in the ELEMENTS enum
|
||||
typedef int QGIS_GUI_TYPE;
|
||||
|
||||
namespace QGisPlugin
|
||||
{
|
||||
//! Element types that can be added to the interface
|
||||
enum UI_ELEMENTS {
|
||||
MENU,
|
||||
MENU_ITEM,
|
||||
TOOLBAR,
|
||||
TOOLBAR_BUTTON,
|
||||
};
|
||||
}
|
||||
#endif //QGISPLUGINNS_H
|
@ -1,25 +0,0 @@
|
||||
#ifndef QGISPLUGINTOOLBAR_H
|
||||
#define QGISPLUGINTOOLBAR_H
|
||||
|
||||
#include <map>
|
||||
#include "qgispluginguielement"
|
||||
/*! \class QgisPluginToolbar
|
||||
* \brief Class to define a plugin toolbar
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class QgisPluginToolbar : public QgisPluginGuiElement {
|
||||
public:
|
||||
//! Constructor
|
||||
QgisPluginToolbar();
|
||||
//! Type of element (see ELEMENTS enum in qgisplugin.h)
|
||||
QGIS_GUI_TYPE type();
|
||||
//! destructor
|
||||
virtual ~QgisPluginToolbar();
|
||||
private:
|
||||
//! Map to define slot called when a toolbar button is activated
|
||||
std::map<QString toolName, QString toolSlot> toolSlots;
|
||||
};
|
||||
|
||||
#endif // QGISPLUGINTOOLBAR_H
|
@ -1,109 +0,0 @@
|
||||
/* Test plugin for QGis
|
||||
* This code is an example plugin for QGIS and a demonstration of the API
|
||||
* All QGIS plugins must inherit from the abstract base class QgisPlugin. A
|
||||
* plugin must implement the virtual functions defined in QgisPlugin:
|
||||
* *name
|
||||
* *version
|
||||
* *description
|
||||
*
|
||||
* This list may grow as the API is expanded.
|
||||
*
|
||||
* In addition, a plugin must implement a the classFactory and unload
|
||||
* functions. Note that these functions must be declared as extern "C"
|
||||
*/
|
||||
|
||||
// includes
|
||||
#include <iostream>
|
||||
#include "../../src/qgisapp.h"
|
||||
|
||||
#include "qgistestplugin.h"
|
||||
#include <qaction.h>
|
||||
// xpm for creating the toolbar icon
|
||||
#include "matrix1.xpm"
|
||||
|
||||
/**
|
||||
* Constructor for the plugin
|
||||
*/
|
||||
QgisTestPlugin::QgisTestPlugin(QgisApp *qgis, QgisIface *_qI)
|
||||
: qgisMainWindow(qgis), qI(_qI){
|
||||
pName = "Test Plugin";
|
||||
pVersion = "Version 0.0";
|
||||
pDescription = "This test plugin does nothing but tell you its name, version, and description";
|
||||
// instantiate a map layer
|
||||
//QgsMapLayer *mlyr = new QgsMapLayer();
|
||||
|
||||
// see if we can popup a message box in qgis on load
|
||||
QMessageBox::information(qgisMainWindow,"Message From Plugin", "This message is from within the test plugin");
|
||||
// add a test menu
|
||||
QPopupMenu *pluginMenu = new QPopupMenu( qgisMainWindow );
|
||||
|
||||
pluginMenu->insertItem("&Open", this, SLOT(open()));
|
||||
pluginMenu->insertItem( "&New" , this, SLOT(newThing()));
|
||||
// a test toolbar
|
||||
QMenuBar *menu = ((QMainWindow *)qgisMainWindow)->menuBar();
|
||||
|
||||
menu->insertItem( "&PluginMenu", pluginMenu );
|
||||
QAction *zoomPreviousAction = new QAction( "Zoom Previous",QIconSet(icon_matrix), "&Zoom Previous", CTRL+Key_S, qgisMainWindow, "zoomFull" );
|
||||
|
||||
connect( zoomPreviousAction, SIGNAL( activated() ) , this, SLOT( zoomPrevious() ) );
|
||||
|
||||
QToolBar * fileTools = new QToolBar( (QMainWindow *)qgisMainWindow, "zoom operations" );
|
||||
fileTools->setLabel( "Zoom Operations" );
|
||||
zoomPreviousAction->addTo(fileTools);
|
||||
|
||||
int foo = qI->getInt();
|
||||
/*
|
||||
QgisIface *qI2 = qgisMainWindow->getInterface();
|
||||
if(qI2)
|
||||
std::cout << "qI2 pointer is good" << std::endl;
|
||||
else
|
||||
std::cout << "qI2 pointer is bad" << std::endl;
|
||||
*/
|
||||
//zoomFullX();
|
||||
qI->zoomFull();
|
||||
// qgisMainWindow->zoomFull();
|
||||
QMessageBox::information(qgisMainWindow,"Message From Plugin", "Click Ok to zoom previous");
|
||||
|
||||
qI->zoomPrevious();
|
||||
|
||||
std::cout << "Result of getInt is: " << foo << std::endl;
|
||||
|
||||
}
|
||||
QgisTestPlugin::~QgisTestPlugin(){
|
||||
|
||||
}
|
||||
QString QgisTestPlugin::name(){
|
||||
return pName;
|
||||
}
|
||||
QString QgisTestPlugin::version(){
|
||||
return pVersion;
|
||||
|
||||
}
|
||||
QString QgisTestPlugin::description(){
|
||||
return pDescription;
|
||||
|
||||
}
|
||||
|
||||
void QgisTestPlugin::open(){
|
||||
QMessageBox::information(qgisMainWindow, "Message from plugin", "You chose the open menu");
|
||||
}
|
||||
void QgisTestPlugin::newThing(){
|
||||
QMessageBox::information(qgisMainWindow, "Message from plugin", "You chose the new menu");
|
||||
}
|
||||
|
||||
void QgisTestPlugin::zoomPrevious(){
|
||||
qI->zoomPrevious();
|
||||
}
|
||||
|
||||
extern "C" QgisPlugin * classFactory(QgisApp *qgis, QgisIface *qI){
|
||||
return new QgisTestPlugin(qgis, qI);
|
||||
}
|
||||
extern "C" QString name(){
|
||||
return QString("Test Plugin");
|
||||
}
|
||||
extern "C" QString description(){
|
||||
return QString("Default QGIS Test Plugin");
|
||||
}
|
||||
extern "C" void unload(QgisPlugin *p){
|
||||
delete p;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
|
||||
#ifndef qgisplugintest_h
|
||||
#define qgisplugintest_h
|
||||
#include "qgisplugin.h"
|
||||
#include <qwidget.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qmenubar.h>
|
||||
#include "qgistestplugin.h"
|
||||
#include "qgsworkerclass.h"
|
||||
#include "../src/qgisapp.h"
|
||||
|
||||
/**
|
||||
* \class QgisTestPlugin
|
||||
* \brief An example QGIS plugin, illustrating how to add menu items, a toolbar,
|
||||
* and perform an operation on the map canvas.
|
||||
*
|
||||
* When loaded, this plugin adds a new menu to QGIS with two items. It also
|
||||
* adds a toolbar that has one button. When clicked, the button zooms the
|
||||
* map to the previous view.
|
||||
*
|
||||
* This class must inherit from QObject and QgisPlugin.
|
||||
*/
|
||||
class QgisTestPlugin : public QObject, public QgisPlugin{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* Constructor for a plugin. The QgisApp and QgisIface pointers are passed by
|
||||
* QGIS when it attempts to instantiate the plugin.
|
||||
* @param qgis Pointer to the QgisApp object
|
||||
* @param qI Pointer to the QgisIface object.
|
||||
*/
|
||||
QgisTestPlugin(QgisApp *qgis, QgisIface *qI);
|
||||
/**
|
||||
* Virtual function to return the name of the plugin. The name will be used when presenting a list
|
||||
* of installable plugins to the user
|
||||
*/
|
||||
virtual QString name();
|
||||
/**
|
||||
* Virtual function to return the version of the plugin.
|
||||
*/
|
||||
virtual QString version();
|
||||
/**
|
||||
* Virtual function to return a description of the plugins functions
|
||||
*/
|
||||
virtual QString description();
|
||||
|
||||
virtual ~QgisTestPlugin();
|
||||
public slots:
|
||||
void open();
|
||||
void newThing();
|
||||
void zoomPrevious();
|
||||
private:
|
||||
QString pName;
|
||||
QString pVersion;
|
||||
QString pDescription;
|
||||
|
||||
QgisApp *qgisMainWindow;
|
||||
QgisIface *qI;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
// $FILENAME
|
||||
#include "qgsworkerclass.h"
|
||||
#include <qmessagebox.h>
|
||||
|
||||
QgsWorkerClass::QgsWorkerClass()
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QgsWorkerClass::~QgsWorkerClass()
|
||||
{
|
||||
}
|
||||
void QgsWorkerClass::open(){
|
||||
QMessageBox::information(this, "Worker class", "Message from open function in worker class");
|
||||
}
|
||||
void QgsWorkerClass::newThing(){
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
|
||||
#ifndef QGSWORKERCLASS_H
|
||||
#define QGSWORKERCLASS_H
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* Gary Sherman
|
||||
**/
|
||||
class QgsWorkerClass : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QgsWorkerClass();
|
||||
~QgsWorkerClass();
|
||||
public slots:
|
||||
void open();
|
||||
void newThing();
|
||||
};
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user