Removed old legacy code regarding QgsMapLayerInterface

git-svn-id: http://svn.osgeo.org/qgis/trunk@9527 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2008-10-23 13:49:53 +00:00
parent 4ff166a3a4
commit 8dab8e0f8e
7 changed files with 0 additions and 304 deletions

View File

@ -189,7 +189,6 @@
class QTreeWidgetItem;
/* typedefs for plugins */
typedef QgsMapLayerInterface *create_it();
typedef QgisPlugin *create_ui( QgisInterface * qI );
typedef QString name_t();
typedef QString description_t();
@ -4293,39 +4292,6 @@ void QgisApp::loadPlugin( QString theFullPathName, QString name )
}
break;
/*
// TODO: to be removed completely
case QgisPlugin::MAPLAYER:
{
// Map layer - requires interaction with the canvas
create_it *cf = ( create_it * ) cast_to_fptr( myLib->resolve( "classFactory" ) );
if ( cf )
{
QgsMapLayerInterface *pl = cf();
if ( pl )
{
// set the main window pointer for the plugin
pl->setQgisMainWindow( this );
pl->initGui();
//add it to the qsettings file [ts]
settings.setValue( "/Plugins/" + name, true );
}
else
{
// something went wrong
QMessageBox::warning( this, tr( "Error Loading Plugin" ), tr( "There was an error loading %1." ) );
//add it to the qsettings file [ts]
settings.setValue( "/Plugins/" + name, false );
}
}
else
{
QgsDebugMsg( "Unable to find the class factory for " + theFullPathName );
}
}
break;
*/
default:
// type is unknown
QgsDebugMsg( "Plugin " + theFullPathName + " did not return a valid type and cannot be loaded" );

View File

@ -1,39 +0,0 @@
/***************************************************************************
begin : Jul 10 2003
copyright : (C) 2003 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 QGSMAPLAYERINTERFACE_H
#define QGSMAPLAYERINTERFACE_H
/**
* Interface class for map layer plugins
*/
#include <QObject>
#include "qgisapp.h"
class QgsMapLayerInterface: public QObject
{
Q_OBJECT
public:
virtual void setQgisMainWindow( QgisApp *qgis ) = 0;
// a test function to return an int
virtual int getInt() = 0;
// setup the plugin's GUI
virtual void initGui() = 0;
// unload the plugin
virtual void unload() = 0;
// draw function
virtual void draw() = 0;
};
#endif // QGSMAPLAYERINTERFACE_H

View File

@ -45,7 +45,6 @@ class QGraphicsScene;
class QgsMapToPixel;
class QgsMapLayer;
class QgsMapLayerInterface;
class QgsLegend;
class QgsLegendView;
class QgsRubberBand;

View File

@ -1,4 +0,0 @@
.deps
Makefile
Makefile.in

View File

@ -1,80 +0,0 @@
/***************************************************************************
maplayertest.cpp
--------------------------------------
Date : Sun Sep 16 12:10:17 AKDT 2007
Copyright : (C) 2007 by Gary E. Sherman
Email : sherman at mrcc dot 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. *
* *
***************************************************************************/
#include <q3popupmenu.h>
#include <qmessagebox.h>
#include "../qgisplugin.h"
#include "maplayertest.h"
// xpm for creating the toolbar icon
#include "matrix1.xpm"
MapLayerTest::MapLayerTest()
{
}
void MapLayerTest::setQgisMainWindow( Q3MainWindow *app )
{
qgisApp = app;
}
// set the coordinate transform for drawing the layer
void MapLayerTest::setCoordinateTransform( QgsMapToPixel *xform )
{
coordinateTransform = xform;
}
void MapLayerTest::initGui()
{
// setup the menu
Q3PopupMenu *mapLayerPluginMenu = new Q3PopupMenu( qgisApp );
mapLayerPluginMenu->insertItem( "&Add Foobar Layer", this, SLOT( open() ) );
mapLayerPluginMenu->insertItem( "&Unload Foobar Plugin", this, SLOT( unload() ) );
// create the menubar
menu = (( Q3MainWindow * )qgisApp )->menuBar();
menuId = menu->insertItem( "&PluginMenu", mapLayerPluginMenu );
#if 0
QAction *zoomToPreviousAction = new QAction( "Zoom Previous", QIconSet( icon_matrix ), "&Zoom Previous", CTRL + Key_S, qgisMainWindow, "zoomFull" );
connect( zoomToPreviousAction, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) );
#endif
}
void MapLayerTest::unload()
{
// remove the GUI
menu->removeItem( menuId );
// cleanup anything else that needs to be nuked
}
void MapLayerTest::open()
{
// try and open a layer dialog
QMessageBox::information( qgisApp, "Plugin Message", "You clicked the Add Foobar Layer menu item" );
}
void MapLayerTest::draw()
{
}
extern "C" QgsMapLayerInterface * classFactory()
{
return new MapLayerTest();
}
extern "C" QString name()
{
return QString( "Map Layer test plugin" );
}
extern "C" QString description()
{
return QString( "Map Layer test plugin using QgsMapLayerInterface interface" );
}
// Return the type (either UI or MapLayer plugin)
extern "C" int type()
{
return QgisPlugin::MAPLAYER;
}

