diff --git a/CrossBench/CrossBench.project b/CrossBench/CrossBench.project index 683ce53..17dfacf 100644 --- a/CrossBench/CrossBench.project +++ b/CrossBench/CrossBench.project @@ -1,5 +1,8 @@ + + + diff --git a/src/crossexport.cpp b/src/crossexport.cpp new file mode 100644 index 0000000..d058b0a --- /dev/null +++ b/src/crossexport.cpp @@ -0,0 +1,78 @@ +#include "crossexport.hpp" + +void fillCross(FilledCrossword &cross){ + for ( size_t i = 0; i < cross.words.size(); ++i ) { + if ( cross.words.at(i).direct == true ) { + for (size_t j = 0; j < cross.words.at(i).len; ++j){ + cross.grid.at(cross.words.at(i).x+j).at(cross.words.at(i).y) = cross.ans.at(i).at(j); + } + } else { + for (size_t j = 0; j < cross.words.at(i).len; ++j) + cross.grid.at(cross.words.at(i).x).at(cross.words.at(i).y+j) = cross.ans.at(i).at(j); + } + } +} + +wxString getGridString(const FilledCrossword &cross, wxChar space = wxT('-')){ + const wxString LINE_END = wxTextFile::GetEOL(); + + wxString t_string; + + FilledCrossword t_cross(cross); + if ( !t_cross.ans.empty() ) { + fillCross(t_cross); + } + for (size_t i = 0; i < t_cross.grid.at(0).size(); ++i){ + for (size_t j = 0; j < t_cross.grid.size(); ++j){ + if ( t_cross.grid.at(j).at(i) == CELL_BORDER ) + t_string += space; + else + t_string += t_cross.grid.at(j).at(i); + } + t_string += LINE_END; + } + return t_string; +} + +wxString getQuesString(const FilledCrossword &cross){ + const wxString LINE_END = wxTextFile::GetEOL(); + + wxString t_string; + + if ( !cross.ques.empty() ) { // == print questions + t_string += _("Vertical words:") + LINE_END; + + for (size_t i = 0; i < cross.words.size(); ++i){ + if (cross.words.at(i).direct == false) + t_string += wxString::Format(wxT("%d. "), cross.words.at(i).ind) + + cross.ques.at(i) + LINE_END; + } + + t_string += _("Horisontal words:") + LINE_END; + + for (size_t i = 0; i < cross.words.size(); ++i){ + if (cross.words.at(i).direct == true) + t_string += wxString::Format(wxT("%d. "), cross.words.at(i).ind) + + cross.ques.at(i) + LINE_END; + } + } + return t_string; +} + +void exportToString(const FilledCrossword &cross, wxString &str_out, wxChar space = wxT('-')){ + str_out += getGridString(cross, space) + getQuesString(cross); +} + +bool exportToFile(const FilledCrossword &cross, const wxString path){ + wxTextFile f(path); + if ( f.Exists() ) + return false; + f.Create(); + f.Open(path); + wxString cont; + exportToString(cross, cont); + f.AddLine(cont); + f.Write(); + f.Close(); + return true; +} diff --git a/src/crossexport.hpp b/src/crossexport.hpp index 9d99577..667f4fb 100644 --- a/src/crossexport.hpp +++ b/src/crossexport.hpp @@ -2,84 +2,19 @@ #define CROSSEXPORT_HPP #include +#include +#include "crossgen.hpp" #include "crossbasetypes.hpp" -void fillCross(FilledCrossword &cross){ - for ( size_t i = 0; i < cross.words.size(); ++i ) { - if ( cross.words.at(i).direct == true ) { - for (size_t j = 0; j < cross.words.at(i).len; ++j){ - cross.grid.at(cross.words.at(i).x+j).at(cross.words.at(i).y) = cross.ans.at(i).at(j); - } - } else { - for (size_t j = 0; j < cross.words.at(i).len; ++j) - cross.grid.at(cross.words.at(i).x).at(cross.words.at(i).y+j) = cross.ans.at(i).at(j); - } - } -} +void fillCross(FilledCrossword &cross); -wxString getGridString(const FilledCrossword &cross, wxChar space = wxT('-')){ - const wxString LINE_END = wxTextFile::GetEOL(); - - wxString t_string; - - FilledCrossword t_cross(cross); - if ( !t_cross.ans.empty() ) { - fillCross(t_cross); - } - for (size_t i = 0; i < t_cross.grid.at(0).size(); ++i){ - for (size_t j = 0; j < t_cross.grid.size(); ++j){ - if ( t_cross.grid.at(j).at(i) == CELL_BORDER ) - t_string += space; - else - t_string += t_cross.grid.at(j).at(i); - } - t_string += LINE_END; - } - return t_string; -} +wxString getGridString(const FilledCrossword &cross, wxChar space); -wxString getQuesString(const FilledCrossword &cross){ - const wxString LINE_END = wxTextFile::GetEOL(); - - wxString t_string; - - if ( !cross.ques.empty() ) { // == print questions - t_string += _("Vertical words:") + LINE_END; - - for (size_t i = 0; i < cross.words.size(); ++i){ - if (cross.words.at(i).direct == false) - t_string += wxString::Format(wxT("%d. "), cross.words.at(i).ind) - + cross.ques.at(i) + LINE_END; - } - - t_string += _("Horisontal words:") + LINE_END; - - for (size_t i = 0; i < cross.words.size(); ++i){ - if (cross.words.at(i).direct == true) - t_string += wxString::Format(wxT("%d. "), cross.words.at(i).ind) - + cross.ques.at(i) + LINE_END; - } - } - return t_string; -} +wxString getQuesString(const FilledCrossword &cross); -void exportToString(const FilledCrossword &cross, wxString &str_out, wxChar space = wxT('-')){ - str_out += getGridString(cross, space) + getQuesString(cross); -} +void exportToString(const FilledCrossword &cross, wxString &str_out, wxChar space); -bool exportToFile(const FilledCrossword &cross, const wxString path){ - wxTextFile f(path); - if ( f.Exists() ) - return false; - f.Create(); - f.Open(path); - wxString cont; - exportToString(cross, cont); - f.AddLine(cont); - f.Write(); - f.Close(); - return true; -} +bool exportToFile(const FilledCrossword &cross, const wxString path); #endif // CROSSEXPORT_HPP diff --git a/src/crossgen.cpp b/src/crossgen.cpp new file mode 100644 index 0000000..7afd7f3 --- /dev/null +++ b/src/crossgen.cpp @@ -0,0 +1,252 @@ +#include "crossgen.hpp" + + +const wxChar CELL_CLEAR = wxT('+'); +const wxChar CELL_BORDER = wxT('-'); +const TransedChar TRANS_CLEAR = 0; +const TransedChar TRANS_BORDER = 1; +const uint32_t MAX_WORD_COUNT = 262144; // =2^18 + +void readDict(const wxString path, DictType &dict_out){ + wxTextFile f; + f.Open(path); + for ( wxString str = f.GetFirstLine(); !f.Eof(); str = f.GetNextLine() ) { + wxString key,val; + int del_ind = str.Index('-'); + key = str.Left(del_ind-1); + val = str.Right(str.size() - del_ind - 2); + dict_out[key] = val; + } + f.Close(); +}; + +void readGrid(const wxString path, GridType &grid){ + wxTextFile f; + f.Open(path); + wxString str = f.GetFirstLine(); + + grid.resize(str.size()); + for (unsigned int i = 0; i < grid.size(); ++i) + grid.at(i).resize(f.GetLineCount()); + + wxLogDebug(wxT("Total lines: %d. First line is %s and size = %d"),f.GetLineCount(), str.c_str(),str.size()); + unsigned int i = 0; + for ( ; !f.Eof(); str = f.GetNextLine() ) { + wxLogDebug(str); + for (unsigned int j = 0; j < str.size(); ++j) + grid.at(j).at(i) = str.at(j); + ++i; + } + wxLogDebug(wxT("Прочитана сетка размером %d x %d"), + static_cast(grid.size()), static_cast(grid.at(0).size())); + f.Close(); +} + +wxString getFromTransed(const TransedWord &tw, const BackedCharsTransType &bchar_trans){ + wxString s; + s.resize(tw.size()); + for (size_t i = 0; i < tw.size(); ++i){ + s[i] = bchar_trans.at(tw.at(i)); + } + return s; +} + +BackedCharsTransType getFromCharsTransed(const CharsTransType &char_trans){ + BackedCharsTransType t; + for (auto it = char_trans.begin(); it != char_trans.end(); ++it) + t[it->second] = it->first; + return t; +} + +void toWorkGridType(const GridType &grid, WorkGridType &grid_out){ + grid_out.clear(); + grid_out.resize(grid.size()); + for (size_t i = 0; i < grid.size(); ++i){ + grid_out.at(i).resize(grid.at(0).size()); + for (size_t j = 0; j < grid.at(0).size(); ++j){ + if ( grid.at(i).at(j) == CELL_CLEAR ) + grid_out.at(i).at(j) = TRANS_CLEAR; + else + grid_out.at(i).at(j) = TRANS_BORDER; + } + } +} + +void generateAllWords(const DictType &dict, AllWordsType &words_out, + CharsTransType &char_trans_out){ + words_out.clear(); + char_trans_out.clear(); + char_trans_out[CELL_CLEAR] = TRANS_CLEAR; + char_trans_out[CELL_BORDER] = TRANS_BORDER; + static_assert(TRANS_CLEAR + 1 == TRANS_BORDER, "TRANS_CLEAR + 1 != TRANS_BORDER"); + TransedChar st = TRANS_BORDER + 1; + for (auto it = dict.begin(); it != dict.end(); ++it){ + if ( words_out.size() <= it->first.size() ) + words_out.resize(it->first.size() + 2); + TransedWord t_tw(it->first.size()); + for (size_t i = 0; i < it->first.size(); ++i){ + auto cur_ch = it->first.at(i); + if ( char_trans_out.find(cur_ch) == char_trans_out.end() ){ + char_trans_out[cur_ch] = st; + ++st; + } + t_tw.at(i) = char_trans_out[cur_ch]; + } + words_out.at(it->first.size()).push_back(t_tw); + } +} + +void generateWordInfo(const GridType &grid, std::vector &winfos_out){ + wxLogDebug(wxT("Printing grid: ")); + for (size_t i = 0; i < grid.size(); ++i){ + wxString st; + for (size_t j = 0; j < grid.at(0).size(); ++j) + st += grid.at(i).at(j); + wxLogDebug(st); + } + size_t cur_ind = 1; + bool exist = false; + auto y_len = grid.at(0).size(); + auto x_len = grid.size(); + for (size_t j = 0; j < y_len; ++j){ + for (size_t i = 0; i < x_len; ++i){ + if ( grid.at(i).at(j) == CELL_CLEAR ) { + if ( ((j == 0) || (grid.at(i).at(j - 1) != CELL_CLEAR)) && + (j !=y_len - 1) ) + if ( grid.at(i).at(j+1) == CELL_CLEAR ) { + size_t cur_len = 1; + bool cont = true; + while ( (j + cur_len < y_len) && cont ) { + ++cur_len; + if ( grid.at(i).at(j+cur_len-1) != CELL_CLEAR ) { + cont = false; + --cur_len; + } + } + exist = true; + + WordInfo t; + t.x = i; + t.y = j; + t.len = cur_len; + t.ind = cur_ind; + t.direct = false; + winfos_out.push_back(t); + } + + if ( ((i ==0) || (grid.at(i - 1).at(j) != CELL_CLEAR)) && + (i != x_len - 1) ) + if ( grid.at(i + 1).at(j) == CELL_CLEAR ){ + size_t cur_len = 1; + bool cont = true; + while ((i + cur_len < x_len) && cont){ + ++cur_len; + if (grid.at(i+cur_len-1).at(j) != CELL_CLEAR){ + cont = false; + --cur_len; + } + } + exist = true; + WordInfo t; + t.x = i; + t.y = j; + t.len = cur_len; + t.ind = cur_ind; + t.direct = true; + winfos_out.push_back(t); + } + if ( exist ){ + exist = false; + ++cur_ind; + } + } + } + } +} +/* +template +uint32_t getWordUniq(const T &w_ind, const T &w_len){ + return w_ind + w_len * MAX_WORD_COUNT; +} +*/ +bool procCross( + UsedWords used, + const AllWordsType &words, + WorkGridType grid, + const std::vector &winfos, + const size_t cur_word_ind, + std::vector &out +){ + if (cur_word_ind == winfos.size()) + return true; + WordInfo cur_wi = winfos.at(cur_word_ind); + size_t rand_add = rand() % 100000; + size_t cur_len = cur_wi.len; + size_t cur_words_size = words.at(cur_len).size(); + for (size_t icw = 0; icw < cur_words_size; ++icw){ + if (used.find(getWordUniq(icw,cur_len)) != used.end()) + continue; + TransedWord cur_word = words.at(cur_len).at((icw + rand_add) % cur_words_size); + // Показывает, можно ли записать это слово в сетку + bool can_write = true; + if ( cur_wi.direct == false ){ + for (size_t j = 0; j < cur_wi.len; ++j) + if ((grid.at(cur_wi.x).at(j + cur_wi.y) != TRANS_CLEAR) && + (grid.at(cur_wi.x).at(j + cur_wi.y) != cur_word.at(j))) + can_write = false; + } else { + for (size_t j = 0; j < cur_wi.len; ++j) + if ((grid.at(cur_wi.x + j).at(cur_wi.y) != TRANS_CLEAR) && + (grid.at(cur_wi.x + j).at(cur_wi.y) != cur_word.at(j))) + can_write = false; + } + + if (can_write) { + UsedWords t_used(used); + t_used.insert(getWordUniq(icw,cur_len)); + + WorkGridType t_grid(grid); + + if ( cur_wi.direct ){ + for (size_t j = 0; j < cur_wi.len; ++j) + t_grid.at(cur_wi.x + j).at(cur_wi.y) = cur_word.at(j); + } else { + for (size_t j = 0; j < cur_wi.len; ++j) + t_grid.at(cur_wi.x).at(j + cur_wi.y) = cur_word.at(j); + } + + if (procCross(t_used, words, t_grid, winfos, cur_word_ind + 1, out)){ + out.push_back(cur_word); + return true; + } + } + } + return false; +} + +void generateCross(const GridType &grid, const AllWordsType &words, + const CharsTransType &trans_type, std::vector &words_out){ + + std::vector winfos; + generateWordInfo(grid, winfos); + for (size_t i = 0; i < winfos.size(); ++i) + wxLogDebug(wxT("Word at (%d,%d) with len = %d and index = %d and dir = %d"), + winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct)); + + WorkGridType grid_work; + toWorkGridType(grid, grid_work); + UsedWords t_used; + std::vector< TransedWord > words_trans_out; + procCross(t_used, words, grid_work, winfos, 0, words_trans_out); + std::reverse(words_trans_out.begin(), words_trans_out.end()); + BackedCharsTransType bctt = getFromCharsTransed(trans_type); + words_out.clear(); + words_out.resize(words_trans_out.size()); + std::transform( + words_trans_out.begin(), + words_trans_out.end(), + words_out.begin(), [bctt](const TransedWord &tw){ + return getFromTransed(tw, bctt); + } + ); +} diff --git a/src/crossgen.hpp b/src/crossgen.hpp index 91ff982..0af6d1d 100644 --- a/src/crossgen.hpp +++ b/src/crossgen.hpp @@ -11,168 +11,26 @@ #include "crossbasetypes.hpp" -const wxChar CELL_CLEAR = wxT('+'); -const wxChar CELL_BORDER = wxT('-'); -const TransedChar TRANS_CLEAR = 0; -const TransedChar TRANS_BORDER = 1; -const uint32_t MAX_WORD_COUNT = 262144; // =2^18 +extern const wxChar CELL_CLEAR ; +extern const wxChar CELL_BORDER ; +extern const TransedChar TRANS_CLEAR ; +extern const TransedChar TRANS_BORDER ; +extern const uint32_t MAX_WORD_COUNT ; -void readDict(const wxString path, DictType &dict_out){ - wxTextFile f; - f.Open(path); - for ( wxString str = f.GetFirstLine(); !f.Eof(); str = f.GetNextLine() ) { - wxString key,val; - int del_ind = str.Index('-'); - key = str.Left(del_ind-1); - val = str.Right(str.size() - del_ind - 2); - dict_out[key] = val; - } - f.Close(); -}; +void readDict(const wxString path, DictType &dict_out); -void readGrid(const wxString path, GridType &grid){ - wxTextFile f; - f.Open(path); - wxString str = f.GetFirstLine(); - - grid.resize(str.size()); - for (unsigned int i = 0; i < grid.size(); ++i) - grid.at(i).resize(f.GetLineCount()); - - wxLogDebug(wxT("Total lines: %d. First line is %s and size = %d"),f.GetLineCount(), str.c_str(),str.size()); - unsigned int i = 0; - for ( ; !f.Eof(); str = f.GetNextLine() ) { - wxLogDebug(str); - for (unsigned int j = 0; j < str.size(); ++j) - grid.at(j).at(i) = str.at(j); - ++i; - } - wxLogDebug(wxT("Прочитана сетка размером %d x %d"), - static_cast(grid.size()), static_cast(grid.at(0).size())); - f.Close(); -} +void readGrid(const wxString path, GridType &grid); -wxString getFromTransed(const TransedWord &tw, const BackedCharsTransType &bchar_trans){ - wxString s; - s.resize(tw.size()); - for (size_t i = 0; i < tw.size(); ++i){ - s[i] = bchar_trans.at(tw.at(i)); - } - return s; -} +wxString getFromTransed(const TransedWord &tw, const BackedCharsTransType &bchar_trans); -BackedCharsTransType getFromCharsTransed(const CharsTransType &char_trans){ - BackedCharsTransType t; - for (auto it = char_trans.begin(); it != char_trans.end(); ++it) - t[it->second] = it->first; - return t; -} +BackedCharsTransType getFromCharsTransed(const CharsTransType &char_trans); -void toWorkGridType(const GridType &grid, WorkGridType &grid_out){ - grid_out.clear(); - grid_out.resize(grid.size()); - for (size_t i = 0; i < grid.size(); ++i){ - grid_out.at(i).resize(grid.at(0).size()); - for (size_t j = 0; j < grid.at(0).size(); ++j){ - if ( grid.at(i).at(j) == CELL_CLEAR ) - grid_out.at(i).at(j) = TRANS_CLEAR; - else - grid_out.at(i).at(j) = TRANS_BORDER; - } - } -} +void toWorkGridType(const GridType &grid, WorkGridType &grid_out); void generateAllWords(const DictType &dict, AllWordsType &words_out, - CharsTransType &char_trans_out){ - words_out.clear(); - char_trans_out.clear(); - char_trans_out[CELL_CLEAR] = TRANS_CLEAR; - char_trans_out[CELL_BORDER] = TRANS_BORDER; - static_assert(TRANS_CLEAR + 1 == TRANS_BORDER, "TRANS_CLEAR + 1 != TRANS_BORDER"); - TransedChar st = TRANS_BORDER + 1; - for (auto it = dict.begin(); it != dict.end(); ++it){ - if ( words_out.size() <= it->first.size() ) - words_out.resize(it->first.size() + 2); - TransedWord t_tw(it->first.size()); - for (size_t i = 0; i < it->first.size(); ++i){ - auto cur_ch = it->first.at(i); - if ( char_trans_out.find(cur_ch) == char_trans_out.end() ){ - char_trans_out[cur_ch] = st; - ++st; - } - t_tw.at(i) = char_trans_out[cur_ch]; - } - words_out.at(it->first.size()).push_back(t_tw); - } -} + CharsTransType &char_trans_out); -void generateWordInfo(const GridType &grid, std::vector &winfos_out){ - wxLogDebug(wxT("Printing grid: ")); - for (size_t i = 0; i < grid.size(); ++i){ - wxString st; - for (size_t j = 0; j < grid.at(0).size(); ++j) - st += grid.at(i).at(j); - wxLogDebug(st); - } - size_t cur_ind = 1; - bool exist = false; - auto y_len = grid.at(0).size(); - auto x_len = grid.size(); - for (size_t j = 0; j < y_len; ++j){ - for (size_t i = 0; i < x_len; ++i){ - if ( grid.at(i).at(j) == CELL_CLEAR ) { - if ( ((j == 0) || (grid.at(i).at(j - 1) != CELL_CLEAR)) && - (j !=y_len - 1) ) - if ( grid.at(i).at(j+1) == CELL_CLEAR ) { - size_t cur_len = 1; - bool cont = true; - while ( (j + cur_len < y_len) && cont ) { - ++cur_len; - if ( grid.at(i).at(j+cur_len-1) != CELL_CLEAR ) { - cont = false; - --cur_len; - } - } - exist = true; - - WordInfo t; - t.x = i; - t.y = j; - t.len = cur_len; - t.ind = cur_ind; - t.direct = false; - winfos_out.push_back(t); - } - - if ( ((i ==0) || (grid.at(i - 1).at(j) != CELL_CLEAR)) && - (i != x_len - 1) ) - if ( grid.at(i + 1).at(j) == CELL_CLEAR ){ - size_t cur_len = 1; - bool cont = true; - while ((i + cur_len < x_len) && cont){ - ++cur_len; - if (grid.at(i+cur_len-1).at(j) != CELL_CLEAR){ - cont = false; - --cur_len; - } - } - exist = true; - WordInfo t; - t.x = i; - t.y = j; - t.len = cur_len; - t.ind = cur_ind; - t.direct = true; - winfos_out.push_back(t); - } - if ( exist ){ - exist = false; - ++cur_ind; - } - } - } - } -} +void generateWordInfo(const GridType &grid, std::vector &winfos_out); template uint32_t getWordUniq(const T &w_ind, const T &w_len){ @@ -186,79 +44,9 @@ bool procCross( const std::vector &winfos, const size_t cur_word_ind, std::vector &out -){ - if (cur_word_ind == winfos.size()) - return true; - WordInfo cur_wi = winfos.at(cur_word_ind); - size_t rand_add = rand() % 100000; - size_t cur_len = cur_wi.len; - size_t cur_words_size = words.at(cur_len).size(); - for (size_t icw = 0; icw < cur_words_size; ++icw){ - if (used.find(getWordUniq(icw,cur_len)) != used.end()) - continue; - TransedWord cur_word = words.at(cur_len).at((icw + rand_add) % cur_words_size); - // Показывает, можно ли записать это слово в сетку - bool can_write = true; - if ( cur_wi.direct == false ){ - for (size_t j = 0; j < cur_wi.len; ++j) - if ((grid.at(cur_wi.x).at(j + cur_wi.y) != TRANS_CLEAR) && - (grid.at(cur_wi.x).at(j + cur_wi.y) != cur_word.at(j))) - can_write = false; - } else { - for (size_t j = 0; j < cur_wi.len; ++j) - if ((grid.at(cur_wi.x + j).at(cur_wi.y) != TRANS_CLEAR) && - (grid.at(cur_wi.x + j).at(cur_wi.y) != cur_word.at(j))) - can_write = false; - } - - if (can_write) { - UsedWords t_used(used); - t_used.insert(getWordUniq(icw,cur_len)); - - WorkGridType t_grid(grid); - - if ( cur_wi.direct ){ - for (size_t j = 0; j < cur_wi.len; ++j) - t_grid.at(cur_wi.x + j).at(cur_wi.y) = cur_word.at(j); - } else { - for (size_t j = 0; j < cur_wi.len; ++j) - t_grid.at(cur_wi.x).at(j + cur_wi.y) = cur_word.at(j); - } - - if (procCross(t_used, words, t_grid, winfos, cur_word_ind + 1, out)){ - out.push_back(cur_word); - return true; - } - } - } - return false; -} +); void generateCross(const GridType &grid, const AllWordsType &words, - const CharsTransType &trans_type, std::vector &words_out){ - - std::vector winfos; - generateWordInfo(grid, winfos); - for (size_t i = 0; i < winfos.size(); ++i) - wxLogDebug(wxT("Word at (%d,%d) with len = %d and index = %d and dir = %d"), - winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct)); - - WorkGridType grid_work; - toWorkGridType(grid, grid_work); - UsedWords t_used; - std::vector< TransedWord > words_trans_out; - procCross(t_used, words, grid_work, winfos, 0, words_trans_out); - std::reverse(words_trans_out.begin(), words_trans_out.end()); - BackedCharsTransType bctt = getFromCharsTransed(trans_type); - words_out.clear(); - words_out.resize(words_trans_out.size()); - std::transform( - words_trans_out.begin(), - words_trans_out.end(), - words_out.begin(), [bctt](const TransedWord &tw){ - return getFromTransed(tw, bctt); - } - ); -} + const CharsTransType &trans_type, std::vector &words_out); #endif // CROSSGEN_HPP diff --git a/wxCrossGen/fmain.cpp b/wxCrossGen/fmain.cpp new file mode 100644 index 0000000..7383736 --- /dev/null +++ b/wxCrossGen/fmain.cpp @@ -0,0 +1,185 @@ +#include "fmain.hpp" + + +void MainFrame::procDict(wxString path){ + _dict.clear(); + _allWords.clear(); + _transType.clear(); + readDict(path, _dict); + generateAllWords(_dict, _allWords, _transType); + _isDictLoaded = true; +} + +void MainFrame::onOpenGridClick(wxCommandEvent &event) { + wxFileDialog dlgOpen(this, _("Open crossword file"), wxEmptyString, wxEmptyString, + _("Files of crossword (*.cross)|*.cross"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); + + if ( dlgOpen.ShowModal() == wxID_CANCEL ) + return; + wxFileInputStream input_stream(dlgOpen.GetPath()); + if ( !input_stream.IsOk() ) { + wxMessageBox(_("Cannot open file ") + dlgOpen.GetPath(), _("Error"), wxICON_ERROR ); + return; + } + tPath->SetValue(dlgOpen.GetPath()); + + // Clearing + _grid.clear(); + _ques.clear(); + _ans.clear(); + tOutput->Clear(); + + readGrid(tPath->GetValue(), _grid); + + SetGridImage(_grid); +} + +void MainFrame::SetGridImage(GridType &grid, size_t w) { + size_t h = static_cast(w) / grid.size() * grid.at(0).size(); + wxBitmap bmp(w, h); + wxMemoryDC dc; + dc.SelectObject(bmp); + dc.Clear(); + + std::vector winfos; + generateWordInfo(grid, winfos); + + float sq_w = static_cast(static_cast(w) / grid.size()); + float sq_h = static_cast(static_cast(h) / grid.at(0).size()); + + wxFont cur_f = dc.GetFont(); + cur_f.SetPointSize(sq_h/3); + + dc.SetBrush(wxBrush(wxColour(217,231,200))); + dc.SetFont(cur_f); + + for (size_t i = 0; i < grid.size(); ++i){ + for (size_t j = 0; j < grid.at(0).size(); ++j){ + if (grid.at(i).at(j) == CELL_CLEAR) + dc.DrawRectangle(sq_w*i,sq_h*j,sq_w+1,sq_h+1); + } + } + + for (size_t i = 0; i < winfos.size(); ++i) { + dc.DrawText(wxString::Format(wxT("%d"),winfos.at(i).ind), sq_w*winfos.at(i).x, sq_h*winfos.at(i).y); + } + + if ( _ans.size() > 0 ) { + using std::vector; + vector< vector< bool > > usedCells( + grid.size(), + vector(grid.at(0).size(), false) + ); + cur_f = dc.GetFont(); + cur_f.SetPointSize(sq_h*0.6); + dc.SetFont(cur_f); + for ( size_t i = 0; i < winfos.size(); ++i ) { + if ( winfos.at(i).direct == true ) { + for (size_t j = 0; j < winfos.at(i).len; ++j) + if ( !usedCells.at(winfos.at(i).x+j).at(winfos.at(i).y) ) { + dc.DrawText( + _ans.at(i).at(j), + sq_w*(winfos.at(i).x+j) + sq_w*0.24, + sq_h*winfos.at(i).y + ); + usedCells.at(winfos.at(i).x+j).at(winfos.at(i).y) = true; + } + } else { + for (size_t j = 0; j < winfos.at(i).len; ++j) + if ( !usedCells.at(winfos.at(i).x).at(winfos.at(i).y+j) ) { + dc.DrawText( + _ans.at(i).at(j), + sq_w*winfos.at(i).x + sq_w*0.24, + sq_h*(winfos.at(i).y+j) + ); + usedCells.at(winfos.at(i).x).at(winfos.at(i).y+j) = true; + } + } + } + } + + bPreview->SetBitmap(bmp); + bPreview->Show(); + + dc.SelectObject( wxNullBitmap ); + + this->Refresh(); + this->GetSizer()->RecalcSizes(); +} + +void MainFrame::onGenerateClick(wxCommandEvent &event) { + auto config = wxConfigBase::Get(); + if ( !_isDictLoaded ) { + procDict(config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH)); + } + + std::vector words_out; + if ( _dict.empty() ){ + wxMessageBox( _("Crossword grid isn't loaded!"), _("Info"), wxICON_INFORMATION); + return; + } + try { + generateCross(_grid, _allWords, _transType, words_out); + + _ans = words_out; + + std::vector winfos; + generateWordInfo(_grid, winfos); + + _ques.clear(); + for (size_t i = 0; i < words_out.size(); ++i) + _ques.push_back(_dict[words_out.at(i)]); + + tOutput->Clear(); + + FilledCrossword t_cross; + t_cross.words = winfos; + t_cross.grid = _grid; + t_cross.ans = _ans; + t_cross.ques = _ques; + + tOutput->AppendText(getQuesString(t_cross)); + + if (winfos.size() == 0) + throw 42; + SetGridImage(_grid); + } + catch ( ... ){ + tOutput->Clear(); + wxMessageBox( _("Cannot generate crossword"), _("Error"), wxICON_ERROR ); + } + this->Refresh(); +} + +void MainFrame::onExportClick(wxCommandEvent& event) { + if ( _grid.size() == 0 ) { + wxMessageBox( _("Grid isn't loaded now"), _("Info"), wxICON_INFORMATION ); + return; + } + wxFileDialog dlgSave(this, _("Exporting crossword"), wxEmptyString, wxEmptyString, + _("txt files (*.txt)|*.txt"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); + if (dlgSave.ShowModal() == wxID_CANCEL) + return; + FilledCrossword t_cross; + t_cross.grid = _grid; + t_cross.ans = _ans; + t_cross.ques = _ques; + generateWordInfo(_grid, t_cross.words); + if ( !exportToFile(t_cross, dlgSave.GetPath()) ){ + wxLogError(wxT("Cannot save current contents in file '%s'."), dlgSave.GetPath().GetData()); + return; + } + wxLogDebug(wxT("Exporting to ") + dlgSave.GetPath() + wxT(" is complete")); +} + +void MainFrame::onSettingsClick( wxCommandEvent& event ){ + SettingsDialog fSettings(this); + auto *config = wxConfigBase::Get(); + fSettings.setDictPath(config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH)); + if ( fSettings.ShowModal() == wxID_OK ){ + if ( config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH) != fSettings.getDictPath() ) { + config->Write(SETTINGS_KEY_DICT_PATH, fSettings.getDictPath()); + procDict(fSettings.getDictPath()); + } + } +} diff --git a/wxCrossGen/wxgui.hpp b/wxCrossGen/fmain.hpp similarity index 92% rename from wxCrossGen/wxgui.hpp rename to wxCrossGen/fmain.hpp index fb5eb00..38a2a72 100644 --- a/wxCrossGen/wxgui.hpp +++ b/wxCrossGen/fmain.hpp @@ -1,5 +1,6 @@ -#ifndef WXGUI_HPP -#define WXGUI_HPP +#ifndef FMAIN_HPP +#define FMAIN_HPP + #include #include @@ -7,13 +8,15 @@ #include #include #include +#include #include "fbgui/fbgui.h" +#include "settingsconsts.hpp" #include "crossgen.hpp" +#include "crossexport.hpp" #include "fsettings.hpp" - #ifndef APP_CATALOG #define APP_CATALOG "app" // replace with the appropriate catalog name #endif @@ -59,4 +62,4 @@ public: } }; -#endif // WXGUI_HPP +#endif // FMAIN_HPP diff --git a/wxCrossGen/fsettings.cpp b/wxCrossGen/fsettings.cpp new file mode 100644 index 0000000..cdbf99f --- /dev/null +++ b/wxCrossGen/fsettings.cpp @@ -0,0 +1,25 @@ +#include "fsettings.hpp" + +void SettingsDialog::onDictPathClick(wxCommandEvent& event) { + wxFileDialog dlgOpen(this, _("Open dictionary file"), wxEmptyString, wxEmptyString, + _("Files of dictionaris (*.txt)|*.txt"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); + + if ( dlgOpen.ShowModal() == wxID_CANCEL ) + return; + + wxFileInputStream input_stream(dlgOpen.GetPath()); + if ( !input_stream.IsOk() ) { + wxMessageBox(_("Cannot open dictionary file ") + dlgOpen.GetPath(), _("Error"), wxICON_ERROR); + return; + } + tDictPath->SetValue(dlgOpen.GetPath()); +} + +void SettingsDialog::onOkClick(wxCommandEvent& event) { + wxFileInputStream input_stream(tDictPath->GetValue()); + if ( !input_stream.IsOk() ) { + wxMessageBox(_("Cannot open dictionary file ") + tDictPath->GetValue(), _("Error"), wxICON_ERROR); + return; + } + EndModal(wxID_OK); +} diff --git a/wxCrossGen/fsettings.hpp b/wxCrossGen/fsettings.hpp index 9d6e48f..12bd307 100644 --- a/wxCrossGen/fsettings.hpp +++ b/wxCrossGen/fsettings.hpp @@ -2,6 +2,7 @@ #define FSETTINGS_HPP #include +#include #include "fbgui/fbgui.h" @@ -23,28 +24,4 @@ class SettingsDialog: public VSettingsDialog { } }; -void SettingsDialog::onDictPathClick(wxCommandEvent& event) { - wxFileDialog dlgOpen(this, _("Open dictionary file"), wxEmptyString, wxEmptyString, - _("Files of dictionaris (*.txt)|*.txt"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); - - if ( dlgOpen.ShowModal() == wxID_CANCEL ) - return; - - wxFileInputStream input_stream(dlgOpen.GetPath()); - if ( !input_stream.IsOk() ) { - wxMessageBox(_("Cannot open dictionary file ") + dlgOpen.GetPath(), _("Error"), wxICON_ERROR); - return; - } - tDictPath->SetValue(dlgOpen.GetPath()); -} - -void SettingsDialog::onOkClick(wxCommandEvent& event) { - wxFileInputStream input_stream(tDictPath->GetValue()); - if ( !input_stream.IsOk() ) { - wxMessageBox(_("Cannot open dictionary file ") + tDictPath->GetValue(), _("Error"), wxICON_ERROR); - return; - } - EndModal(wxID_OK); -} - -#endif +#endif // FSETTINGS_HPP diff --git a/wxCrossGen/main.cpp b/wxCrossGen/main.cpp index d532f89..e110f39 100644 --- a/wxCrossGen/main.cpp +++ b/wxCrossGen/main.cpp @@ -8,195 +8,14 @@ #include #include #include -#include "wxgui.hpp" + +#include "fsettings.hpp" +#include "fmain.hpp" #include "crossgen.hpp" #include "crossexport.hpp" #include "settingsconsts.hpp" -void MainFrame::procDict(wxString path){ - _dict.clear(); - _allWords.clear(); - _transType.clear(); - readDict(path, _dict); - generateAllWords(_dict, _allWords, _transType); - _isDictLoaded = true; -} - -void MainFrame::onOpenGridClick(wxCommandEvent &event) { - wxFileDialog dlgOpen(this, _("Open crossword file"), wxEmptyString, wxEmptyString, - _("Files of crossword (*.cross)|*.cross"), wxFD_OPEN|wxFD_FILE_MUST_EXIST); - - if ( dlgOpen.ShowModal() == wxID_CANCEL ) - return; - wxFileInputStream input_stream(dlgOpen.GetPath()); - if ( !input_stream.IsOk() ) { - wxMessageBox(_("Cannot open file ") + dlgOpen.GetPath(), _("Error"), wxICON_ERROR ); - return; - } - tPath->SetValue(dlgOpen.GetPath()); - - // Clearing - _grid.clear(); - _ques.clear(); - _ans.clear(); - tOutput->Clear(); - - readGrid(tPath->GetValue(), _grid); - - SetGridImage(_grid); -} - -void MainFrame::SetGridImage(GridType &grid, size_t w) { - size_t h = static_cast(w) / grid.size() * grid.at(0).size(); - wxBitmap bmp(w, h); - wxMemoryDC dc; - dc.SelectObject(bmp); - dc.Clear(); - - std::vector winfos; - generateWordInfo(grid, winfos); - - float sq_w = static_cast(static_cast(w) / grid.size()); - float sq_h = static_cast(static_cast(h) / grid.at(0).size()); - - wxFont cur_f = dc.GetFont(); - cur_f.SetPointSize(sq_h/3); - - dc.SetBrush(wxBrush(wxColour(217,231,200))); - dc.SetFont(cur_f); - - for (size_t i = 0; i < grid.size(); ++i){ - for (size_t j = 0; j < grid.at(0).size(); ++j){ - if (grid.at(i).at(j) == CELL_CLEAR) - dc.DrawRectangle(sq_w*i,sq_h*j,sq_w+1,sq_h+1); - } - } - - for (size_t i = 0; i < winfos.size(); ++i) { - dc.DrawText(wxString::Format(wxT("%d"),winfos.at(i).ind), sq_w*winfos.at(i).x, sq_h*winfos.at(i).y); - } - - if ( _ans.size() > 0 ) { - using std::vector; - vector< vector< bool > > usedCells( - grid.size(), - vector(grid.at(0).size(), false) - ); - cur_f = dc.GetFont(); - cur_f.SetPointSize(sq_h*0.6); - dc.SetFont(cur_f); - for ( size_t i = 0; i < winfos.size(); ++i ) { - if ( winfos.at(i).direct == true ) { - for (size_t j = 0; j < winfos.at(i).len; ++j) - if ( !usedCells.at(winfos.at(i).x+j).at(winfos.at(i).y) ) { - dc.DrawText( - _ans.at(i).at(j), - sq_w*(winfos.at(i).x+j) + sq_w*0.24, - sq_h*winfos.at(i).y - ); - usedCells.at(winfos.at(i).x+j).at(winfos.at(i).y) = true; - } - } else { - for (size_t j = 0; j < winfos.at(i).len; ++j) - if ( !usedCells.at(winfos.at(i).x).at(winfos.at(i).y+j) ) { - dc.DrawText( - _ans.at(i).at(j), - sq_w*winfos.at(i).x + sq_w*0.24, - sq_h*(winfos.at(i).y+j) - ); - usedCells.at(winfos.at(i).x).at(winfos.at(i).y+j) = true; - } - } - } - } - - bPreview->SetBitmap(bmp); - bPreview->Show(); - - dc.SelectObject( wxNullBitmap ); - - this->Refresh(); - this->GetSizer()->RecalcSizes(); -} - -void MainFrame::onGenerateClick(wxCommandEvent &event) { - auto config = wxConfigBase::Get(); - if ( !_isDictLoaded ) { - procDict(config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH)); - } - - std::vector words_out; - if ( _dict.size() == 0 ){ - wxMessageBox( _("Crossword grid isn't loaded!"), _("Info"), wxICON_INFORMATION); - return; - } - try { - generateCross(_grid, _allWords, _transType, words_out); - - _ans = words_out; - - std::vector winfos; - generateWordInfo(_grid, winfos); - - _ques.clear(); - for (size_t i = 0; i < words_out.size(); ++i) - _ques.push_back(_dict[words_out.at(i)]); - - tOutput->Clear(); - - FilledCrossword t_cross; - t_cross.words = winfos; - t_cross.grid = _grid; - t_cross.ans = _ans; - t_cross.ques = _ques; - - tOutput->AppendText(getQuesString(t_cross)); - - if (winfos.size() == 0) - throw 42; - SetGridImage(_grid); - } - catch ( ... ){ - tOutput->Clear(); - wxMessageBox( _("Cannot generate crossword"), _("Error"), wxICON_ERROR ); - } - this->Refresh(); -} - -void MainFrame::onExportClick(wxCommandEvent& event) { - if ( _grid.size() == 0 ) { - wxMessageBox( _("Grid isn't loaded now"), _("Info"), wxICON_INFORMATION ); - return; - } - wxFileDialog dlgSave(this, _("Exporting crossword"), wxEmptyString, wxEmptyString, - _("txt files (*.txt)|*.txt"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); - if (dlgSave.ShowModal() == wxID_CANCEL) - return; - FilledCrossword t_cross; - t_cross.grid = _grid; - t_cross.ans = _ans; - t_cross.ques = _ques; - generateWordInfo(_grid, t_cross.words); - if ( !exportToFile(t_cross, dlgSave.GetPath()) ){ - wxLogError(wxT("Cannot save current contents in file '%s'."), dlgSave.GetPath().GetData()); - return; - } - wxLogDebug(wxT("Exporting to ") + dlgSave.GetPath() + wxT(" is complete")); -} - -void MainFrame::onSettingsClick( wxCommandEvent& event ){ - SettingsDialog fSettings(this); - auto *config = wxConfigBase::Get(); - fSettings.setDictPath(config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH)); - if ( fSettings.ShowModal() == wxID_OK ){ - if ( config->Read(SETTINGS_KEY_DICT_PATH, SETTINGS_DEFAULT_DICTPATH) != fSettings.getDictPath() ) { - config->Write(SETTINGS_KEY_DICT_PATH, fSettings.getDictPath()); - procDict(fSettings.getDictPath()); - } - } -} - class MyApp: public wxApp { public: bool OnInit(); diff --git a/wxCrossGen/wxCrossGen.mk b/wxCrossGen/wxCrossGen.mk index c0afb24..9167ed0 100644 --- a/wxCrossGen/wxCrossGen.mk +++ b/wxCrossGen/wxCrossGen.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Aleksey Lobanov -Date :=19/06/15 +Date :=20/06/15 CodeLitePath :="/home/alex/.codelite" LinkerName :=/usr/bin/g++-4.8 SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC @@ -60,7 +60,7 @@ AS := /usr/bin/as ## User defined environment variables ## CodeLiteDir:=/usr/share/codelite -Objects0=$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) +Objects0=$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IntermediateDirectory)/fmain.cpp$(ObjectSuffix) $(IntermediateDirectory)/fsettings.cpp$(ObjectSuffix) $(IntermediateDirectory)/src_crossexport.cpp$(ObjectSuffix) $(IntermediateDirectory)/src_crossgen.cpp$(ObjectSuffix) $(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) @@ -95,6 +95,38 @@ $(IntermediateDirectory)/main.cpp$(DependSuffix): main.cpp $(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main.cpp$(PreprocessSuffix) "main.cpp" +$(IntermediateDirectory)/fmain.cpp$(ObjectSuffix): fmain.cpp $(IntermediateDirectory)/fmain.cpp$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/wxCrossGen/fmain.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/fmain.cpp$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/fmain.cpp$(DependSuffix): fmain.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/fmain.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/fmain.cpp$(DependSuffix) -MM "fmain.cpp" + +$(IntermediateDirectory)/fmain.cpp$(PreprocessSuffix): fmain.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fmain.cpp$(PreprocessSuffix) "fmain.cpp" + +$(IntermediateDirectory)/fsettings.cpp$(ObjectSuffix): fsettings.cpp $(IntermediateDirectory)/fsettings.cpp$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/wxCrossGen/fsettings.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/fsettings.cpp$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/fsettings.cpp$(DependSuffix): fsettings.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/fsettings.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/fsettings.cpp$(DependSuffix) -MM "fsettings.cpp" + +$(IntermediateDirectory)/fsettings.cpp$(PreprocessSuffix): fsettings.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fsettings.cpp$(PreprocessSuffix) "fsettings.cpp" + +$(IntermediateDirectory)/src_crossexport.cpp$(ObjectSuffix): ../src/crossexport.cpp $(IntermediateDirectory)/src_crossexport.cpp$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/src/crossexport.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_crossexport.cpp$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/src_crossexport.cpp$(DependSuffix): ../src/crossexport.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_crossexport.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/src_crossexport.cpp$(DependSuffix) -MM "../src/crossexport.cpp" + +$(IntermediateDirectory)/src_crossexport.cpp$(PreprocessSuffix): ../src/crossexport.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_crossexport.cpp$(PreprocessSuffix) "../src/crossexport.cpp" + +$(IntermediateDirectory)/src_crossgen.cpp$(ObjectSuffix): ../src/crossgen.cpp $(IntermediateDirectory)/src_crossgen.cpp$(DependSuffix) + $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/src/crossgen.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/src_crossgen.cpp$(ObjectSuffix) $(IncludePath) +$(IntermediateDirectory)/src_crossgen.cpp$(DependSuffix): ../src/crossgen.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/src_crossgen.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/src_crossgen.cpp$(DependSuffix) -MM "../src/crossgen.cpp" + +$(IntermediateDirectory)/src_crossgen.cpp$(PreprocessSuffix): ../src/crossgen.cpp + @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/src_crossgen.cpp$(PreprocessSuffix) "../src/crossgen.cpp" + $(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix): fbgui/fbgui.cpp $(IntermediateDirectory)/fbgui_fbgui.cpp$(DependSuffix) $(CXX) $(IncludePCH) $(SourceSwitch) "/data/Sync/SyncProjects/CrossGen/wxCrossGen/fbgui/fbgui.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/fbgui_fbgui.cpp$(ObjectSuffix) $(IncludePath) $(IntermediateDirectory)/fbgui_fbgui.cpp$(DependSuffix): fbgui/fbgui.cpp diff --git a/wxCrossGen/wxCrossGen.project b/wxCrossGen/wxCrossGen.project index e2b8596..888522e 100644 --- a/wxCrossGen/wxCrossGen.project +++ b/wxCrossGen/wxCrossGen.project @@ -1,6 +1,7 @@ + - + + + + + diff --git a/wxCrossGen/wxCrossGen.txt b/wxCrossGen/wxCrossGen.txt index a51634d..0208c0b 100644 --- a/wxCrossGen/wxCrossGen.txt +++ b/wxCrossGen/wxCrossGen.txt @@ -1 +1 @@ -../Release/main.cpp.o ../Release/fbgui_fbgui.cpp.o +../Release/main.cpp.o ../Release/fmain.cpp.o ../Release/fsettings.cpp.o ../Release/src_crossexport.cpp.o ../Release/src_crossgen.cpp.o ../Release/fbgui_fbgui.cpp.o