Switch to OOP style code

This commit is contained in:
2026-02-04 00:38:11 +00:00
parent e3fc5323df
commit a62d4a18a8
50 changed files with 3011 additions and 3078 deletions

View File

@@ -12,8 +12,9 @@ struct Bar {
uint32_t cursor = 0;
void init(Coord screen) { this->screen = screen; }
void render();
void handle(KeyEvent event);
void render(std::vector<ScreenCell> &buffer);
void handle_event(KeyEvent event);
void handle_command(std::string &command);
void log(std::string message);
};

View File

@@ -1,21 +1,21 @@
#ifndef UI_COMPLETIONBOX_H
#define UI_COMPLETIONBOX_H
#include "io/sysio.h"
#include "pch.h"
#include "utils/utils.h"
struct CompletionBox {
std::shared_mutex mtx;
struct CompletionSession *session;
bool hidden = true;
std::vector<ScreenCell> cells;
Coord size;
Coord position;
CompletionBox(CompletionSession *s) : session(s) {}
void render_update();
void render(Coord pos);
};
#endif
// #ifndef UI_COMPLETIONBOX_H
// #define UI_COMPLETIONBOX_H
//
// #include "io/sysio.h"
// #include "pch.h"
// #include "utils/utils.h"
//
// struct CompletionBox {
// std::shared_mutex mtx;
// struct CompletionSession *session;
// bool hidden = true;
// std::vector<ScreenCell> cells;
// Coord size;
// Coord position;
//
// CompletionBox(CompletionSession *s) : session(s) {}
// void render_update();
// void render(Coord pos);
// };
//
// #endif

View File

@@ -1,22 +0,0 @@
#ifndef UI_HOVER_H
#define UI_HOVER_H
#include "editor/decl.h"
#include "io/sysio.h"
#include "pch.h"
#include "utils/utils.h"
struct HoverBox {
std::string text;
std::atomic<bool> is_markup;
uint32_t scroll_;
std::vector<ScreenCell> cells;
Coord size;
void clear();
void scroll(int32_t number);
void render_first(bool scroll = false);
void render(Coord pos);
};
#endif