28#include "../NumeReWindow.h"
29#include "../../common/Options.h"
31#include "../../kernel/kernel.hpp"
33#define wxEVT_COMMAND_TERM_RESIZE wxEVT_USER_FIRST + 1000
34#define wxEVT_COMMAND_TERM_NEXT wxEVT_USER_FIRST + 1001
36#define EVT_TERM_RESIZE(id, fn) { wxEVT_COMMAND_TERM_RESIZE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &fn, (wxObject *)NULL },
144 int x,
int y,
unsigned char c);
147 void OnChar(wxKeyEvent& event);
149 void OnPaint(wxPaintEvent& event);
154 void OnEnter(wxMouseEvent& event);
155 void OnTimer(wxTimerEvent& event);
157 void OnSize(wxSizeEvent& event);
165 virtual wxThread::ExitCode
Entry();
181 const wxString& sPath,
182 const wxPoint& pos = wxDefaultPosition,
184 const wxString&
name =
"wxTerm");
188 void pass_command(
const std::string& command,
bool isEvent);
201 void OnClose(wxCloseEvent& event);
204 std::map<std::string, std::string>
getMenuMap();
212 void addBreakpoint(
const std::string& _sFilename,
size_t nLine);
247 bool SetFont(
const wxFont& font);
268 virtual void ProcessInput(
int len,
const std::string& sData)
override;
269 virtual void ProcessOutput(
int len,
const std::string& sData)
override;
278 return GetThread() && GetThread()->IsRunning();
283 virtual void Bell()
override;
An implementation of a generic terminal, which has to be specialized in the child classes.
This data container is a copy- efficient table to interchange data between Kernel and GUI.
This class provides the interface to the core of NumeRe. It provides all functionalities,...
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
std::vector< std::string > getDocIndex()
Gets the contents of the documentation index as a vector.
TerminalCallTip * m_callTip
NumeReKernel & getKernel()
NumeReVariables getVariableList()
This will return the variable list from the kernel to be shown in the variable viewer.
void OnPaint(wxPaintEvent &event)
NumeReKernel::KernelStatus m_KernelStatus
void OnThreadUpdate(wxThreadEvent &event)
This function is the thread update event handler member function. Here are all returned messages from...
wxFont m_boldUnderlinedFont
virtual void UpdateRemoteSize(int width, int height)
Fallback for the virtual definition.
std::map< std::string, std::string > getPluginLanguageStrings()
This will return the language strings for the plugins used by the language class for filling the symb...
bool m_bTableEditAvailable
void passEditedTable(NumeRe::Table _table)
Passes a table (as a container) to the kernel.
NumeReTerminal(wxWindow *parent, wxWindowID id, Options *_option, const wxString &sPath, const wxPoint &pos=wxDefaultPosition, int width=80, int height=24, const wxString &name="wxTerm")
Terminal constructor.
void OnSize(wxSizeEvent &event)
void cutText()
Implements copy to clip board and deleting the selection.
void DoDrawCursor(int fg_color, int bg_color, int flags, int x, int y, unsigned char c)
void pipe_command(const std::string &sCommand)
Pass the entered command line to the kernel.
void EndKernelTask()
This function forces the thread to terminate so that the application may be shut down.
NumeRe::Table getTable(const std::string &sTableName)
This function will return the named table from the kernel to be shown in a GUI window.
virtual void Bell() override
virtual void Calltip(int x, int y, NumeRe::CallTip &_cTip) override
Function reimplementation to display a tooltip requested by the GenericTerminal.
void OnGainFocus(wxFocusEvent &event)
virtual void DrawCursor(int fg_color, int bg_color, int flags, int x, int y, unsigned char c) override
void StartKernelTask()
This member function will start the managed, second thread, in which the kernel will operate.
void OnLoseMouseCapture(wxMouseCaptureLostEvent &event)
This member function handles the "MouseCaptureLostEvent" and releases the mouse.
void clearTerminal()
This member function clears the terminal.
virtual ~NumeReTerminal()
Terminal destructor.
virtual void ModeChange(int state) override
void OnLeftDown(wxMouseEvent &event)
const std::vector< Package > & getInstalledPackages()
Returns the installed plugins as a STL vector.
void copyText()
Implements copy to clip board.
virtual void ProcessOutput(int len, const std::string &sData) override
Processes text received from the kernel.
void Busy()
Inform the GUI that the kernel is currently busy.
bool filterKeyCodes(int keyCode, bool ctrlDown)
This private member function filters special key codes and handles them.
virtual void CalltipCancel() override
Function reimplementation to close the previously opened calltip.
void OnClose(wxCloseEvent &event)
This function forces the thread to terminate immediately. Should only occur in situations,...
void pasteText()
Implements paste from clip board.
void OnLoseFocus(wxFocusEvent &event)
std::string m_sCommandLine
void MarkSelection(bool bRectangular=false)
virtual void ClearChars(int bg_color, int x, int y, int w, int h) override
void OnKeyDown(wxKeyEvent &event)
void ScrollTerminal(int numLines, bool scrollUp=true)
void pass_command(const std::string &command, bool isEvent)
Pass the external command to the kernel without printing it to the console.
void updatePackage(const std::string &package)
Updates an installed package with new information after the user created a package with the package c...
bool m_bTableEditCanceled
virtual void DrawText(int fg_color, int bg_color, int flags, int x, int y, const std::string &sText) override
Settings getKernelSettings()
This will return a copy of the internal settings object of the kernel.
void CancelCalculation()
Inform the kernel to stop the current calculation. Used to handle the ESC key press.
NumeReWindow * m_wxParent
bool m_updateProcedureLibrary
void UpdateColors()
This member function sets the new colors to the internal pen definitions.
virtual void ResizeTerminal(int width, int height) override
void clearBreakpoints(const std::string &_sFilename)
This member function removes all breakpoints from the passed file.
void GetDefColors(wxColor colors[16], NumeReTerminal::BOLDSTYLE boldStyle=NumeReTerminal::DEFAULT)
wxCriticalSection m_kernelCS
void scrollToInput()
This private member function scrolls the terminal all the way down.
std::map< std::string, std::string > getMenuMap()
Returns the menu map of the installed plugins as a STL map.
NumeRe::Container< std::string > getStringTable(const std::string &sStringTableName)
This member function will return the named table containing strings.
void removeBreakpoint(const std::string &_sFilename, size_t nLine)
This member function removes a breakpoint from the passed file at the indicated line number.
void OnTimer(wxTimerEvent &event)
void OnEnter(wxMouseEvent &event)
This member function handles the "Mouse Enter" event.
std::string getDocumentation(const std::string &sCommand)
Gets the desired documentation article as a HTML string.
void OnChar(wxKeyEvent &event)
void SetParent(NumeReWindow *frame)
virtual void ProcessInput(int len, const std::string &sData) override
Processes text received from the keybord or clipboard.
void setKernelSettings(const Settings &)
This will pass the new kernel settings to the kernel.
void SetCursorBlinkRate(int rate)
std::map< std::string, std::string > getFunctionLanguageStrings()
This will return the language strings for the custom defined functions used by the language class for...
wxColour m_color_defs[16]
std::vector< std::string > getPathSettings()
Returns the standard paths as a STL vector.
void OnActivate(wxActivateEvent &event)
void Ready()
Inform the GUI that the kernel is ready for calculation.
bool SetFont(const wxFont &font)
void OnMouseMove(wxMouseEvent &event)
wxPen m_colorPen_defs[16]
void OnLeftUp(wxMouseEvent &event)
virtual wxThread::ExitCode Entry()
This is the main thread function and will be called repeatedly from the wxWidgets library.
void addBreakpoint(const std::string &_sFilename, size_t nLine)
This member function adds a breakpoint to the passed file at the indicated line number.
This class is the actual NumeRe main frame. The application's logic is implemented here.
This class implements an interface of the internal Settings object adapted to be usable from the GUI.
This class manages the setting values of the internal (kernel) settings of this application.
This class represents the calltip in the terminal. The associated window will only be shown and hidde...
This structure contains the data for a single calltip, which might be shown in the editor or the term...
This structure combines a vector of declared variables including their values and respective sizes wi...