mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.9 KiB
55 lines
1.9 KiB
|
8 years ago
|
#pragma once
|
||
|
6 years ago
|
#include "dispatcher.hpp"
|
||
|
|
#include "mutex.hpp"
|
||
|
8 years ago
|
#include "process.hpp"
|
||
|
6 years ago
|
#include "source_base.hpp"
|
||
|
11 years ago
|
#include <boost/filesystem.hpp>
|
||
|
8 years ago
|
#include <functional>
|
||
|
6 years ago
|
#include <gtkmm.h>
|
||
|
10 years ago
|
#include <iostream>
|
||
|
8 years ago
|
#include <tuple>
|
||
|
11 years ago
|
|
||
|
6 years ago
|
class Terminal : public Source::SearchView {
|
||
|
11 years ago
|
Terminal();
|
||
|
8 years ago
|
|
||
|
10 years ago
|
public:
|
||
|
|
static Terminal &get() {
|
||
|
|
static Terminal singleton;
|
||
|
|
return singleton;
|
||
|
|
}
|
||
|
8 years ago
|
|
||
|
|
int process(const std::string &command, const boost::filesystem::path &path = "", bool use_pipes = true);
|
||
|
|
int process(std::istream &stdin_stream, std::ostream &stdout_stream, const std::string &command, const boost::filesystem::path &path = "", std::ostream *stderr_stream = nullptr);
|
||
|
|
void async_process(const std::string &command, const boost::filesystem::path &path = "", const std::function<void(int exit_status)> &callback = nullptr, bool quiet = false);
|
||
|
|
void kill_last_async_process(bool force = false);
|
||
|
|
void kill_async_processes(bool force = false);
|
||
|
|
|
||
|
|
size_t print(const std::string &message, bool bold = false);
|
||
|
|
void async_print(const std::string &message, bool bold = false);
|
||
|
10 years ago
|
void async_print(size_t line_nr, const std::string &message);
|
||
|
8 years ago
|
|
||
|
10 years ago
|
void configure();
|
||
|
8 years ago
|
|
||
|
10 years ago
|
void clear();
|
||
|
8 years ago
|
|
||
|
10 years ago
|
protected:
|
||
|
8 years ago
|
bool on_motion_notify_event(GdkEventMotion *motion_event) override;
|
||
|
|
bool on_button_press_event(GdkEventButton *button_event) override;
|
||
|
10 years ago
|
bool on_key_press_event(GdkEventKey *event) override;
|
||
|
8 years ago
|
|
||
|
11 years ago
|
private:
|
||
|
10 years ago
|
Dispatcher dispatcher;
|
||
|
10 years ago
|
Glib::RefPtr<Gtk::TextTag> bold_tag;
|
||
|
10 years ago
|
Glib::RefPtr<Gtk::TextTag> link_tag;
|
||
|
|
Glib::RefPtr<Gdk::Cursor> link_mouse_cursor;
|
||
|
|
Glib::RefPtr<Gdk::Cursor> default_mouse_cursor;
|
||
|
8 years ago
|
size_t deleted_lines = 0;
|
||
|
|
|
||
|
8 years ago
|
std::tuple<size_t, size_t, std::string, std::string, std::string> find_link(const std::string &line);
|
||
|
8 years ago
|
void apply_link_tags(const Gtk::TextIter &start_iter, const Gtk::TextIter &end_iter);
|
||
|
10 years ago
|
|
||
|
7 years ago
|
Mutex processes_mutex;
|
||
|
|
std::vector<std::shared_ptr<TinyProcessLib::Process>> processes GUARDED_BY(processes_mutex);
|
||
|
10 years ago
|
Glib::ustring stdin_buffer;
|
||
|
11 years ago
|
};
|