summaryrefslogtreecommitdiffstats
path: root/src/ui/edit.h
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2013-03-17 19:01:32 +0100
committererihel <erihel@gmail.com>2013-03-17 19:01:32 +0100
commitd6bbc99c90ef586b041651d373524b30fe6c8676 (patch)
treee01eee683dc4e693450769a441a37c9d070b97d1 /src/ui/edit.h
parent9f5bef030d97e9ee20d8c635335fdafd854fed44 (diff)
downloadcolobot-d6bbc99c90ef586b041651d373524b30fe6c8676.tar.gz
colobot-d6bbc99c90ef586b041651d373524b30fe6c8676.tar.bz2
colobot-d6bbc99c90ef586b041651d373524b30fe6c8676.zip
* Changed file loading to fix issue #73
* Moved few functions from misc.cpp to profile.cpp (used to set/get user dir) * Removed some warnings * More work to change const char* to std::string * Some work on file path to fix issue #60 with bad slashes on POSIX platform
Diffstat (limited to 'src/ui/edit.h')
-rw-r--r--src/ui/edit.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/ui/edit.h b/src/ui/edit.h
index 8f46445..72423fa 100644
--- a/src/ui/edit.h
+++ b/src/ui/edit.h
@@ -35,7 +35,12 @@
#include "common/restext.h"
#include <set>
+#include <string>
+#include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
+
+namespace fs = boost::filesystem;
namespace Ui {
@@ -84,7 +89,7 @@ enum OperUndo
struct ImageLine
{
//! name of the image (without diagram \)
- char name[40];
+ std::string name;
//! vertical offset (v texture)
float offset;
//! height of the part (dv texture)
@@ -96,15 +101,15 @@ struct ImageLine
struct HyperLink
{
//! text file name (without help \)
- char name[40];
+ std::string name;
//! name of the marker
- char marker[20];
+ std::string marker;
};
struct HyperMarker
{
//! name of the marker
- char name[20];
+ std::string name;
//! position in the text
int pos;
};
@@ -112,7 +117,7 @@ struct HyperMarker
struct HyperHistory
{
//! full file name text
- char filename[50];
+ std::string filename;
//! rank of the first displayed line
int firstLine;
};
@@ -140,8 +145,8 @@ public:
char* GetText();
int GetTextLength();
- bool ReadText(const char *filename, int addSize=0);
- bool WriteText(const char *filename);
+ bool ReadText(std::string filename, int addSize=0);
+ bool WriteText(std::string filename);
void SetMaxChar(int max);
int GetMaxChar();
@@ -183,7 +188,7 @@ public:
bool Undo();
void HyperFlush();
- void HyperHome(const char *filename);
+ void HyperHome(std::string filename);
bool HyperTest(EventType event);
bool HyperGo(EventType event);
@@ -202,15 +207,15 @@ protected:
int MouseDetect(Math::Point mouse);
void MoveAdjust();
- void HyperJump(const char *name, const char *marker);
- bool HyperAdd(const char *filename, int firstLine);
+ void HyperJump(std::string name, std::string marker);
+ bool HyperAdd(std::string filename, int firstLine);
- void DrawImage(Math::Point pos, const char *name, float width, float offset, float height, int nbLine);
+ void DrawImage(Math::Point pos, std::string name, float width, float offset, float height, int nbLine);
void DrawBack(Math::Point pos, Math::Point dim);
void DrawPart(Math::Point pos, Math::Point dim, int icon);
void FreeImage();
- void LoadImage(const char *name);
+ void LoadImage(std::string name);
void Scroll(int pos, bool bAdjustCursor);
void Scroll();
void MoveChar(int move, bool bWord, bool bSelect);