diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-07 06:59:38 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-07 06:59:38 +0100 |
| commit | 24767406a9a1ee0bd53c20175ed7a7d2fe166d29 (patch) | |
| tree | 223c7e1cf7eff23dc77f4d72cfb2fe5fd6c7f4d5 /example/text_editor_example/texteditor.hpp | |
| parent | b30b55c48fd9eb64f3555f19820279792f69703c (diff) | |
[CHORE] Introduce replacement of text_processor example, text_editor.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'example/text_editor_example/texteditor.hpp')
| -rw-r--r-- | example/text_editor_example/texteditor.hpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/example/text_editor_example/texteditor.hpp b/example/text_editor_example/texteditor.hpp new file mode 100644 index 0000000..e83cf85 --- /dev/null +++ b/example/text_editor_example/texteditor.hpp @@ -0,0 +1,54 @@ +/* + * File: qt_widget.hpp + * Purpose: Minimal text editor widget example using tproc rope. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2026, Amlal El Mahrouss, licensed under the Boost Software License. + */ + +#ifndef TPROC_EXAMPLE_QT_WIDGET_HPP +#define TPROC_EXAMPLE_QT_WIDGET_HPP + +#include <ocl/tproc/rope.hpp> + +#include <iostream> +#include <string> +#include <string_view> +#include <QtWidgets> +#include <QApplication> + +#ifndef STANDALONE + +using namespace ocl; +using namespace boost; + +#else + +using namespace boost; + +#endif + +class TTextEditor; + +class TTextEditor : public QMainWindow +{ + Q_OBJECT + +public: + using rope_type = tproc::crope; + using size_type = rope_type::size_type; + using string_view = std::string_view; + + TTextEditorWidget() = delete; + + TTextEditor(string_view text, TTextEditorDelegate* del) + : buffer_(text), delegate_(del) + { + } + + virtual ~TTextEditor() = default; + +private: + rope_type buffer_; +}; + +#endif |
