examples/ceditor/main.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
3 
4  This file is part of the TerraLib - a Framework for building GIS enabled applications.
5 
6  TerraLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License,
9  or (at your option) any later version.
10 
11  TerraLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with TerraLib. See COPYING. If not, write to
18  TerraLib Team at <terralib-team@terralib.org>.
19  */
20 
21 /*!
22  \file terralib/examples/ceditor/main.cpp
23 
24  \brief Examples for the TerraLib Code Editor Module
25 
26  \author Frederico Augusto BedĂȘ
27  */
28 
29 // TerraLib
30 #include <terralib/common.h>
31 #include <terralib/core.h>
33 
34 
35 // Qt
36 #include <QApplication>
37 #include <QIcon>
38 
39 // Example
40 #include "MainWindow.h"
41 
42 void LoadModule(std::string m)
43 {
44  std::string mod_name = "share/terralib/plugins/" + m + ".teplg.json";
45  std::string plgManifest = te::core::FindInTerraLibPath(mod_name);
49 }
50 
51 void Initialize()
52 {
54 
55  LoadModule("te.da.gdal");
56  LoadModule("te.da.ogr");
57 // LoadModule("te.da.pgis");
58  //LoadModule("te.vm.lua");
59  LoadModule("te.vm.python");
60 }
61 
62 void Finalize()
63 {
65 
67 }
68 
69 // Main program
70 int main(int argc, char *argv[])
71 {
72  Initialize();
73 
74  std::string iconThemePath = te::core::FindInTerraLibPath("share/terralib/icons");
75 
76  QStringList pts = QIcon::themeSearchPaths();
77 
78  pts << QString::fromUtf8(iconThemePath.c_str());
79 
80  QIcon::setThemeSearchPaths(pts);
81 
82  QIcon::setThemeName("terralib");
83 
84  QApplication app(argc, argv);
85 
86 
88 
89  int r = dialog->exec();
90  /*
91  win.showMaximized();
92 
93  int r = app.exec();
94 */
95  Finalize();
96 
97  return r;
98 }
void insert(const PluginInfo &pinfo)
Adds plugin with its plugin information to the list of unloaded plugins.
Include files for Core Library.
void LoadModule(std::string m)
Basic information about a plugin.
void load(const std::string &plugin_name, const bool start=true)
It tries to load the informed plugin.
int main(int argc, char *argv[])
std::string name
The plugin name: an internal value used to identify the plugin in the system. Must be a unique value...
static PluginManager & instance()
Access the singleton.
void Finalize()
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void Initialize()
void initialize()
It initializes the TerraLib Platform.
TECOREEXPORT PluginInfo JSONPluginInfoSerializer(const std::string &file_name)
A plugin finder that search for plugins in some special directories defined by compile time macros...
Definition: Serializers.cpp:44
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
This file contains include headers for the TerraLib Common Runtime module.
void clear()
Stop and unload all plugins, then clear the internal list of plugins.