Differences From Artifact [dd3dab2434]:
- File src/console.mm — part of check-in [e7b5d33cad] at 2025-03-03 23:52:52 on branch trunk — Migrate more strings (user: js, size: 6233) [annotate] [blame] [check-ins using]
To Artifact [2a75e21fbb]:
- File
src/console.mm
— part of check-in
[f5b62f8203]
at
2025-03-04 23:03:58
on branch trunk
— Initial port to macOS
Doesn't work yet as SDL1 is broken on modern macOS. (user: js, size: 6297) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
41 42 43 44 45 46 47 | cl.cref[0] = '\f'; cl.cref[1] = 0; strcat_s(cl.cref, sf); } else { strcpy_s(cl.cref, sf); }; puts(cl.cref); | | < > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | cl.cref[0] = '\f'; cl.cref[1] = 0; strcat_s(cl.cref, sf); } else { strcpy_s(cl.cref, sf); }; puts(cl.cref); #ifndef OF_WINDOWS fflush(stdout); #endif } void conoutf(OFString *str, ...) { sprintf_sdv(sf, str.UTF8String); const char *s = sf; int n = 0; |
︙ | ︙ | |||
140 141 142 143 144 145 146 | { @autoreleasepool { strn0cpy(hdr.maptitle, s.UTF8String, 128); } } COMMAND(mapmsg, ARG_1STR) | | | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | { @autoreleasepool { strn0cpy(hdr.maptitle, s.UTF8String, 128); } } COMMAND(mapmsg, ARG_1STR) #if !defined(OF_WINDOWS) && !defined(OF_MACOS) # include <SDL_syswm.h> # include <X11/Xlib.h> #endif void pasteconsole() { #if defined(OF_WINDOWS) if (!IsClipboardFormatAvailable(CF_TEXT)) return; if (!OpenClipboard(NULL)) return; char *cb = (char *)GlobalLock(GetClipboardData(CF_TEXT)); strcat_s(commandbuf, cb); GlobalUnlock(cb); CloseClipboard(); #elif !defined(OF_MACOS) SDL_SysWMinfo wminfo; SDL_VERSION(&wminfo.version); wminfo.subsystem = SDL_SYSWM_X11; if (!SDL_GetWMInfo(&wminfo)) return; int cbsize; char *cb = XFetchBytes(wminfo.info.x11.display, &cbsize); |
︙ | ︙ |