2
* This file is part of lib_finder plugin for Code::Blocks Studio
3
* Copyright (C) 2006-2008 Bartlomiej Swiecki
5
* wxSmith is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* wxSmith is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with wxSmith; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20
* $Id: lib_finder.h 7109 2011-04-15 11:53:16Z mortenmacfly $
21
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/lib_finder/lib_finder.h $
24
#ifndef LIB_AUTO_CONF_H
25
#define LIB_AUTO_CONF_H
29
#include <sdk_events.h>
30
#include <tinyxml/tinyxml.h>
32
#include "librarydetectionmanager.h"
33
#include "resultmap.h"
34
#include "projectconfiguration.h"
35
#include "libraryresult.h"
36
#include "pkgconfigmanager.h"
40
class lib_finder: public cbToolPlugin
46
int Configure(){ return 0; }
49
void OnRelease(bool appShutDown);
51
static bool IsExtraEvent();
55
virtual cbConfigurationPanel* GetProjectConfigurationPanel(wxWindow* parent, cbProject* project);
57
void OnProjectHook(cbProject* project,TiXmlElement* elem,bool loading);
58
void OnProjectClose(CodeBlocksEvent& event);
59
void OnCompilerStarted(CodeBlocksEvent& event);
60
void OnCompilerFinished(CodeBlocksEvent& event);
61
void OnCompilerSetBuildOptions(CodeBlocksEvent& event);
62
void SetupTarget(CompileTargetBase* Target,const wxArrayString& Libs);
63
bool TryAddLibrary(CompileTargetBase* Target,LibraryResult* Result);
64
void RegisterScripting();
65
void UnregisterScripting();
66
bool TryDownload(const wxString& ShortCode,const wxString& FileName);
68
// These functions are used in scripting bindings
69
static bool AddLibraryToProject(const wxString& LibName,cbProject* Project,const wxString& TargetName);
70
static bool RemoveLibraryFromProject(const wxString& LibName,cbProject* Project,const wxString& TargetName);
71
static bool IsLibraryInProject(const wxString& LibName,cbProject* Project,const wxString& TargetName);
72
static bool SetupTargetManually(CompileTargetBase* Target);
73
static bool EnsureIsDefined(const wxString& ShortCode);
75
ProjectConfiguration* GetProject(cbProject* Project);
77
WX_DECLARE_HASH_MAP(cbProject*,ProjectConfiguration*,wxPointerHash,wxPointerEqual,ProjectMapT);
78
WX_DECLARE_HASH_MAP(CompileTargetBase*,wxArrayString,wxPointerHash,wxPointerEqual,TargetLibsMapT);
80
ResultMap m_KnownLibraries[rtCount];
82
PkgConfigManager m_PkgConfig;
83
ProjectMapT m_Projects; ///< \brief Extra data for projects
84
TargetLibsMapT m_Targets; ///< \brief Libs for targets in project which is currently being built
87
static lib_finder* m_Singleton;