wxMaxima
Loading...
Searching...
No Matches
DiffFrame.h
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2// Copyright (C) 2026 Gemini CLI
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//
19// SPDX-License-Identifier: GPL-2.0+
20
21#ifndef DIFFFRAME_H
22#define DIFFFRAME_H
23
24#include "Worksheet.h"
25#include <wx/wx.h>
26#include <wx/srchctrl.h>
27#include <vector>
28#include <memory>
29
30class DiffFrame : public wxFrame
31{
32public:
33 DiffFrame(wxWindow *parent, const wxArrayString &files, Configuration *config);
34 virtual ~DiffFrame();
35
36private:
37 void OnScroll(wxScrollWinEvent &event);
38 void OnToggleHorizontalSync(wxCommandEvent &event);
39 void OnSearch(wxCommandEvent &event);
40 void OnSearchCancel(wxCommandEvent &event);
41 void OnDiffNext(wxCommandEvent &event);
42 void OnDiffPrev(wxCommandEvent &event);
43
44 std::vector<Worksheet *> m_worksheets;
45 std::vector<std::unique_ptr<Configuration>> m_worksheetConfigurations;
46 Configuration *m_configuration;
47 wxSearchCtrl *m_searchCtrl = nullptr;
48 wxRadioButton *m_searchDownRadio = nullptr;
49 wxRadioButton *m_searchUpRadio = nullptr;
50 int m_currentDiffIdx = -1;
51 bool m_syncing = false;
52 bool m_syncHorizontal = true;
53 bool m_searchDown = true;
54
55 void LoadFiles(const wxArrayString &files);
56 void AlignCells();
57
58 struct DiffEntry {
59 GroupCell *cells[3]; // 0, 1, 2
60 };
61 std::vector<DiffEntry> m_diffEntries;
62 std::vector<int> m_lastScrollY;
63};
64
65#endif // DIFFFRAME_H
This file defines the class Worksheet.
The configuration storage for the current worksheet.
Definition: Configuration.h:86
Definition: DiffFrame.h:31
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:87