leocad/common/lc_application.h

83 lines
1.6 KiB
C
Raw Normal View History

2013-08-09 04:57:18 +00:00
#ifndef _LC_APPLICATION_H_
#define _LC_APPLICATION_H_
2013-08-15 23:43:18 +00:00
#include "lc_array.h"
2013-08-09 04:57:18 +00:00
#include "str.h"
class Project;
class lcPiecesLibrary;
enum lcLightingMode
{
LC_LIGHTING_FLAT,
LC_LIGHTING_FAKE,
LC_LIGHTING_FULL
};
class lcPreferences
{
public:
void LoadDefaults();
void SaveDefaults();
int mMouseSensitivity;
lcLightingMode mLightingMode;
bool mDrawAxes;
bool mDrawEdgeLines;
float mLineWidth;
bool mDrawGridStuds;
lcuint32 mGridStudColor;
bool mDrawGridLines;
int mGridLineSpacing;
lcuint32 mGridLineColor;
2014-10-05 05:21:51 +00:00
bool mFixedAxes;
};
2013-08-09 04:57:18 +00:00
class lcApplication
{
2015-01-30 16:30:13 +00:00
Q_DECLARE_TR_FUNCTIONS(lcApplication);
2013-08-09 04:57:18 +00:00
public:
lcApplication();
~lcApplication();
2014-12-04 01:47:28 +00:00
void SetProject(Project* Project);
bool Initialize(int argc, char *argv[], const char* LibraryInstallPath, const char* LDrawPath);
2013-08-09 04:57:18 +00:00
void Shutdown();
void ShowPreferencesDialog();
2013-08-09 04:57:18 +00:00
bool LoadPiecesLibrary(const char* LibPath, const char* LibraryInstallPath, const char* LDrawPath);
2013-08-09 04:57:18 +00:00
2013-08-16 23:17:25 +00:00
void GetFileList(const char* Path, lcArray<String>& FileList);
2014-12-15 23:55:17 +00:00
void SetClipboard(const QByteArray& Clipboard);
void ExportClipboard(const QByteArray& Clipboard);
2013-08-09 04:57:18 +00:00
Project* mProject;
lcPiecesLibrary* mLibrary;
lcPreferences mPreferences;
2014-12-15 23:55:17 +00:00
QByteArray mClipboard;
2013-08-09 04:57:18 +00:00
protected:
void ParseIntegerArgument(int* CurArg, int argc, char* argv[], int* Value);
void ParseStringArgument(int* CurArg, int argc, char* argv[], char** Value);
};
extern lcApplication* g_App;
inline lcPiecesLibrary* lcGetPiecesLibrary()
{
return g_App->mLibrary;
2013-08-09 04:57:18 +00:00
}
inline Project* lcGetActiveProject()
{
return g_App->mProject;
}
2014-10-05 05:21:51 +00:00
inline lcPreferences& lcGetPreferences()
{
return g_App->mPreferences;
}
2013-08-09 04:57:18 +00:00
#endif // _LC_APPLICATION_H_