Skip to content

Commit

Permalink
Follow more consistent namespace scheme in the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
kosude committed Apr 21, 2024
1 parent ec7fdf8 commit 3a14880
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 28 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# TexEdit: a portable, cross-platform editor for TeX documents

[![GitHub](https://img.shields.io/github/license/kosude/texedit)](LICENCE)
![Lines of code](https://www.aschey.tech/tokei/github.com/kosude/texedit)

TexEdit is a graphical application containing a text editor and PDF preview, to make locally editing LaTeX documents easier. Note that a minimal
distribution of TeX including the `pdflatex` binary is included with the program, and so TexEdit is fully portable and does not depend on any existing
TeX installation.
Expand All @@ -19,3 +22,5 @@ for instance. If you want an actual, fully-fledged LaTeX editor, I recommend [Ov

Project documentation, as well as a general user manual, can be found deployed at https://kosude.github.io/texedit. It can also be accessed locally
by building it with `make docs`.

A development TO-DO can be found on [Trello](https://trello.com/b/xtq0vBzz/texedit).
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
}

html_css_files = [
"css/sidebar.css"
"css/sidebar.css",
"css/link-consist.css"
]
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ resulting PDF, written in C++ and Rust.
This project is *very* work-in-progress and developed in my free time, so keep that in mind if you decide to use it! Platform support is currently
limited to Linux and macOS; Windows support may be implemented in the future, since it is a relatively big task in this case. Despite being a
personal project, TexEdit is still of course open-source and contributions are welcome and encouraged! If this applies to you, it might be helpful to
read up on the :doc:`build process <content/building>`.
read up on the :doc:`build process <content/building>` - also, see the TO-DO list on `Trello <https://trello.com/b/xtq0vBzz/texedit>`_.

Source code is available on `GitHub <https://github.com/kosude/texedit>`_.
3 changes: 3 additions & 0 deletions docs/static/css/link-consist.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a, a:visited {
color: #004B6B !important;
}
5 changes: 4 additions & 1 deletion texedit/util/except.hpp → texedit/except.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#ifndef __texedit__except_hpp__
#define __texedit__except_hpp__

namespace te::util::except {
#include <stdexcept>
#include <wx/string.h>

namespace te::except {
class MissingComponentException : public std::runtime_error {
public:
inline MissingComponentException(const wxString &name)
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/command_ids.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef __texedit__command_ids_hpp__
#define __texedit__command_ids_hpp__

namespace te::cmds {
namespace te::gui::cmds {
enum {
Menu_URLSourcePage = 101,
Menu_URLFeatureRequest,
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/editor_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "editor_panel.hpp"

namespace te {
namespace te::gui {
EditorPanel::EditorPanel(wxWindow *parent) : wxPanel(parent) {
_stc = new wxStyledTextCtrl(this, wxID_ANY);

Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/editor_panel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <wx/wx.h>
#include <wx/stc/stc.h>

namespace te {
namespace te::gui {
class EditorPanel : public wxPanel {
public:
EditorPanel(wxWindow *parent);
Expand Down
3 changes: 1 addition & 2 deletions texedit/gui/main_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "main_frame.hpp"

#include "process/process.hpp"
#include "util/except.hpp"
#include "util/resources.hpp"
#include "command_ids.hpp"
#include "editor_panel.hpp"
Expand All @@ -18,7 +17,7 @@
#include <wx/aboutdlg.h>
#include <wx/splitter.h>

namespace te {
namespace te::gui {
MainFrame::MainFrame() : wxFrame{nullptr, wxID_ANY, "TexEdit", wxDefaultPosition, wxSize{1024, 640}}, _proc_mgr{this}, _tecomp{_proc_mgr} {
BuildMenuBar();
BuildSplitLayout();
Expand Down
6 changes: 3 additions & 3 deletions texedit/gui/main_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "process/compiler/tecomp_proc.hpp"
#include "util/logger.hpp"

namespace te {
namespace te::gui {
class MainFrame : public wxFrame {
public:
MainFrame();
Expand All @@ -25,8 +25,8 @@ namespace te {
util::GlobalLogger *_logger;
wxListBox *_lb;

ProcessManager _proc_mgr;
TECompProcess _tecomp;
proc::ProcessManager _proc_mgr;
proc::TECompProcess _tecomp;

void BuildSplitLayout();
void BuildMenuBar();
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/preview_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "preview_panel.hpp"

namespace te {
namespace te::gui {
PreviewPanel::PreviewPanel(wxWindow *parent) : wxPanel(parent) {
wxString pdf;
_webView = wxWebView::New(this, wxID_ANY, "http://localhost:8080" + pdf);
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/preview_panel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <wx/wx.h>
#include <wx/webview.h>

namespace te {
namespace te::gui {
class PreviewPanel : public wxPanel {
public:
PreviewPanel(wxWindow *parent);
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/prog_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "prog_info.hpp"

namespace te {
namespace te::gui {
wxAboutDialogInfo ProgInfo::GenerateAboutDialogInfo() {
wxAboutDialogInfo info;
info.SetName(name);
Expand Down
2 changes: 1 addition & 1 deletion texedit/gui/prog_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <wx/aboutdlg.h>

namespace te {
namespace te::gui {
class ProgInfo {
public:
static constexpr const char *name = "TexEdit";
Expand Down
2 changes: 1 addition & 1 deletion texedit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace te {
// TODO: command-line parsing here

// show root (editor) window
MainFrame *main_frame = new MainFrame();
gui::MainFrame *main_frame = new gui::MainFrame();
SetTopWindow(main_frame);
main_frame->Show();

Expand Down
10 changes: 5 additions & 5 deletions texedit/process/compiler/tecomp_proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

#include "tecomp_proc.hpp"

#include "util/except.hpp"
#include "except.hpp"
#include "util/resources.hpp"

namespace te {
namespace te::proc {
TECompProcess::TECompProcess(ProcessManager &mgr) : _mgr{mgr}, _id{1} {
_cmd = util::res::RelToExec("tecomp");
if (!util::res::ValidateExecutable(_cmd)) {
throw util::except::MissingComponentException("tecomp");
_cmd = util::RelToExec("tecomp");
if (!util::ValidateExecutable(_cmd)) {
throw except::MissingComponentException("tecomp");
}
}

Expand Down
2 changes: 1 addition & 1 deletion texedit/process/compiler/tecomp_proc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "process/process_mgr.hpp"

namespace te {
namespace te::proc {
class TECompProcess {
public:
TECompProcess(ProcessManager &mgr);
Expand Down
2 changes: 1 addition & 1 deletion texedit/process/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <wx/txtstrm.h>
#include <iostream>

namespace te {
namespace te::proc {
Process::Process(wxEvtHandler *parent, ProcessManager *mgr) : wxProcess(parent), _mgr{mgr} {
}

Expand Down
2 changes: 1 addition & 1 deletion texedit/process/process.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <vector>

namespace te {
namespace te::proc {
class ProcessManager;

class Process : public wxProcess {
Expand Down
2 changes: 1 addition & 1 deletion texedit/process/process_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <wx/log.h>

namespace te {
namespace te::proc {
ProcessManager::ProcessManager(wxEvtHandler *cmd_parent) : _cmd_parent{cmd_parent} {
}

Expand Down
2 changes: 1 addition & 1 deletion texedit/process/process_mgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <unordered_map>

namespace te {
namespace te::proc {
class ProcessManager {
public:
ProcessManager(wxEvtHandler *cmd_parent);
Expand Down
2 changes: 1 addition & 1 deletion texedit/util/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <wx/filename.h>
#include <wx/stdpaths.h>

namespace te::util::res {
namespace te::util {
wxString GetTexeditDir() {
wxFileName f = wxStandardPaths::Get().GetExecutablePath();
return f.GetPath();
Expand Down
2 changes: 1 addition & 1 deletion texedit/util/resources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <wx/string.h>
#include <vector>

namespace te::util::res {
namespace te::util {
wxString GetTexeditDir();

wxString RelToExec(std::vector<wxString> dirs, wxString filename);
Expand Down

0 comments on commit 3a14880

Please sign in to comment.