View File

@ -1,41 +0,0 @@
/***************************************************************************
maplayertest.h
--------------------------------------
Date : Sun Sep 16 12:10:21 AKDT 2007
Copyright : (C) 2007 by Gary E. Sherman
Email : sherman at mrcc dot 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. *
* *
***************************************************************************/
#ifndef QGSMAPLAYERTESTPLUGIN_H
#define QGSMAPLAYERTESTPLUGIN_H
#include <q3mainwindow.h>
#include <qmenubar.h>
#include "../../src/qgsmaplayerinterface.h"
#include "../../src/qgsmaptopixel.h"
class MapLayerTest : public QgsMapLayerInterface
{
Q_OBJECT
public:
MapLayerTest();
void setQgisMainWindow( Q3MainWindow *app );
void setCoordinateTransform( QgsMapToPixel *xform );
public slots:
void initGui();
void open();
void unload();
void draw();
private:
Q3MainWindow *qgisApp;
QMenuBar *menu;
int menuId;
QgsMapToPixel *coordinateTransform;
};
#endif //QGSMAPLAYERTESTPLUGIN_H

View File

@ -1,105 +0,0 @@
/* XPM */
static const char *icon_matrix[] = {
/* width height ncolors chars_per_pixel */
"22 22 76 1",
/* colors */
" c #000000",
". c #00FF00",
"X c #00FD00",
"o c #00FB00",
"O c #00F500",
"+ c #00E300",
"@ c #00DF00",
"# c #00DD00",
"$ c #00DB00",
"% c #00D700",
"& c #00CF00",
"* c #00C700",
"= c #00BB00",
"- c #00B500",
"; c #00B300",
": c #00B100",
"> c #00A300",
", c #00A100",
"< c #009D00",
"1 c #009700",
"2 c #009300",
"3 c #008B00",
"4 c #008300",
"5 c #007300",
"6 c #005500",
"7 c #005300",
"8 c #004B00",
"9 c #002D00",
"0 c #002B00",
"q c #001900",
"w c #00FE00",
"e c #00F800",
"r c #00F600",
"t c #00F400",
"y c #00EC00",
"u c #00EA00",
"i c #00E800",
"p c #00E200",
"a c #00E000",
"s c #00DC00",
"d c #00D800",
"f c #00D400",
"g c #00D000",
"h c #00CC00",
"j c #00CA00",
"k c #00C600",
"l c #00C000",
"z c #00BA00",
"x c #00B600",
"c c #00B200",
"v c #00AC00",
"b c #00AA00",
"n c #00A400",
"m c #00A000",
"M c #009800",
"N c #009400",
"B c #008C00",
"V c #008800",
"C c #008400",
"Z c #008200",
"A c #008000",
"S c #007200",
"D c #007000",
"F c #006A00",
"G c #006600",
"H c #006400",
"J c #006000",
"K c #004600",
"L c #004400",
"P c #004000",
"I c #003400",
"U c #003200",
"Y c #003000",
"T c #001E00",
"R c #000600",
"E c None",
/* pixels */
" 77 PP JL ",
"dd 0R pp PP GK GB jV ",
"9= t5 ff . G. ez PP ",
"cc OS A AT ",
" 0R eF mP ;; Gq kk ",
"qG rL PP 11 aK 77 ",
"Zo 6y PP 77 BB ",
"<r R0 r4 mm 0R 77 ",
"qq i% ,0 ",
" ;q FA .hUTA PP ",
"2: XZ qq Pb P* s5 ",
"8w ;I aa Uh AA gL ",
"T. aa 0, >Y Y> ",
"qC DD YY LJ o4 Lv R0 ",
" @@ l+ PP AT GG Bc ",
"nh 77 R0 PP zM ",
"9i TP qq PP PP PP ",
"77 yY A* GG NN ",
" -Y GG PP DD .M HH ",
"qq qG qq mm vM zz ",
"$u Ka qq qq && qq 77 ",
"3# >> GG xx GG BB "
};