14 #include <wx/fs_zip.h> 56 #if defined(__APPLE__) && defined(__MACH__) 57 #include <sys/param.h> 58 #include <mach-o/dyld.h> 73 #include <wx/msw/winundef.h> 82 bool s_Loading =
false;
87 DDEServer(
MainFrame* frame) : m_Frame(frame) { ; }
90 void SetFrame(
MainFrame* frame) { m_Frame = frame; }
98 DDEConnection(
MainFrame* frame) : m_Frame(frame) { ; }
99 #if wxCHECK_VERSION(3, 0, 0) 100 bool OnExecute(
const wxString& topic,
const void *data,
size_t size,
105 bool OnDisconnect()
override;
112 return topic ==
DDE_TOPIC ?
new DDEConnection(m_Frame) :
nullptr;
115 #if wxCHECK_VERSION(3, 0, 0) 116 bool DDEConnection::OnExecute(cb_unused
const wxString& topic,
const void *data,
size_t size,
121 bool DDEConnection::OnExecute(cb_unused
const wxString& topic,
wxChar *data,
int size,
159 if (m_Frame->IsIconized())
160 m_Frame->Iconize(
false);
167 int pos = strData.
Find(
_T(
"})]"));
174 if (m_Frame && !line.
empty())
189 bool DDEConnection::OnDisconnect()
193 if (!s_Loading && m_Frame)
202 DDEServer* g_DDEServer =
nullptr;
207 wxConnectionBase *OnMakeConnection(
void)
override {
return new DDEConnection(
nullptr); }
210 #if wxUSE_CMDLINE_PARSER 211 #if wxCHECK_VERSION(3, 0, 0) 212 #define CMD_ENTRY(X) X 214 #define CMD_ENTRY(X) _T(X) 282 #endif // wxUSE_CMDLINE_PARSER 287 Splash(
const bool show) : m_pSplash(
nullptr)
293 dc.SelectObject(bmp);
308 m_pSplash->Destroy();
321 #if wxCHECK_VERSION(3, 0, 0) 322 virtual void Output(
const wxString &str);
324 #ifdef WX_ATTRIBUTE_PRINTF 325 virtual void Printf(
const wxChar* format, ...) WX_ATTRIBUTE_PRINTF_2;
327 void Printf(
const wxChar* format, ...)
override ATTRIBUTE_PRINTF_2;
329 #endif // wxCHECK_VERSION 331 #if wxCHECK_VERSION(3, 0, 0) 332 void cbMessageOutputNull::Output(cb_unused
const wxString &str){}
334 void cbMessageOutputNull::Printf(cb_unused
const wxChar* format, ...){}
346 #if wxCHECK_VERSION(3, 0, 0) 347 #include "wx/osx/core/cfstring.h" 349 #include "wx/mac/corefoundation/cfstring.h" 353 #include <CoreFoundation/CFBundle.h> 354 #include <CoreFoundation/CFURL.h> 360 CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
361 CFURLRef absoluteURL = CFURLCopyAbsoluteURL(resourcesURL);
362 CFRelease(resourcesURL);
363 CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
364 CFRelease(absoluteURL);
365 #if wxCHECK_VERSION(3, 0, 0) 388 if (platform::windows)
389 data.
assign(GetAppPath());
390 else if (platform::macosx)
394 data = GetAppPath() +
_T(
"/..");
399 data.
assign(GetAppPath());
404 if (!m_Prefix.IsEmpty())
415 data.
append(
_T(
"/share/codeblocks"));
417 cfg->
Write(
_T(
"data_path"), data);
429 if (m_Assocs && cfg->
ReadBool(
_T(
"/environment/check_associations"),
true))
439 cfg->
Write(
_T(
"/environment/check_associations"),
false);
463 HANDLE myhandle = GetStdHandle(STD_OUTPUT_HANDLE);
464 COORD co = {80,2000};
465 SetConsoleScreenBufferSize(myhandle, co);
466 fprintf(stdout,
"CONSOLE DEBUG ACTIVATED\n");
485 msg.
Printf(
_T(
"Cannot find resources...\n" 486 "%s was configured to be installed in '%s'.\n" 487 "Please use the command-line switch '--prefix' or " 488 "set the CODEBLOCKS_DATA_DIR environment variable " 489 "to point where %s is installed,\n" 490 "or try re-installing the application..."),
503 static_assert(wxMinimumVersion<2,8,12>::eval,
"wxWidgets 2.8.12 is required");
507 SetTopWindow(
nullptr);
509 if (g_DDEServer && m_DDE)
510 g_DDEServer->SetFrame(frame);
530 if (cfg->
ReadBool(
_T(
"/locale/enable"),
false) ==
false)
567 m_locale.AddCatalog(moName);
568 }
while (dir.
GetNext(&moName));
575 InitCommonControls();
580 SetAppName(
_T(
"codeblocks"));
583 m_pBatchBuildDialog =
nullptr;
586 m_BatchNotify =
false;
590 m_HasProject =
false;
591 m_HasWorkSpace =
false;
593 m_BatchWindowAutoClose =
true;
619 #if (wxUSE_ON_FATAL_EXCEPTION == 1) 623 InitExceptionHandler();
626 if (ParseCmdLine(
nullptr) == -1)
640 if(!m_Batch && m_Script.IsEmpty() && !InitXRCStuff())
645 if (m_DDE && !m_Batch &&
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/use_ipc"),
true))
648 DDEClient *client =
new DDEClient;
649 DDEConnection* connection =
nullptr;
657 for (
int i = 1 ; i < argc; ++i)
665 connection->Execute(
_T(
"[CmdLine({") + cmdLine +
_T(
"})]"));
669 if (
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/raise_via_ipc"),
true))
670 connection->Execute(
_T(
"[Raise]"));
671 connection->Disconnect();
676 log->
Log(
wxT(
"Ending application because another instance has been detected!"));
685 if (m_DDE && !m_Batch)
687 g_DDEServer =
new DDEServer(
nullptr);
691 m_pSingleInstance =
nullptr;
692 if (
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/single_instance"),
true)
693 && !parser.
Found(
_T(
"multiple-instance")) )
698 if (m_pSingleInstance->IsAnotherRunning())
702 cbMessageBox(
_(
"Another program instance is already running.\nCode::Blocks is currently configured to only allow one running instance.\n\nYou can access this Setting under the menu item 'Environment'."),
709 Splash splash(!m_Batch && m_Script.IsEmpty() && m_Splash &&
721 if ( ParseCmdLine(m_Frame) == 0 )
723 if (
Manager::Get()->GetConfigManager(
_T(
"app"))->ReadBool(
_T(
"/environment/blank_workspace"),
true) ==
false)
739 LoadDelayedFiles(frame);
746 if (!m_Script.IsEmpty())
768 catch (SquirrelError& exception)
783 if (platform::windows)
788 LoadDelayedFiles(frame);
804 catch (SquirrelError& exception)
808 catch (
const char* message)
814 wxSafeShowMessage(
_T(
"Exception"),
_T(
"Unknown exception was raised. The application will terminate immediately..."));
824 if (g_DDEServer)
delete g_DDEServer;
826 if (m_pSingleInstance)
827 delete m_pSingleInstance;
834 return m_Batch ? m_BatchExitCode : 0;
840 typedef BOOL (WINAPI *HeapSetInformation_t)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);
841 typedef DWORD (WINAPI *GetProcessHeaps_t)(DWORD, PHANDLE);
843 HINSTANCE kh = GetModuleHandle(TEXT(
"kernel32.dll"));
844 HeapSetInformation_t HeapSetInformation_func = (HeapSetInformation_t) GetProcAddress(kh,
"HeapSetInformation");
845 GetProcessHeaps_t GetProcessHeaps_func = (GetProcessHeaps_t) GetProcAddress(kh,
"GetProcessHeaps");
847 if (GetProcessHeaps_func && HeapSetInformation_func)
849 ULONG HeapFragValue = 2;
851 int n = GetProcessHeaps_func(0, 0);
852 HANDLE *h =
new HANDLE[n];
853 GetProcessHeaps_func(n, h);
855 for (
int i = 0; i < n; ++i)
856 HeapSetInformation_func(h[i], HeapCompatibilityInformation, &HeapFragValue,
sizeof(HeapFragValue));
872 return m_Batch ? m_BatchExitCode : retval;
878 catch (SquirrelError& exception)
882 catch (
const char* message)
888 wxSafeShowMessage(
_(
"Exception"),
_(
"Unknown exception was raised. The application will terminate immediately..."));
901 #if wxUSE_DEBUGREPORT && wxUSE_XML && wxUSE_ON_FATAL_EXCEPTION 906 if ( preview.
Show(report) )
924 if (!m_Clean && m_BatchTarget.Lower() ==
_T(
"ask"))
926 m_BatchTarget.Clear();
950 m_pBatchBuildDialog = m_Frame->GetBatchBuildDialog();
963 wxString bb_title = m_pBatchBuildDialog->GetTitle();
964 m_pBatchBuildDialog->SetTitle(bb_title + _T(
" - ") + title);
965 m_pBatchBuildDialog->Show();
970 compiler->
Rebuild(m_BatchTarget);
971 else if (m_HasWorkSpace)
977 compiler->
Build(m_BatchTarget);
978 else if (m_HasWorkSpace)
984 compiler->
Clean(m_BatchTarget);
985 else if (m_HasWorkSpace)
992 if (m_pBatchBuildDialog)
998 m_pBatchBuildDialog->ShowModal();
1000 if ( m_pBatchBuildDialog->IsModal() )
1001 m_pBatchBuildDialog->EndModal(
wxID_OK);
1004 m_pBatchBuildDialog->Destroy();
1005 m_pBatchBuildDialog =
nullptr;
1022 static bool one_time_only =
false;
1023 if (!m_Batch || one_time_only)
1025 one_time_only =
true;
1033 if (m_BatchExitCode == 0)
1034 msg <<
_(
"Batch build ended.\n");
1036 msg <<
_(
"Batch build stopped with errors.\n");
1037 msg <<
wxString::Format(
_(
"Process exited with status code %d."), m_BatchExitCode);
1043 if (m_pBatchBuildDialog && m_BatchWindowAutoClose)
1045 if (m_pBatchBuildDialog->IsModal())
1046 m_pBatchBuildDialog->EndModal(
wxID_OK);
1049 m_pBatchBuildDialog->Destroy();
1050 m_pBatchBuildDialog =
nullptr;
1058 if (m_pBatchBuildDialog)
1060 m_pBatchBuildDialog->Raise();
1061 m_pBatchBuildDialog->Refresh();
1069 wxChar name[MAX_PATH] = {0};
1070 GetModuleFileName(0L, name, MAX_PATH);
1072 base = fname.
GetPath(wxPATH_GET_VOLUME);
1074 if (!m_Prefix.IsEmpty())
1081 base =
wxString(SELFPATH,wxConvUTF8);
1084 #if defined(sun) || defined(__sun) 1085 base =
wxString(getexecname(),wxConvCurrent);
1088 #if defined(__APPLE__) && defined(__MACH__) 1089 char path[MAXPATHLEN+1];
1090 uint32_t path_len = MAXPATHLEN;
1092 _NSGetExecutablePath(path, &path_len);
1110 bool filesInCmdLine =
false;
1112 #if wxUSE_CMDLINE_PARSER 1114 if ( CmdLineString.
IsEmpty() )
1122 int res = parser.
Parse(
false);
1131 m_HasProject =
false;
1132 m_HasWorkSpace =
false;
1135 parser.
Found(
_T(
"file"), &m_AutoFile);
1137 filesInCmdLine = (count != 0) || (!m_AutoFile.empty());
1139 for (
int param = 0; param < count; ++param)
1147 m_HasProject =
true;
1148 m_DelayedFilesToOpen.Add(parser.
GetParam(param));
1153 m_HasWorkSpace =
true;
1154 m_DelayedFilesToOpen.Clear();
1155 m_DelayedFilesToOpen.Add(fn.GetFullPath());
1161 m_DelayedFilesToOpen.Add(fn.GetFullPath());
1166 m_Batch = m_HasProject || m_HasWorkSpace;
1167 m_Batch = m_Batch && (m_Build || m_ReBuild || m_Clean);
1172 parser.
Found(
_T(
"prefix"), &m_Prefix);
1173 parser.
Found(
_T(
"user-data-dir"), &m_UserDataDir);
1175 m_DDE = !parser.
Found(
_T(
"no-dde"));
1176 m_Assocs = !parser.
Found(
_T(
"no-check-associations"));
1178 m_DDE = !parser.
Found(
_T(
"no-ipc"));
1180 m_SafeMode = parser.
Found(
_T(
"safe-mode"));
1181 m_Splash = !parser.
Found(
_T(
"no-splash-screen"));
1182 m_HasDebugLog = parser.
Found(
_T(
"debug-log"));
1183 m_CrashHandler = !parser.
Found(
_T(
"no-crash-handler"));
1187 if ( parser.
Found(
_T(
"personality"), &val)
1188 || parser.
Found(
_T(
"profile"), &val) )
1190 SetupPersonality(val);
1194 m_BatchNotify = parser.
Found(
_T(
"batch-build-notify"));
1195 m_BatchWindowAutoClose = !parser.
Found(
_T(
"no-batch-window-close"));
1196 m_Build = parser.
Found(
_T(
"build"));
1197 m_ReBuild = parser.
Found(
_T(
"rebuild"));
1198 m_Clean = parser.
Found(
_T(
"clean"));
1199 parser.
Found(
_T(
"target"), &m_BatchTarget);
1200 parser.
Found(
_T(
"script"), &m_Script);
1202 m_Batch = m_Build || m_ReBuild || m_Clean;
1205 if (parser.
Found(
_T(
"no-log")) ==
false)
1207 if (parser.
Found(
_T(
"log-to-file")))
1211 if (parser.
Found(
_T(
"debug-log-to-file")))
1216 parser.
Found(
_T(
"dbg-attach"), &m_DebuggerAttach);
1217 parser.
Found(
_T(
"dbg-config"), &m_DebuggerConfig);
1219 #endif // wxUSE_CMDLINE_PARSER 1220 return filesInCmdLine ? 1 : 0;
1230 _(
"Personalities (profiles)"),
1242 std::set<wxString> uniqueFilesToOpen(m_DelayedFilesToOpen.begin(), m_DelayedFilesToOpen.end());
1243 for (std::set<wxString>::const_iterator it = uniqueFilesToOpen.begin(); it != uniqueFilesToOpen.end(); ++it)
1244 frame->
Open(*it,
true);
1245 m_DelayedFilesToOpen.Clear();
1248 if (!m_AutoFile.IsEmpty())
1253 long linePos = m_AutoFile.
Find(
_T(
':'),
true);
1257 filePart.
Remove(linePos);
1266 if ( !linePart.
ToLong(&line) )
1269 filePart = m_AutoFile;
1274 if (!filePart.
empty())
1281 if (eb && (line != -1))
1291 const wxString localAttach = m_DebuggerAttach;
1292 const wxString localConfig = m_DebuggerConfig;
1295 m_DebuggerAttach = m_DebuggerConfig =
wxString();
1299 if (localAttach.
empty() || localConfig.
empty())
1301 if (localAttach.
empty() != localConfig.
empty())
1304 _(
"For attaching to work you need to provide both '--dbg-attach' and '--dbg-config'"));
1305 logManager->
Log(
wxT(
" --dbg-attach='") + localAttach +
wxT(
"'"));
1306 logManager->
Log(
wxT(
" --dbg-config='") + localConfig +
wxT(
"'"));
1319 _(
"No delimiter found. The --dbg-config format is 'plugin-name:config-name'"));
1329 if (debuggers.empty())
1331 logManager->
LogError(
_(
"No debugger plugins loaded!"));
1336 int configIndex = -1;
1339 for (
const auto &info : debuggers)
1341 if (info.first->GetSettingsName() == pluginName)
1343 plugin = info.first;
1344 pluginData = &info.second;
1353 logManager->
Log(
_(
"Available plugins:"));
1354 for (
const auto &info : debuggers)
1364 for (
auto it = configs.begin(); it != configs.end(); ++it)
1366 if ((*it)->GetName() == configName)
1368 configIndex = std::distance(configs.begin(), it);
1373 if (configIndex == -1)
1377 logManager->
Log(
_(
"Available configurations:"));
1384 logManager->
Log(
_(
"Debugger plugin and configuration found. Attaching!!!"));
1394 m_DelayedFilesToOpen.Add(fileName);
1396 m_Frame->Open(fileName,
true);
1448 static_cast<ProjectManagerUI*
>(prjManUI)->CheckForExternallyModifiedProjects();
1462 m_DelayedFilesToOpen.Add(filename);
wxString F(const wxChar *msg,...)
sprintf-like function
void wxSafeShowMessage(const wxString &title, const wxString &text)
void SetActiveConfig(int index)
static void SetUpdateInterval(long updateInterval)
void OnAppActivate(wxActivateEvent &event)
IMPLEMENT_APP(CodeBlocksApp) bool CodeBlocksApp
bool wxGetEnv(const wxString &var, wxString *value)
bool Matches(const wxString &mask) const
PluginManager * GetPluginManager() const
void SetPersonality(const wxString &personality, bool createIfNotExist=false)
Use this once, on program startup to set the working personality.
wxString GetAppPath() const
virtual int GetExitCode() const =0
Get the exit code of the last build process.
static void ProcessPendingEvents()
ConfigurationVector & GetConfigurations()
virtual bool SetIcon(const wxIcon &icon, const wxString &tooltip=wxEmptyString)
#define ASC_ASSOC_DLG_NO_ONLY_NOW
static bool LoadResource(const wxString &file)
void InitExceptionHandler()
ConfigManager * GetConfigManager(const wxString &name_space) const
Base class for debugger plugins.
static void Free()
Never, EVER, call this function! It is the last function called on shutdown....
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
wxString substr(size_t nStart=0, size_t nLen=npos) const
EVTIMPORT const wxEventType cbEVT_COMPILER_FINISHED
void LoadDelayedFiles(MainFrame *frame)
static void SetSafeMode(bool on)
static bool IsAppShuttingDown()
virtual bool RemoveIcon()
static void SetBatchBuild(bool is_batch)
bool GetFirst(wxString *filename, const wxString &filespec=wxEmptyString, int flags=wxDIR_DEFAULT) const
DLLIMPORT wxBitmap cbLoadBitmap(const wxString &filename, wxBitmapType bitmapType=wxBITMAP_TYPE_PNG)
This function loads a bitmap from disk.
PersonalityManager * GetPersonalityManager() const
Scripts folder in base dir.
void ShowTips(bool forceShow=false)
bool ReadBool(const wxString &name, bool defaultVal=false)
virtual void MacOpenFile(const wxString &fileName)
size_t GetParamCount() const
Scripts folder in user's dir.
virtual int CleanWorkspace(const wxString &target=wxEmptyString)=0
Clean all open projects.
FileManager * GetFileManager() const
const wxString AppActualVersionVerb
bool wxDirExists(const wxString &dirname)
bool Matches(const wxString &text, int flags=0) const
wxString & append(const wxString &str, size_t pos, size_t n)
FileType
Known file types.
DLLIMPORT FileType FileTypeOf(const wxString &filename)
#define wxICON_INFORMATION
bool wxHandleFatalExceptions(bool doIt=true)
wxString & Remove(size_t pos)
EVTIMPORT const wxEventType cbEVT_APP_CMDLINE
void SetCmdLine(int argc, char **argv)
size_t find(const wxString &str, size_t nStart=0) const
A generic Code::Blocks event.
static const wxLanguageInfo * FindLanguageInfo(const wxString &locale)
int CmpNoCase(const wxString &s) const
virtual bool OnCmdLineParsed(wxCmdLineParser &parser)
virtual wxConnectionBase * OnAcceptConnection(const wxString &topic)
static wxString LocateDataFile(const wxString &filename, int search_dirs=sdAllKnown)
Locate a file in an installation- and platform-independent way.
Base class for compiler plugins.
virtual void AttachToProcess(const wxString &pid)=0
EditorManager * GetEditorManager() const
void LogError(const wxString &msg, int i=app_log)
virtual int BuildWorkspace(const wxString &target=wxEmptyString)=0
Build all open projects.
bool Show(wxDebugReport &dbgrpt) const
wxUSE_UNICODE_dependent wxChar
void SetAutoFile(wxString &file)
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
bool LoadScript(const wxString &filename)
Loads a script.
bool Contains(const wxString &str) const
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
DebuggerManager * GetDebuggerManager() const
void wxPostEvent(wxEvtHandler *dest, const wxEvent &event)
bool Found(const wxString &name) const
Represents a Code::Blocks project.
const wxString & GetActiveBuildTarget() const
void SetupPersonality(const wxString &personality)
const wxString AppActualVersion
cbStyledTextCtrl * GetControl() const
Returns a pointer to the underlying cbStyledTextCtrl object (which itself is the wxWindows implementa...
DLLIMPORT int idEditorManagerCheckFiles
void AddAll(Context context=Context_Exception)
static wxCmdLineParser * GetCmdLineParser()
DLLIMPORT wxString cbC2U(const char *str)
Return str as a proper unicode-compatible string.
virtual const wxString & GetTitle() const
Read the target's title.
wxString GetSettingsName() const
EVTIMPORT const wxEventType cbEVT_APP_DEACTIVATED
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
virtual int RebuildWorkspace(const wxString &target=wxEmptyString)=0
Rebuild all open projects.
static wxMessageOutput * Set(wxMessageOutput *msgout)
void AddFileToOpenDelayed(const wxString &filename)
a logger which prints messages to a wxTextCtrl
EVTIMPORT const wxEventType cbEVT_APP_ACTIVATED
cbEditor * GetBuiltinActiveEditor()
#define ASC_ASSOC_DLG_YES_ALL_FILES
void SetDesc(const wxCmdLineEntryDesc *desc)
bool OnCmdLineParsed(wxCmdLineParser &parser)
bool GetMatch(size_t *start, size_t *len, size_t index=0) const
const wxString AppBuildTimestamp
Base class that all "editors" should inherit from.
LogManager * GetLogManager() const
cbProject * GetActiveProject()
Retrieve the active project.
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
static wxString GetTempFolder()
int Parse(bool giveUsage=true)
virtual int Clean(ProjectBuildTarget *target=nullptr)=0
Clean the project/target.
static void AddHandler(wxFileSystemHandler *handler)
void wxInitAllImageHandlers()
void DisplayErrors(SquirrelError *exception=nullptr, bool clearErrors=true)
Display error dialog.
const wxStringCharType * wx_str() const
static wxFontEncoding GetSystemEncoding()
int ParseCmdLine(MainFrame *handlerFrame, const wxString &CmdLine=wxEmptyString)
wxString & assign(const wxString &str, size_t pos, size_t n)
virtual void MacPrintFile(const wxString &fileName)
void OnTBIconLeftDown(wxTaskBarIconEvent &event)
const wxString & _(const wxString &string)
EditorBase * GetEditor(int index)
void ShowErrorMessage(bool safe=true)
Display exception error message.
std::map< cbDebuggerPlugin *, PluginData > RegisteredPlugins
int GetBuildTargetsCount()
static void Yield()
Whenever you need to call wxYield(), call Manager::Yield(). It's safer.
cb_must_consume_result LoaderBase * Load(const wxString &file, bool reuseEditors=false)
Loads a file, once this function is called, the actually loading process is done in the worker thread...
EVTIMPORT const wxEventType cbEVT_APP_STARTUP_DONE
static wxString GetDataFolder(bool global=true)
ProjectBuildTarget * GetBuildTarget(int index)
Access a build target.
static bool Exists(const wxString &filename)
bool ToLong(long *val, int base=10) const
a logger which prints messages to a file
void WorkspaceChanged()
Sends message to the plugins that the workspace has been changed.
wxString & Append(const char *psz)
bool GetNext(wxString *filename) const
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
wxString GetResourcesDir()
RegisteredPlugins const & GetAllDebuggers() const
wxString GetGUIName() const
wxString GetPath(int flags=wxPATH_GET_VOLUME, wxPathFormat format=wxPATH_NATIVE) const
#define ASC_ASSOC_DLG_YES_C_FILES
static bool SetUserDataFolder(const wxString &user_data_path)
cbAuiNotebook * GetNotebook()
void Log(const wxString &msg, int i=app_log, Logger::level lv=Logger::info)
static void SetAppStartedUp(bool app_started_up)
bool ProcessEvent(CodeBlocksEvent &event)
static bool EnableLogging(bool enable=true)
static void DrawReleaseInfo(class wxDC &dc)
cbCompilerPlugin * GetFirstCompiler() const
void RegisterEventSink(wxEventType eventType, IEventFunctorBase< CodeBlocksEvent > *functor)
static wxString ReadDataPath()
std::vector< cbDebuggerConfiguration * > ConfigurationVector
static const wxLanguageInfo * GetLanguageInfo(int lang)
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
virtual void GotoLine(int, bool=true)
Move the caret at the specified line.
Represents a Code::Blocks project build target.
bool Normalize(int flags=wxPATH_NORM_ALL, const wxString &cwd=wxEmptyString, wxPathFormat format=wxPATH_NATIVE)
void InsertHandler(wxXmlResourceHandler *handler)
wxString GetStringSelection() const
static wxString GetTextFromData(const void *data, size_t size, wxIPCFormat format)
virtual int Build(ProjectBuildTarget *target=nullptr)=0
Build the project/target.
int Find(wxUniChar ch, bool fromEnd=false) const
bool Open(const wxString &filename, bool addToHistory=true)
static wxXmlResource * Get()
bool LoadWorkspace(const wxString &filename=DEFAULT_WORKSPACE)
Load a workspace.
ScriptingManager * GetScriptingManager() const
void OnBatchBuildDone(CodeBlocksEvent &event)
int Printf(const wxString &pszFormat,...)
wxString GetFullPath(wxPathFormat format=wxPATH_NATIVE) const
bool LoadBuffer(const wxString &buffer, const wxString &debugName=_T("CommandLine"))
Loads a string buffer.
int SelectTarget(int initial=-1, bool evenIfOne=false)
Displays a target selection dialog.
size_t SetLog(Logger *l, int index=no_index)
Code::Blocks error handling unit.
static wxString Format(const wxString &format,...)
wxString Mid(size_t first, size_t nCount=wxString::npos) const
#define ASC_ASSOC_DLG_NO_DONT_ASK
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
static void AddCatalogLookupPathPrefix(const wxString &prefix)
wxString GetParam(size_t n=0) const
virtual int Rebuild(ProjectBuildTarget *target=nullptr)=0
Rebuild the project/target.
wxString wxFileNameFromPath(const wxString &path)