cleanup: namespace Montauk (capital M) => montauk::abi
This commit is contained in:
@@ -71,7 +71,7 @@ extern "C" void _start() {
|
||||
// Create window
|
||||
g_win_w = 400;
|
||||
g_win_h = 300;
|
||||
Montauk::WinCreateResult wres;
|
||||
montauk::abi::WinCreateResult wres;
|
||||
montauk::win_create("My App", g_win_w, g_win_h, &wres);
|
||||
int win_id = wres.id;
|
||||
uint32_t* pixels = (uint32_t*)(uintptr_t)wres.pixelVa;
|
||||
@@ -82,7 +82,7 @@ extern "C" void _start() {
|
||||
|
||||
// Event loop
|
||||
while (true) {
|
||||
Montauk::WinEvent ev;
|
||||
montauk::abi::WinEvent ev;
|
||||
int r = montauk::win_poll(win_id, &ev);
|
||||
|
||||
if (r < 0) break; // Window destroyed externally
|
||||
@@ -230,7 +230,7 @@ static void myapp_on_mouse(Window* win, MouseEvent& ev) {
|
||||
}
|
||||
}
|
||||
|
||||
static void myapp_on_key(Window* win, const Montauk::KeyEvent& key) {
|
||||
static void myapp_on_key(Window* win, const montauk::abi::KeyEvent& key) {
|
||||
if (!key.pressed) return;
|
||||
MyAppState* state = (MyAppState*)win->app_data;
|
||||
// Handle keystrokes...
|
||||
@@ -418,7 +418,7 @@ int w = text_width("Hello");
|
||||
```cpp
|
||||
// In standalone apps (via win_poll)
|
||||
if (ev.type == 0) {
|
||||
Montauk::KeyEvent& key = ev.key;
|
||||
montauk::abi::KeyEvent& key = ev.key;
|
||||
if (!key.pressed) { /* key release */ }
|
||||
|
||||
if (key.ascii >= 0x20 && key.ascii < 0x7F) {
|
||||
@@ -826,7 +826,7 @@ See `syscalls.md` for the full `tls::` API reference.
|
||||
For non-TLS networking without the HTTP wrapper, use the raw socket syscalls directly (see `syscalls.md`):
|
||||
|
||||
```cpp
|
||||
int sock = montauk::socket(Montauk::SOCK_TCP); // or SOCK_UDP
|
||||
int sock = montauk::socket(montauk::abi::SOCK_TCP); // or SOCK_UDP
|
||||
montauk::connect(sock, ip, port);
|
||||
montauk::send(sock, data, len);
|
||||
int n = montauk::recv(sock, buf, maxLen);
|
||||
|
||||
@@ -129,7 +129,7 @@ These write to the kernel's text-mode console, not to a GUI window.
|
||||
|
||||
```cpp
|
||||
bool is_key_available(); // Poll for pending keystroke
|
||||
void getkey(Montauk::KeyEvent* out); // Get next keystroke (blocks)
|
||||
void getkey(montauk::abi::KeyEvent* out); // Get next keystroke (blocks)
|
||||
char getchar(); // Get single ASCII character (blocks)
|
||||
```
|
||||
|
||||
@@ -165,7 +165,7 @@ struct KeyEvent {
|
||||
### Mouse (Direct, Non-Windowed)
|
||||
|
||||
```cpp
|
||||
void mouse_state(Montauk::MouseState* out); // Get current mouse state
|
||||
void mouse_state(montauk::abi::MouseState* out); // Get current mouse state
|
||||
void set_mouse_bounds(int32_t maxX, int32_t maxY); // Set mouse boundary
|
||||
```
|
||||
|
||||
@@ -224,7 +224,7 @@ struct WinEvent {
|
||||
|
||||
```cpp
|
||||
while (true) {
|
||||
Montauk::WinEvent ev;
|
||||
montauk::abi::WinEvent ev;
|
||||
int r = montauk::win_poll(win_id, &ev);
|
||||
if (r < 0) break; // Window closed
|
||||
if (r == 0) {
|
||||
@@ -434,7 +434,7 @@ int bt_info(BtAdapterInfo* buf); // Adapter i
|
||||
```cpp
|
||||
uint64_t get_ticks(); // CPU tick counter
|
||||
uint64_t get_milliseconds(); // Milliseconds since boot
|
||||
void gettime(Montauk::DateTime* out); // Wall-clock time
|
||||
void gettime(montauk::abi::DateTime* out); // Wall-clock time
|
||||
```
|
||||
|
||||
**`DateTime` struct:**
|
||||
@@ -496,7 +496,7 @@ For launching child processes with redirected I/O (used by the terminal emulator
|
||||
int spawn_redir(const char* path, const char* args); // Spawn with I/O pipes
|
||||
int childio_read(int childPid, char* buf, int maxLen); // Read child stdout
|
||||
int childio_write(int childPid, const char* data, int len); // Write to child stdin
|
||||
int childio_writekey(int childPid, const Montauk::KeyEvent* key); // Send keystroke to child
|
||||
int childio_writekey(int childPid, const montauk::abi::KeyEvent* key); // Send keystroke to child
|
||||
int childio_settermsz(int childPid, int cols, int rows); // Set child terminal size
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user