Browse Source

add trans

master
Jørgen Lien Sellæg 11 years ago
parent
commit
3313af46a5
  1. 4
      juci/CMakeLists.txt
  2. 9
      juci/source.cc
  3. 6
      juci/source.h

4
juci/CMakeLists.txt

@ -127,8 +127,8 @@ link_directories(
${LIBCLANG_LIBRARY_DIRS}
)
#module:
#set_target_properties(${module} PROPERTIES PREFIX ""
# LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/")
set_target_properties(${module} PROPERTIES PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/")
target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
#executable:
target_link_libraries(${project_name} ${LIVCLANG_LIBRARIES} ${LCL_LIBRARIES} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})

9
juci/source.cc

@ -38,9 +38,9 @@ void Source::View::ApplyConfig(const Source::Config &config) {
}
}
void Source::View::OnOpenFile(std::vector<Clang::SourceLocation> &locations,
void Source::View::OnOpenFile(std::vector<clang::SourceLocation> &locations,
const Source::Config &config) {
ApplyConfig(config);
/* ApplyConfig(config);
Glib::RefPtr<Gtk::TextBuffer> buffer = get_buffer();
for (auto &loc : locations) {
string type = std::to_string(loc.kind());
@ -71,6 +71,7 @@ void Source::View::OnOpenFile(std::vector<Clang::SourceLocation> &locations,
begin_iter, end_iter);
}
}
*/
}
@ -194,10 +195,7 @@ void Source::Controller::OnOpenFile(const string &filepath) {
arguments.emplace_back(lol[a].c_str());
}
}
boost::timer::auto_cpu_timer timer;
clang::TranslationUnit tu(true, filepath, arguments);
timer.~auto_cpu_timer();
boost::timer::auto_cpu_timer timer2;
clang::SourceLocation start(&tu, filepath, start_offset);
clang::SourceLocation end(&tu, filepath, end_offset);
clang::SourceRange range(&start, &end);
@ -211,7 +209,6 @@ void Source::Controller::OnOpenFile(const string &filepath) {
loc.get_location_info(NULL, &line, &column, NULL);
}
timer2.~auto_cpu_timer();
// std::cout << t.elapsed().user << std::endl;
// model().SetSourceLocations(tu.getSourceLocations());
// view().OnOpenFile(model().getSourceLocations(), model().theme());

6
juci/source.h

@ -52,7 +52,7 @@ namespace Source {
View();
string UpdateLine();
void ApplyConfig(const Config &config);
void OnOpenFile(std::vector<Clang::SourceLocation> &locations,
void OnOpenFile(std::vector<clang::SourceLocation> &locations,
const Config &config);
private:
string GetLine(const Gtk::TextIter &begin);
@ -65,8 +65,8 @@ namespace Source {
Config& config();
const string filepath();
void SetFilePath(const string &filepath);
void SetSourceLocations( const std::vector<Clang::SourceLocation> &locations);
std::vector<Clang::SourceLocation>& getSourceLocations() {
void SetSourceLocations( const std::vector<clang::SourceLocation> &locations);
std::vector<clang::SourceLocation>& getSourceLocations() {
return locations_;
}

Loading…
Cancel
Save