30#ifndef WXMAXIMAFRAME_H
31#define WXMAXIMAFRAME_H
38#include <wx/dirctrl.h>
39#include <wx/filehistory.h>
40#include <wx/listbox.h>
41#include <wx/bmpbuttn.h>
43#include <wx/aui/aui.h>
44#include <wx/notifmsg.h>
45#include <wx/wrapsizer.h>
49#include "wizards/ScrollingGenWizPanel.h"
54#include "BuildConfig.h"
58#include "sidebars/PerformanceSidebar.h"
62#include "mcp/McpServer.h"
63#include "BuildConfig.h"
64#ifdef WXM_USE_AI_TOOLS
65#include "sidebars/AiChatSidebar.h"
66#include "sidebars/AiConnectionMonitor.h"
77 wxMaximaFrame(wxWindow *parent,
int id,
const wxString &title,
78 const wxPoint &pos = wxDefaultPosition,
79 const wxSize &size = wxDefaultSize,
80 long style = wxDEFAULT_FRAME_STYLE | wxSYSTEM_MENU | wxCAPTION);
92 static std::size_t CountWindows();
120 void ShowPane(
int id,
bool show =
true);
135 .Show(!
m_manager.GetPane(wxS(
"log")).IsShown());
141 m_manager.GetPane(
"wizard").Show(
true).Caption(title);
144 void HideWizardPane()
173 void UpdateStatusMaximaBusy();
210#ifdef WXM_USE_AI_TOOLS
213 void ReloadAiChatProvider() {
215 m_aiChatSidebar->ReloadProviderFromConfig();
222#ifdef WXM_USE_AI_TOOLS
252 std::unique_ptr<TrayIcon> m_trayIcon;
319 void HideAllSidebars(wxCommandEvent &ev);
321 wxString wxMaximaManualLocation();
324 const std::unordered_map<int, wxString> &
GetSidebarNames()
const {
return m_sidebarNames;}
344 std::unordered_map<int, wxString> m_sidebarNames;
346 std::unordered_map<int, wxString> m_sidebarCaption;
348 std::size_t m_bytesFromMaxima_last = 0;
349 wxTimer m_bytesReadDisplayTimer;
351 bool m_StatusSaving =
false;
358 bool m_newStatusText =
false;
360 wxString m_leftStatusText;
362 bool m_forceStatusbarUpdate =
false;
370 void SetupFileMenu();
371 void SetupEditMenu();
372 void SetupViewMenu();
373 void SetupCellMenu();
374 void SetupMaximaMenu();
375 void SetupEquationsMenu();
376 void SetupMatrixMenu();
377 void SetupCalculusMenu();
378 void SetupSimplifyMenu();
379 void SetupListMenu();
380 void SetupPlotMenu();
381 void SetupNumericMenu();
382 void SetupHelpMenu();
385 void StatusText(
const wxString &text,
bool saveInLog =
true);
406 std::array<wxString, 10> m_statusTextHistory;
407 void OnMenuStatusText(wxMenuEvent &event);
408 std::unordered_map<wxWindowID, wxString> m_demoFilesIDs;
421 bool ToolbarIsShown();
436 wxMenu *m_recentDocumentsMenu =
nullptr;
437 wxMenu *m_unsavedDocumentsMenu =
nullptr;
438 wxMenu *m_recentPackagesMenu =
nullptr;
439 wxMenu *m_autoSubscriptMenu =
nullptr;
440 wxMenu *m_equationTypeMenuMenu =
nullptr;
441 wxMenu *m_roundedMatrixParensMenu =
nullptr;
This file declares the class EventIDs that contains unique IDs for many events wxMaxima needs.
This file declares the class HelpBrowser.
This file contains the definition of the class History that handles the recently issued commands for ...
This file declares a (hopefully) flicker-free main menu bar.
The definition of the class RecentDocuments that provides a recent files mechanism that is extensible...
This file contains the definition of the class History that handles the recently issued commands for ...
This file contains the definition of the class TableOfContents that handles the table of contents pan...
This file declares the class TrayIcon, a system tray/notification-area icon mirroring wxMaxima's busy...
This file defines the class Worksheet.
This file contains the definition of the class XmlInspector that handles the table of contents pane.
A sidebar that shows the raw HTTP traffic between wxMaxima and the configured AI provider – the AI Ch...
Definition: AiConnectionMonitor.h:45
The configuration storage for the current worksheet.
Definition: Configuration.h:100
Definition: FindReplacePane.h:50
Definition: HelpBrowser.h:49
This class generates a pane containing the last commands that were issued.
Definition: History.h:56
void AddToHistory(const wxString &cmd)
Add a file to the recently opened files list.
Definition: History.cpp:263
A menu bar that flickers less on MS windows.
Definition: MainMenuBar.h:37
A class that maintains a list of recent documents.
Definition: RecentDocuments.h:42
The class that draws the status bar.
Definition: StatusBar.h:47
MaximaStatus
Definition: StatusBar.h:123
This class generates a pane containing the table of contents.
Definition: TableOfContents.h:52
A "variables" sidepane.
Definition: VariablesPane.h:45
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:118
This class generates a pane displaying the communication between maxima and wxMaxima.
Definition: XmlInspector.h:40
The frame containing the menu and the sidebars.
Definition: wxMaximaFrame.h:75
wxMenu * m_FileMenu
The file menu.
Definition: wxMaximaFrame.h:269
void UpdateRecentDocuments()
Update the recent documents list.
Definition: wxMaximaFrame.cpp:2288
void StatusSaveFailed()
Set the status to "Saving has failed".
Definition: wxMaximaFrame.cpp:724
void RegisterAutoSaveFile()
Remember a temporary autosave file name.
Definition: wxMaximaFrame.cpp:2343
const std::unordered_map< int, wxString > & GetSidebarNames() const
Get the list of human-readable sidebarnames and IDs.
Definition: wxMaximaFrame.h:324
bool m_first
Do we expect the 1st prompt from maxima to appear?
Definition: wxMaximaFrame.h:419
virtual ~wxMaximaFrame()
The destructor.
Definition: wxMaximaFrame.cpp:736
wxMenu * m_EditMenu
The edit menu.
Definition: wxMaximaFrame.h:271
TableOfContents * m_tableOfContents
The table of contents pane.
Definition: wxMaximaFrame.h:230
FindReplacePane::FindReplaceData m_findPaneData
The data backing the dockable find/replace sidebar (GH #2249) – kept separate from wxMaxima::m_findDa...
Definition: wxMaximaFrame.h:401
void StatusSaveFinished()
Set the status to "Maxima has finished saving".
Definition: wxMaximaFrame.cpp:708
int m_commandsLeftInCurrentCell
The number of commands left in the current of the evaluation queue item.
Definition: wxMaximaFrame.h:416
void TogglePaneVisibility(int id)
Hides or unhides the pane with the given ID.
Definition: wxMaximaFrame.cpp:2426
void ReconcileMcpServer()
Starts/stops the MCP server (src/mcp/McpServer.h) to match the current configuration....
Definition: wxMaximaFrame.h:205
void ReReadConfig()
Re-read the configuration.
Definition: wxMaximaFrame.cpp:2313
bool McpSetSidebarVisible(const wxString &name, bool show)
Show or hide one sidebar by the untranslated name McpSidebarList() reports, for the MCP server's show...
Definition: wxMaximaFrame.cpp:2492
wxMenu * m_Simplify_Complex_Sub
The complex submenu.
Definition: wxMaximaFrame.h:293
std::unique_ptr< McpServer > m_mcpServer
The (opt-in, off by default) MCP server – see ReconcileMcpServer().
Definition: wxMaximaFrame.h:233
bool IsXMLInspectorShown()
Is the XML inspector shown?
Definition: wxMaximaFrame.h:122
StatusBar::MaximaStatus StatusMaximaBusy() const
The status Maxima is currently displayed as being in.
Definition: wxMaximaFrame.h:172
void StatusExportStart()
Set the status to "Maxima is exporting".
Definition: wxMaximaFrame.cpp:712
void ClearPendingStatusText()
Mark the pending left-half status text as having been displayed.
Definition: wxMaximaFrame.h:178
virtual wxSize DoGetBestClientSize() const
The default size for the window.
Definition: wxMaximaFrame.cpp:610
wxMenu * m_PlotMenu
The plot menu.
Definition: wxMaximaFrame.h:298
PerformanceSidebar * m_performanceSidebar
The panel showing performance statistics.
Definition: wxMaximaFrame.h:432
wxMenu * m_Maxima_Panes_Sub
The panes submenu.
Definition: wxMaximaFrame.h:277
wxMenu * m_EquationsMenu
The equations menu.
Definition: wxMaximaFrame.h:279
bool m_updateEvaluationQueueLengthDisplay
Do we need to update the display showing the evaluation queue length?
Definition: wxMaximaFrame.h:414
wxMenu * m_gentranMenu
The gentran menu.
Definition: wxMaximaFrame.h:263
void ToggleXMLInspector()
Hide or unhide the XML inspector.
Definition: wxMaximaFrame.h:126
long m_drawDimensions_last
Are we inside a 2d or 3d draw command?
Definition: wxMaximaFrame.h:389
wxString m_tempfileName
The last name GetTempAutosavefileName() has returned.
Definition: wxMaximaFrame.h:241
wxMenu * m_Simplify_Trig_Sub
The trigonometric submenu.
Definition: wxMaximaFrame.h:291
void PopulateRecentPackagesMenu(wxMenu *menu, int firstEntry, const std::list< wxString > &items)
Used by UpdateRecentPackages for populating a menu.
Definition: wxMaximaFrame.cpp:2272
void ShowPane(int id, bool show=true)
Show or hide a sidebar.
Definition: wxMaximaFrame.cpp:2435
StatusBar * m_statusBar
The status bar.
Definition: wxMaximaFrame.h:245
XmlInspector * m_xmlInspector
A XmlInspector-like xml monitor.
Definition: wxMaximaFrame.h:430
void EvaluationQueueLength(int length, int numberOfCommands=-1)
Inform the user about the length of the evaluation queue.
Definition: wxMaximaFrame.cpp:620
wxMenu * m_demo_sub
The "demo" sub-menu.
Definition: wxMaximaFrame.h:257
wxMenu * m_listMenu
The list menu.
Definition: wxMaximaFrame.h:300
wxMenu * m_debugTypeMenu
Contains the menu for the debugger trigger settingxc.
Definition: wxMaximaFrame.h:289
void PopulateRecentDocumentsMenu(wxMenu *menu, int firstEntry, const std::list< wxString > &items)
Used by UpdateRecentDocuments for populating a menu.
Definition: wxMaximaFrame.cpp:2249
MainMenuBar * m_MenuBar
The menu bar.
Definition: wxMaximaFrame.h:255
bool IsPerformanceMonitorShown()
Is the performance monitor shown?
Definition: wxMaximaFrame.h:124
void OnNotificationClose(wxCommandEvent WXUNUSED(&event))
Issued if a notification is closed.
History *const m_history
The history pane.
Definition: wxMaximaFrame.h:428
wxMenu * m_Simplify_Gamma_Sub
The factorials and gamma submenu.
Definition: wxMaximaFrame.h:287
int m_EvaluationQueueLength
The current length of the evaluation queue of commands we still need to send to maxima.
Definition: wxMaximaFrame.h:412
void AuiManagerUpdate()
Updates the AUI manager and re-asserts the menu bar on GTK to prevent it from disappearing.
Definition: wxMaximaFrame.cpp:2405
void RemoveTempAutosavefile()
Remove an eventual temporary autosave file.
Definition: wxMaximaFrame.cpp:2350
wxMenu * m_CalculusMenu
The calculus menu.
Definition: wxMaximaFrame.h:295
void DockAllSidebars(wxCommandEvent &ev)
An instant single-window mode.
Definition: wxMaximaFrame.cpp:2379
void StatusSaveStart()
Set the status to "Maxima is saving".
Definition: wxMaximaFrame.cpp:703
wxMenu * m_viewMenu
The "view" menu.
Definition: wxMaximaFrame.h:261
void ReadConfig()
Read the configuration from the OS's configuration storage.
Definition: wxMaximaFrame.cpp:2308
wxMenu * m_SimplifyMenu
The simplify menu.
Definition: wxMaximaFrame.h:285
void ShowWizardPane(wxString title)
Show the pane the wizards are in.
Definition: wxMaximaFrame.h:139
long m_pid
The process id of maxima. Is determined by ReadFirstPrompt.
Definition: wxMaximaFrame.h:237
void StatusExportFailed()
Set the status to "Exporting has failed".
Definition: wxMaximaFrame.cpp:730
std::size_t m_bytesFromMaxima
How many bytes did maxima send us until now?
Definition: wxMaximaFrame.h:235
wxMenu * m_matrix_menu
The matrix menu.
Definition: wxMaximaFrame.h:283
const wxString & GetLeftStatusText() const
The pending text for the left half of the status bar.
Definition: wxMaximaFrame.h:180
wxMenu * m_MaximaMenu
The maxima menu.
Definition: wxMaximaFrame.h:281
wxMenu * m_subst_Sub
The subst submenu.
Definition: wxMaximaFrame.h:265
void ShowToolBar(bool show)
Shows or hides the toolbar.
Definition: wxMaximaFrame.cpp:2510
void StatusMaximaBusy(StatusBar::MaximaStatus status)
Set the status according to if maxima is calculating.
Definition: wxMaximaFrame.h:170
bool IsPaneDisplayed(int id)
true, if a Pane is currently enabled
Definition: wxMaximaFrame.cpp:2362
wxMenu * m_HelpMenu
The help menu.
Definition: wxMaximaFrame.h:304
void ToggleLogPane()
Toggle the visibility of the log pane.
Definition: wxMaximaFrame.h:132
wxAuiManager m_manager
The manager for dynamic screen layouts.
Definition: wxMaximaFrame.h:424
DrawSidebar * m_drawPane
The sidebar with the draw commands.
Definition: wxMaximaFrame.h:393
void StatusExportFinished()
Set the status to "Maxima has finished exporting".
Definition: wxMaximaFrame.cpp:718
wxMenu * m_Edit_Zoom_Sub
The zoom submenu.
Definition: wxMaximaFrame.h:275
wxMenu * m_NumericMenu
The numeric menu.
Definition: wxMaximaFrame.h:302
wxMenu * m_CellMenu
The cell menu.
Definition: wxMaximaFrame.h:273
Variablespane * m_variablesPane
The panel the user can display variable contents in.
Definition: wxMaximaFrame.h:221
std::vector< McpSidebarInfo > McpSidebarList() const
Every dockable sidebar, with its current visibility – what the MCP server's list_sidebars tool report...
Definition: wxMaximaFrame.cpp:2459
std::vector< wxMenu * > m_demoSubs
The submenus for the various "demo" sub-submenus.
Definition: wxMaximaFrame.h:259
long m_maximaPid
The real process id of maxima (might be a child of m_pid).
Definition: wxMaximaFrame.h:239
Worksheet *const m_worksheet
The worksheet itself.
Definition: wxMaximaFrame.h:426
RecentDocuments m_recentDocuments
The panel the log and debug messages will appear on.
Definition: wxMaximaFrame.h:434
wxMenu * m_logexpand_Sub
The logexpand submenu.
Definition: wxMaximaFrame.h:267
bool HasPendingStatusText() const
True if StatusText() recorded a left-half status text not yet shown.
Definition: wxMaximaFrame.h:176
wxString GetDemoFile(wxWindowID id) const
Looks up which demo file belongs to a wxWindowID.
Definition: wxMaximaFrame.cpp:2189
void AddToHistory(const wxString &cmd)
Adds a command to the list of recently used maxima commands.
Definition: wxMaximaFrame.h:153