cleanup: namespace Montauk (capital M) => montauk::abi
This commit is contained in:
@@ -1047,7 +1047,7 @@ int file_field_mouse(mtk::TextInputState& input, const Rect& rect, char* buf, in
|
||||
focused, false, filter);
|
||||
}
|
||||
|
||||
void handle_file_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_file_mouse(const montauk::abi::WinEvent& ev) {
|
||||
FileDialogState* st = &g_file;
|
||||
st->mouse_x = ev.mouse.x;
|
||||
st->mouse_y = ev.mouse.y;
|
||||
@@ -1159,7 +1159,7 @@ void handle_file_mouse(const Montauk::WinEvent& ev) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_file_key(const Montauk::KeyEvent& key) {
|
||||
void handle_file_key(const montauk::abi::KeyEvent& key) {
|
||||
if (!key.pressed) return;
|
||||
|
||||
FileDialogState* st = &g_file;
|
||||
@@ -1234,11 +1234,11 @@ void draw() {
|
||||
draw_file_dialog();
|
||||
}
|
||||
|
||||
void handle_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev) {
|
||||
handle_file_mouse(ev);
|
||||
}
|
||||
|
||||
void handle_key(const Montauk::KeyEvent& key) {
|
||||
void handle_key(const montauk::abi::KeyEvent& key) {
|
||||
handle_file_key(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ constexpr int BUTTON_W = 88;
|
||||
|
||||
void init(const gui::dialogs::Request& req);
|
||||
void draw();
|
||||
void handle_mouse(const Montauk::WinEvent& ev);
|
||||
void handle_key(const Montauk::KeyEvent& key);
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev);
|
||||
void handle_key(const montauk::abi::KeyEvent& key);
|
||||
void cleanup();
|
||||
|
||||
} // namespace filedialog
|
||||
|
||||
@@ -35,8 +35,8 @@ static constexpr uint8_t WIN_SCALE = 4;
|
||||
struct DialogCallbacks {
|
||||
void (*draw)();
|
||||
void (*on_close)();
|
||||
void (*handle_mouse)(const Montauk::WinEvent& ev);
|
||||
void (*handle_key)(const Montauk::KeyEvent& key);
|
||||
void (*handle_mouse)(const montauk::abi::WinEvent& ev);
|
||||
void (*handle_key)(const montauk::abi::KeyEvent& key);
|
||||
};
|
||||
|
||||
static void run_dialog_loop(const DialogCallbacks& cb) {
|
||||
@@ -44,7 +44,7 @@ static void run_dialog_loop(const DialogCallbacks& cb) {
|
||||
cb.draw();
|
||||
g_app.win.present();
|
||||
|
||||
Montauk::WinEvent ev;
|
||||
montauk::abi::WinEvent ev;
|
||||
int rc = g_app.win.poll(&ev);
|
||||
if (rc < 0) { cb.on_close(); break; }
|
||||
if (rc == 0) { montauk::sleep_ms(16); continue; }
|
||||
@@ -143,8 +143,8 @@ DIALOGS_EXPORT bool dialogs_run_request(const dlg::Request* request, dlg::Result
|
||||
}
|
||||
|
||||
void (*draw_fn)() = g_app.is_print ? printdialog::draw : filedialog::draw;
|
||||
void (*mouse_fn)(const Montauk::WinEvent&) = g_app.is_print ? printdialog::handle_mouse : filedialog::handle_mouse;
|
||||
void (*key_fn)(const Montauk::KeyEvent&) = g_app.is_print ? printdialog::handle_key : filedialog::handle_key;
|
||||
void (*mouse_fn)(const montauk::abi::WinEvent&) = g_app.is_print ? printdialog::handle_mouse : filedialog::handle_mouse;
|
||||
void (*key_fn)(const montauk::abi::KeyEvent&) = g_app.is_print ? printdialog::handle_key : filedialog::handle_key;
|
||||
|
||||
draw_fn();
|
||||
g_app.win.present();
|
||||
|
||||
@@ -367,7 +367,7 @@ void draw_message_box() {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_message_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_message_mouse(const montauk::abi::WinEvent& ev) {
|
||||
MessageBoxState* st = &g_message;
|
||||
st->mouse_x = ev.mouse.x;
|
||||
st->mouse_y = ev.mouse.y;
|
||||
@@ -384,7 +384,7 @@ void handle_message_mouse(const Montauk::WinEvent& ev) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_message_key(const Montauk::KeyEvent& key) {
|
||||
void handle_message_key(const montauk::abi::KeyEvent& key) {
|
||||
if (!key.pressed) return;
|
||||
|
||||
MessageBoxState* st = &g_message;
|
||||
@@ -464,11 +464,11 @@ void draw() {
|
||||
draw_message_box();
|
||||
}
|
||||
|
||||
void handle_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev) {
|
||||
handle_message_mouse(ev);
|
||||
}
|
||||
|
||||
void handle_key(const Montauk::KeyEvent& key) {
|
||||
void handle_key(const montauk::abi::KeyEvent& key) {
|
||||
handle_message_key(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ constexpr int MAX_LINE_LEN = 128;
|
||||
void init(const char* message, uint8_t buttons, uint8_t default_choice = 0);
|
||||
void preferred_size(const char* title, int* out_w, int* out_h);
|
||||
void draw();
|
||||
void handle_mouse(const Montauk::WinEvent& ev);
|
||||
void handle_key(const Montauk::KeyEvent& key);
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev);
|
||||
void handle_key(const montauk::abi::KeyEvent& key);
|
||||
void dismiss();
|
||||
uint8_t selected_choice();
|
||||
void cleanup();
|
||||
|
||||
@@ -420,7 +420,7 @@ void print_submit(PrintDialogState* st) {
|
||||
dialog_finish("ok", "", job_id, msg, printer.uri, printer.name, st->copies);
|
||||
}
|
||||
|
||||
void handle_print_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_print_mouse(const montauk::abi::WinEvent& ev) {
|
||||
PrintDialogState* st = &g_print;
|
||||
st->mouse_x = ev.mouse.x;
|
||||
st->mouse_y = ev.mouse.y;
|
||||
@@ -456,7 +456,7 @@ void handle_print_mouse(const Montauk::WinEvent& ev) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_print_key(const Montauk::KeyEvent& key) {
|
||||
void handle_print_key(const montauk::abi::KeyEvent& key) {
|
||||
if (!key.pressed) return;
|
||||
if (key.scancode == 0x01) {
|
||||
dialog_cancel();
|
||||
@@ -505,11 +505,11 @@ void draw() {
|
||||
draw_print_dialog();
|
||||
}
|
||||
|
||||
void handle_mouse(const Montauk::WinEvent& ev) {
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev) {
|
||||
handle_print_mouse(ev);
|
||||
}
|
||||
|
||||
void handle_key(const Montauk::KeyEvent& key) {
|
||||
void handle_key(const montauk::abi::KeyEvent& key) {
|
||||
handle_print_key(key);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ constexpr int BUTTON_W = 88;
|
||||
|
||||
void init(const gui::dialogs::Request& req);
|
||||
void draw();
|
||||
void handle_mouse(const Montauk::WinEvent& ev);
|
||||
void handle_key(const Montauk::KeyEvent& key);
|
||||
void handle_mouse(const montauk::abi::WinEvent& ev);
|
||||
void handle_key(const montauk::abi::KeyEvent& key);
|
||||
void cleanup();
|
||||
|
||||
} // namespace printdialog
|
||||
|
||||
Reference in New Issue
Block a user