AndroidDeployer Scol plugin
scolPlugin.cpp
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
32#include <string>
33#include <boost/filesystem.hpp>
34
35#include "androidDeployer.h"
36
38
40#ifdef SCOL_STATIC
41extern cbmachine ww;
42extern mmachine mm;
43#else
44cbmachine ww;
45mmachine mm;
46#endif
47
48#ifndef SCOL_STATIC
53extern "C" SCOL_EXPORT int ScolLoadPlugin(mmachine m, cbmachine w)
54{
55 SCOLinitplugin(w);
56
57 // Display debug message
58 MMechostr(MSKDEBUG, "Loading Android Deployer DLL ...\n");
59
60 // Initializing SDK
61 char buffer[MAX_PATH];
62 GetModuleFileName(NULL, buffer, MAX_PATH);
63 boost::filesystem::path tools_directory = buffer;
64 tools_directory = tools_directory.remove_filename();
65 tools_directory /= "\\androidDeployerTools\\";
66 if (boost::filesystem::exists(tools_directory))
67 MMechostr(MSKDEBUG, "tools directory found at %s", tools_directory.generic_string().c_str());
68 else
69 {
70 //Do not arbort here we need the sol definition
71 MMechostr(MSKDEBUG, "error : no tools directory found at %s ...", tools_directory.generic_string().c_str());
72 }
73 toolsPathBox = ToolsPathBox(tools_directory);
74
76
77 MMechostr(MSKDEBUG, "Android Deployer DLL loaded\n");
78 return 0;
79}
80
81
86extern "C" SCOL_EXPORT int ScolUnloadPlugin()
87{
88 // Display debug messages
89 MMechostr(MSKDEBUG, "Android Deployer DLL CLOSED...\n\n" );
90 return 0;
91}
92#else
97extern "C" SCOL_EXPORT int ScolAndroidDeployerLoadPlugin(mmachine m, cbmachine w)
98{
99 SCOLinitplugin(w);
100
101 // Display debug message
102 MMechostr(MSKDEBUG, "Loading Android Deployer DLL ...\n");
103
104 // Initializing SDK
105 char buffer[MAX_PATH];
106 GetModuleFileName(NULL, buffer, MAX_PATH);
107 boost::filesystem::path tools_directory = buffer;
108 tools_directory = tools_directory.remove_filename();
109 tools_directory /= "\\androidDeployerTools\\";
110 if (boost::filesystem::exists(tools_directory))
111 MMechostr(MSKDEBUG, "tools directory found at %s", tools_directory.generic_string().c_str());
112 else
113 {
114 //Do not arbort here we need the sol definition
115 MMechostr(MSKDEBUG, "error : no tools directory found at %s ...", tools_directory.generic_string().c_str());
116 }
117 toolsPathBox = ToolsPathBox(tools_directory);
118
120
121 MMechostr(MSKDEBUG, "Android Deployer DLL loaded\n");
122 return 0;
123}
124
125
130extern "C" SCOL_EXPORT int ScolAndroidDeployerUnloadPlugin()
131{
132 // Display debug messages
133 MMechostr(MSKDEBUG, "Android Deployer DLL CLOSED...\n\n" );
134 return 0;
135}
136#endif //SCOL_STATIC
int LoadAndroidDeployer(mmachine m)
Load the packages in Scol virtual machine.
SCOL_EXPORT int ScolAndroidDeployerUnloadPlugin()
SCOL_EXPORT int ScolAndroidDeployerLoadPlugin(mmachine m, cbmachine w)
SCOL_EXPORT int ScolLoadPlugin(mmachine m, cbmachine w)
Starting point of the DLL Function to add in Scol usm.ini for loading dll.
ToolsPathBox toolsPathBox
cbmachine ww
Scol machine declaration for MM macros.
SCOL_EXPORT int ScolUnloadPlugin()
Ending point of the DLL Function to add in Scol usm.ini for free dll.
mmachine mm