cleanup: namespace Montauk (capital M) => montauk::abi
This commit is contained in:
@@ -22,13 +22,13 @@ namespace gui {
|
||||
return clipboard_set_text(text, text ? montauk::slen(text) : 0);
|
||||
}
|
||||
|
||||
inline bool clipboard_get_info(Montauk::ClipboardInfo* out) {
|
||||
inline bool clipboard_get_info(montauk::abi::ClipboardInfo* out) {
|
||||
if (out == nullptr) return false;
|
||||
return montauk::clipboard_get_info(out) == 0;
|
||||
}
|
||||
|
||||
inline bool clipboard_has_text() {
|
||||
Montauk::ClipboardInfo info = {};
|
||||
montauk::abi::ClipboardInfo info = {};
|
||||
return clipboard_get_info(&info) && info.textBytes > 0;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace gui {
|
||||
if (out_len) *out_len = 0;
|
||||
if (out_serial) *out_serial = 0;
|
||||
|
||||
Montauk::ClipboardInfo info = {};
|
||||
montauk::abi::ClipboardInfo info = {};
|
||||
if (!clipboard_get_info(&info) || info.textBytes == 0)
|
||||
return nullptr;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct DesktopState {
|
||||
char user_config_dir[128]; // "0:/users/<username>/config"
|
||||
bool is_admin;
|
||||
|
||||
Montauk::MouseState mouse;
|
||||
montauk::abi::MouseState mouse;
|
||||
uint8_t prev_buttons;
|
||||
|
||||
bool app_menu_open;
|
||||
@@ -160,7 +160,7 @@ struct DesktopState {
|
||||
int ctx_menu_x, ctx_menu_y;
|
||||
|
||||
bool net_popup_open;
|
||||
Montauk::NetCfg cached_net_cfg;
|
||||
montauk::abi::NetCfg cached_net_cfg;
|
||||
uint64_t net_cfg_last_poll;
|
||||
Rect net_icon_rect;
|
||||
|
||||
@@ -175,7 +175,7 @@ struct DesktopState {
|
||||
|
||||
// Temperature monitoring
|
||||
static constexpr int MAX_THERMAL_ZONES = 8;
|
||||
Montauk::ThermalInfo thermal_zones[MAX_THERMAL_ZONES];
|
||||
montauk::abi::ThermalInfo thermal_zones[MAX_THERMAL_ZONES];
|
||||
int thermal_zone_count;
|
||||
uint64_t thermal_last_poll;
|
||||
Rect temp_icon_rect;
|
||||
@@ -214,6 +214,6 @@ void desktop_raise_window(DesktopState* ds, int idx);
|
||||
void desktop_draw_panel(DesktopState* ds);
|
||||
void desktop_draw_window(DesktopState* ds, int idx);
|
||||
void desktop_handle_mouse(DesktopState* ds);
|
||||
void desktop_handle_keyboard(DesktopState* ds, const Montauk::KeyEvent& key);
|
||||
void desktop_handle_keyboard(DesktopState* ds, const montauk::abi::KeyEvent& key);
|
||||
|
||||
} // namespace gui
|
||||
|
||||
@@ -61,7 +61,7 @@ class Framebuffer {
|
||||
|
||||
public:
|
||||
Framebuffer() : hw_fb(nullptr), back_buf(nullptr), fb_width(0), fb_height(0), fb_pitch(0) {
|
||||
Montauk::FbInfo info;
|
||||
montauk::abi::FbInfo info;
|
||||
montauk::fb_info(&info);
|
||||
|
||||
fb_width = (int)info.width;
|
||||
|
||||
@@ -552,7 +552,7 @@ inline int text_input_handle_mouse(TextInputState& state,
|
||||
inline int text_input_key(TextInputState& state,
|
||||
char* text,
|
||||
int cap,
|
||||
const Montauk::KeyEvent& key,
|
||||
const montauk::abi::KeyEvent& key,
|
||||
TextInputCharFilter filter = nullptr,
|
||||
void* userdata = nullptr,
|
||||
bool masked = false) {
|
||||
|
||||
@@ -24,7 +24,7 @@ struct WsWindow {
|
||||
: id(-1), pixels(nullptr), width(0), height(0), scale_factor(1), closed(false) {}
|
||||
|
||||
bool create(const char* title, int w, int h) {
|
||||
Montauk::WinCreateResult wres;
|
||||
montauk::abi::WinCreateResult wres;
|
||||
if (montauk::win_create(title, w, h, &wres) < 0 || wres.id < 0)
|
||||
return false;
|
||||
|
||||
@@ -37,7 +37,7 @@ struct WsWindow {
|
||||
return true;
|
||||
}
|
||||
|
||||
int poll(Montauk::WinEvent* ev) {
|
||||
int poll(montauk::abi::WinEvent* ev) {
|
||||
if (id < 0 || closed) return -1;
|
||||
|
||||
int r = montauk::win_poll(id, ev);
|
||||
|
||||
@@ -831,7 +831,7 @@ static inline void terminal_resize(TerminalState* t, int new_cols, int new_rows)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void terminal_handle_key(TerminalState* t, const Montauk::KeyEvent& key) {
|
||||
static inline void terminal_handle_key(TerminalState* t, const montauk::abi::KeyEvent& key) {
|
||||
// Snap to live on any keyboard input
|
||||
if (t->view_offset > 0) {
|
||||
t->view_offset = 0;
|
||||
|
||||
@@ -227,7 +227,7 @@ struct TextBox {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_key(const Montauk::KeyEvent& key) {
|
||||
void handle_key(const montauk::abi::KeyEvent& key) {
|
||||
if (!focused || !key.pressed) return;
|
||||
|
||||
if (key.ascii == '\b' || key.scancode == 0x0E) {
|
||||
|
||||
@@ -32,7 +32,7 @@ static constexpr int MIN_WINDOW_H = 80;
|
||||
struct Window;
|
||||
using WindowDrawCallback = void (*)(Window* win, Framebuffer& fb);
|
||||
using WindowMouseCallback = void (*)(Window* win, MouseEvent& ev);
|
||||
using WindowKeyCallback = void (*)(Window* win, const Montauk::KeyEvent& key);
|
||||
using WindowKeyCallback = void (*)(Window* win, const montauk::abi::KeyEvent& key);
|
||||
using WindowCloseCallback = void (*)(Window* win);
|
||||
using WindowPollCallback = void (*)(Window* win);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user