fix scrollbars, introduce watch cursor on blocking operations, lots of other small bug fixes

This commit is contained in:
camh 2021-11-16 23:40:49 -08:00
parent 48ba29dbc0
commit 64033547d6
16 changed files with 3007 additions and 1954 deletions

View File

@ -17,6 +17,236 @@ const defaultOptions = {
let client
const widthFor12ptFont = [
0,
10,
10,
10,
10,
10,
10,
10,
10,
8,
10,
10,
10,
0,
10,
10,
10,
11,
11,
9,
11,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
4,
6,
7,
10,
7,
11,
10,
3,
5,
5,
7,
7,
4,
7,
4,
7,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
4,
4,
6,
8,
6,
8,
11,
8,
8,
8,
8,
7,
7,
8,
8,
6,
7,
9,
7,
12,
9,
8,
8,
8,
8,
7,
6,
8,
8,
12,
8,
8,
8,
5,
7,
5,
8,
8,
6,
8,
8,
7,
8,
8,
6,
8,
8,
4,
6,
8,
4,
12,
8,
8,
8,
8,
6,
7,
6,
8,
8,
12,
8,
8,
8,
5,
5,
5,
8,
8
]
// this is tied to Sample.c's message window max width
const MAX_WIDTH = 285
const getNextWordLength = (word) => {
let currentWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
currentWidth += currentCharWidth
}
return currentWidth
}
const shortenText = (text) => {
let outputText = ``
let currentWidth = 0
for (const word of text.split(` `)) {
let currentWordWidth = getNextWordLength(word)
if (currentWidth + currentWordWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
currentWidth = 0
// okay, but what if the word itself is greater than max width?
if (currentWordWidth > MAX_WIDTH) {
let splitWordWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
if (splitWordWidth + currentCharWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
splitWordWidth = 0
}
splitWordWidth += currentCharWidth
outputText = `${outputText}${char}`
}
currentWidth += splitWordWidth
continue
}
}
currentWidth += currentWordWidth
outputText = `${outputText} ${word}`
}
return outputText
}
const splitMessages = (messages) => {
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = tempMessageOutput
} else {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = `${messageOutput}ENDLASTMESSAGE${tempMessageOutput}`
}
firstMessage = false
}
messageOutput = `${messageOutput}ENDLASTMESSAGE`
lastMessageOutput = messageOutput
return messageOutput
}
let lastMessageOutput
class iMessageClient {
@ -34,39 +264,23 @@ class iMessageClient {
})
let messages = result.data.getMessages
let messageOutput = ``
const maxPerLine = 20000
console.log(`return messages from get messages:`)
console.log(messages)
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
messageOutput = `${message.chatter}: ${message.text}`
} else {
messageOutput = `${messageOutput}ENDLASTMESSAGE${message.chatter}: ${message.text}`
}
firstMessage = false
}
return messageOutput
return splitMessages(messages)
}
async hasNewMessagesInChat (chatId) {
let currentLastMessageOutput = `${lastMessageOutput}`
let messageOutput = await this.getMessages(chatId, 0)
console.log(`new messages in chat?`)
console.log(currentLastMessageOutput !== messageOutput)
return (currentLastMessageOutput !== messageOutput).toString()
}
async sendMessage (chatId, message) {
console.log(`send messages for chat ID: ${chatId} ${message}`)
let result = await client.query({
query: gql`query sendMessage {
sendMessage(chatId: "${chatId}", message: "${message}") {
@ -77,30 +291,8 @@ class iMessageClient {
})
let messages = result.data.sendMessage
let messageOutput = ``
const maxPerLine = 20000
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
messageOutput = `${message.chatter}: ${message.text}`
} else {
messageOutput = `${messageOutput}ENDLASTMESSAGE${message.chatter}: ${message.text}`
}
firstMessage = false
}
return messageOutput
return splitMessages(messages)
}
async getChats () {
@ -129,11 +321,16 @@ class iMessageClient {
friendlyNameStrings = friendlyNameStrings.substring(1, friendlyNameStrings.length)
console.log(`chats`)
console.log(friendlyNameStrings)
return friendlyNameStrings
}
setIPAddress (IPAddress) {
console.log(`instantiate apolloclient with uri ${IPAddress}:4000/`)
try {
client = new ApolloClient({

View File

@ -112,19 +112,16 @@ void AlertUser( void );
#define BotRight(aRect) (* (Point *) &(aRect).bottom)
// TODO:
// - IN PROGRESS, fix issues related to perf work... need to have nuklear redraw on text scroll, need to hold scroll positions somehow for inactive windows (undo, see what happens?)
// - potential perf gain: float -> integer math
// - potential perf gain: strip unnecessary function calls (which?)
// - get new messages (when?) -- start with on send
// - IN PROGRESS new message window -- needs to blank out messages, then needs fixes on new mac end
// - chat during the day for a few minutes and figure out small issues
// - transfer to mac, get hw setup working
// - start writing blog posts
// - js code needs to split long messages into max length per line, so that they display properly
// - get new messages in other chats and display some sort of alert
// - why does the automator script sometimes not send
char jsFunctionResponse[102400]; // Matches MAX_RECEIVE_SIZE
Boolean firstOrMouseMove = true;
int haveRun = 0;
int chatFriendlyNamesCounter = 0;
int ipAddressSet = 0;
@ -132,14 +129,14 @@ int sendNewChat = 0;
char chatFriendlyNames[16][64];
char activeChat[64];
int activeMessageCounter = 0;
char activeChatMessages[10][2048];
char activeChatMessages[64][2048];
char box_input_buffer[2048];
char ip_input_buffer[255];
char new_message_input_buffer[255];
short box_len;
short box_input_len;
short new_message_input_buffer_len;
short ip_input_buffer_len;
static short ip_input_buffer_len; // TODO: setting a length here will make the default `http://...` work, but doesn't work right -- maybe due to perf work in nuklear
int shouldScrollMessages = 0;
int forceRedraw = 2; // this is how many 'iterations' of the UI that we need to see every element for
int messagesScrollBarLocation = 0;
@ -148,7 +145,8 @@ int coprocessorLoaded = 0;
void getMessagesFromjsFunctionResponse() {
for (int i = 0; i < 8; i++) {
for (int i = 0; i < 64; i++) {
memset(&activeChatMessages[i], '\0', 2048);
}
@ -184,12 +182,13 @@ void sendMessage() {
return;
}
void sendIPAddressToCoprocessor() {
char output[2048];
sprintf(output, "%s", ip_input_buffer);
writeSerialPortDebug(boutRefNum, output);
callFunctionOnCoprocessor("setIPAddress", output, jsFunctionResponse);
return;
@ -209,6 +208,29 @@ void getMessages(char *thread, int page) {
return;
}
void getHasNewMessagesInChat(char *thread) {
char output[62];
sprintf(output, "%s", thread);
// writeSerialPortDebug(boutRefNum, output);
callFunctionOnCoprocessor("hasNewMessagesInChat", output, jsFunctionResponse);
writeSerialPortDebug(boutRefNum, jsFunctionResponse);
if (!strcmp(jsFunctionResponse, "true")) {
writeSerialPortDebug(boutRefNum, "update current chat");
SysBeep(1);
getMessages(thread, 0);
// force redraw
firstOrMouseMove = true;
} else {
}
return;
}
// set up function to get available chat (fill buttons on right hand side)
// run it on some interval? make sure user is not typing!!!
void getChats() {
@ -257,7 +279,6 @@ static void boxTest(struct nk_context *ctx) {
return;
}
// prompt the user for the graphql instance
if (!ipAddressSet) {
@ -274,7 +295,7 @@ static void boxTest(struct nk_context *ctx) {
{
nk_layout_row_push(ctx, WINDOW_WIDTH / 2 - 90); // 40% wide
nk_edit_string(ctx, NK_EDIT_SIMPLE, ip_input_buffer, &ip_input_buffer_len, 2048, nk_filter_default);
nk_edit_string(ctx, NK_EDIT_SIMPLE, ip_input_buffer, &ip_input_buffer_len, 255, nk_filter_default);
nk_layout_row_push(ctx, 60); // 40% wide
if (nk_button_label(ctx, "save")) {
@ -330,6 +351,7 @@ static void boxTest(struct nk_context *ctx) {
{
for (int i = 0; i < chatFriendlyNamesCounter; i++) {
// only display the first 8 chats, create new chat if you need someone not in your list
if (i > 9) {
continue;
@ -339,13 +361,9 @@ static void boxTest(struct nk_context *ctx) {
if (nk_button_label(ctx, chatFriendlyNames[i])) {
// writeSerialPortDebug(boutRefNum, "CLICK!");
// writeSerialPortDebug(boutRefNum, chatFriendlyNames[i]);
sprintf(activeChat, "%s", chatFriendlyNames[i]);
getMessages(activeChat, 0);
shouldScrollMessages = 1;
forceRedraw = 2;
// writeSerialPortDebug(boutRefNum, "CLICK complete, enjoy your chat!");
shouldScrollMessages = 1;
}
}
}
@ -368,7 +386,8 @@ static void boxTest(struct nk_context *ctx) {
if (nk_button_label(ctx, "send")) {
//fprintf(stdout, "pushed!\n");
sendMessage();
forceRedraw = 2;
memset(&box_input_buffer, '\0', 2048);
}
}
nk_layout_row_end(ctx);
@ -395,13 +414,7 @@ static void boxTest(struct nk_context *ctx) {
ctx->current->scrollbar.y = 10000;
shouldScrollMessages = 0;
} else if (messageWindowWasDormant) {
ctx->current->scrollbar.y = messagesScrollBarLocation;
}
messagesScrollBarLocation = ctx->current->scrollbar.y;
}
nk_layout_row_end(ctx);
@ -450,8 +463,6 @@ void main()
coprocessorLoaded = 1;
sprintf(ip_input_buffer, "http://");
#ifdef MAC_APP_DEBUGGING
// writeSerialPortDebug(boutRefNum, "call into event loop");
@ -472,12 +483,25 @@ void EventLoop(struct nk_context *ctx)
Point mouse;
cursorRgn = NewRgn();
Boolean firstOrMouseMove = true;
int lastMouseHPos = 0;
int lastMouseVPos = 0;
int lastUpdatedTickCount = 0;
do {
// check for new stuff ever 5 sec?
if (TickCount() - lastUpdatedTickCount > 300) {
writeSerialPortDebug(boutRefNum, "update by tick count");
lastUpdatedTickCount = TickCount();
if (strcmp(activeChat, "no active chat")) {
writeSerialPortDebug(boutRefNum, "check chat");
getHasNewMessagesInChat(activeChat);
}
}
Boolean beganInput = false;
#ifdef MAC_APP_DEBUGGING
@ -516,6 +540,8 @@ void EventLoop(struct nk_context *ctx)
mouse_x = tempPoint.h;
mouse_y = tempPoint.v;
lastUpdatedTickCount = TickCount();
}
lastMouseHPos = mouse.h;
@ -527,6 +553,8 @@ void EventLoop(struct nk_context *ctx)
// drain all events before rendering
while (gotEvent) {
lastUpdatedTickCount = TickCount();
#ifdef MAC_APP_DEBUGGING
writeSerialPortDebug(boutRefNum, "calling to DoEvent");

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 KiB

After

Width:  |  Height:  |  Size: 323 KiB

View File

@ -1,6 +1,6 @@
set(CMAKE_HOST_SYSTEM "Linux-5.11.0-38-generic")
set(CMAKE_HOST_SYSTEM "Linux-5.11.0-40-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "5.11.0-38-generic")
set(CMAKE_HOST_SYSTEM_VERSION "5.11.0-40-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
include("/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/retro68.toolchain.cmake")

View File

@ -1,5 +1,5 @@
The target system is: Retro68 - 1 -
The host system is: Linux - 5.11.0-38-generic - x86_64
The host system is: Linux - 5.11.0-40-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc
Build flags:
@ -33,13 +33,13 @@ The CXX compiler identification is GNU, found in "/home/camh/Documents/Retro68kA
Determining if the C compiler works passed with the following output:
Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_6553a/fast && /usr/bin/make -f CMakeFiles/cmTC_6553a.dir/build.make CMakeFiles/cmTC_6553a.dir/build
Run Build Command(s):/usr/bin/make cmTC_b8596/fast && /usr/bin/make -f CMakeFiles/cmTC_b8596.dir/build.make CMakeFiles/cmTC_b8596.dir/build
make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6553a.dir/testCCompiler.c.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -o CMakeFiles/cmTC_6553a.dir/testCCompiler.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_6553a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6553a.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc CMakeFiles/cmTC_6553a.dir/testCCompiler.c.obj -o cmTC_6553a
Building C object CMakeFiles/cmTC_b8596.dir/testCCompiler.c.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -o CMakeFiles/cmTC_b8596.dir/testCCompiler.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_b8596
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b8596.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc CMakeFiles/cmTC_b8596.dir/testCCompiler.c.obj -o cmTC_b8596
make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
@ -47,18 +47,18 @@ make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/b
Detecting C compiler ABI info compiled with the following output:
Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_bfd50/fast && /usr/bin/make -f CMakeFiles/cmTC_bfd50.dir/build.make CMakeFiles/cmTC_bfd50.dir/build
Run Build Command(s):/usr/bin/make cmTC_bf9b9/fast && /usr/bin/make -f CMakeFiles/cmTC_bf9b9.dir/build.make CMakeFiles/cmTC_bf9b9.dir/build
make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c
Building C object CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c
Using built-in specs.
COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc
Target: m68k-apple-macos
Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing
Thread model: single
gcc version 9.1.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccJ9kVQL.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccxV71Np.s
GNU C17 (GCC) version 9.1.0 (m68k-apple-macos)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
@ -73,14 +73,14 @@ GNU C17 (GCC) version 9.1.0 (m68k-apple-macos)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 68baab70957df643ffb4605a09112146
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj /tmp/ccJ9kVQL.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj /tmp/ccxV71Np.s
COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/
LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
Linking C executable cmTC_bfd50
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bfd50.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -o cmTC_bfd50
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'
Linking C executable cmTC_bf9b9
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bf9b9.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -o cmTC_bf9b9
Using built-in specs.
COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc
COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper
@ -90,9 +90,9 @@ Thread model: single
gcc version 9.1.0 (GCC)
COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/
LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bfd50' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnYDpkb.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_bfd50 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bfd50' '-mcpu=68000'
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bf9b9' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccMbskMR.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_bf9b9 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bf9b9' '-mcpu=68000'
make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
@ -114,18 +114,18 @@ Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(m68k-apple-macos-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/make cmTC_bfd50/fast && /usr/bin/make -f CMakeFiles/cmTC_bfd50.dir/build.make CMakeFiles/cmTC_bfd50.dir/build]
ignore line: [Run Build Command(s):/usr/bin/make cmTC_bf9b9/fast && /usr/bin/make -f CMakeFiles/cmTC_bf9b9.dir/build.make CMakeFiles/cmTC_bf9b9.dir/build]
ignore line: [make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp']
ignore line: [Building C object CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c]
ignore line: [Building C object CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc]
ignore line: [Target: m68k-apple-macos]
ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing]
ignore line: [Thread model: single]
ignore line: [gcc version 9.1.0 (GCC) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccJ9kVQL.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccxV71Np.s]
ignore line: [GNU C17 (GCC) version 9.1.0 (m68k-apple-macos)]
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none]
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
@ -140,14 +140,14 @@ Parsed C implicit link information from above output:
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none]
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 68baab70957df643ffb4605a09112146]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj /tmp/ccJ9kVQL.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj /tmp/ccxV71Np.s]
ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/]
ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [Linking C executable cmTC_bfd50]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bfd50.dir/link.txt --verbose=1]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj -o cmTC_bfd50 ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000']
ignore line: [Linking C executable cmTC_bf9b9]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bf9b9.dir/link.txt --verbose=1]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj -o cmTC_bf9b9 ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc]
ignore line: [COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper]
@ -157,13 +157,13 @@ Parsed C implicit link information from above output:
ignore line: [gcc version 9.1.0 (GCC) ]
ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/]
ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bfd50' '-mcpu=68000']
link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnYDpkb.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_bfd50 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_bf9b9' '-mcpu=68000']
link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccMbskMR.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_bf9b9 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group]
arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccnYDpkb.res] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccMbskMR.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lretrocrt] ==> ignore
@ -172,10 +172,10 @@ Parsed C implicit link information from above output:
arg [-q] ==> ignore
arg [-undefined=_consolewrite] ==> ignore
arg [-o] ==> ignore
arg [cmTC_bfd50] ==> ignore
arg [cmTC_bf9b9] ==> ignore
arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0]
arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib]
arg [CMakeFiles/cmTC_bfd50.dir/CMakeCCompilerABI.c.obj] ==> ignore
arg [CMakeFiles/cmTC_bf9b9.dir/CMakeCCompilerABI.c.obj] ==> ignore
arg [--start-group] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [-lc] ==> lib [c]
@ -192,13 +192,13 @@ Parsed C implicit link information from above output:
Determining if the CXX compiler works passed with the following output:
Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_675f8/fast && /usr/bin/make -f CMakeFiles/cmTC_675f8.dir/build.make CMakeFiles/cmTC_675f8.dir/build
Run Build Command(s):/usr/bin/make cmTC_46678/fast && /usr/bin/make -f CMakeFiles/cmTC_46678.dir/build.make CMakeFiles/cmTC_46678.dir/build
make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_675f8.dir/testCXXCompiler.cxx.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -o CMakeFiles/cmTC_675f8.dir/testCXXCompiler.cxx.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_675f8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_675f8.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ CMakeFiles/cmTC_675f8.dir/testCXXCompiler.cxx.obj -o cmTC_675f8
Building CXX object CMakeFiles/cmTC_46678.dir/testCXXCompiler.cxx.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -o CMakeFiles/cmTC_46678.dir/testCXXCompiler.cxx.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_46678
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_46678.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ CMakeFiles/cmTC_46678.dir/testCXXCompiler.cxx.obj -o cmTC_46678
make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
@ -206,18 +206,18 @@ make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/b
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_48f0a/fast && /usr/bin/make -f CMakeFiles/cmTC_48f0a.dir/build.make CMakeFiles/cmTC_48f0a.dir/build
Run Build Command(s):/usr/bin/make cmTC_7dacf/fast && /usr/bin/make -f CMakeFiles/cmTC_7dacf.dir/build.make CMakeFiles/cmTC_7dacf.dir/build
make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp
Building CXX object CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp
Using built-in specs.
COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++
Target: m68k-apple-macos
Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing
Thread model: single
gcc version 9.1.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/ccQNGdi1.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/ccHCAsvB.s
GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
@ -235,14 +235,14 @@ GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5b31867a30cfa7e65d4bce12c39f8a21
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj /tmp/ccQNGdi1.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj /tmp/ccHCAsvB.s
COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/
LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
Linking CXX executable cmTC_48f0a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_48f0a.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_48f0a
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'
Linking CXX executable cmTC_7dacf
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7dacf.dir/link.txt --verbose=1
/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_7dacf
Using built-in specs.
COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++
COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper
@ -252,9 +252,9 @@ Thread model: single
gcc version 9.1.0 (GCC)
COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/
LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_48f0a' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc9elJCy.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_48f0a -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_48f0a' '-mcpu=68000'
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dacf' '-mcpu=68000'
/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8cPay1.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_7dacf -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dacf' '-mcpu=68000'
make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'
@ -282,18 +282,18 @@ Parsed CXX implicit link information from above output:
link line regex: [^( *|.*[/\])(m68k-apple-macos-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/make cmTC_48f0a/fast && /usr/bin/make -f CMakeFiles/cmTC_48f0a.dir/build.make CMakeFiles/cmTC_48f0a.dir/build]
ignore line: [Run Build Command(s):/usr/bin/make cmTC_7dacf/fast && /usr/bin/make -f CMakeFiles/cmTC_7dacf.dir/build.make CMakeFiles/cmTC_7dacf.dir/build]
ignore line: [make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp']
ignore line: [Building CXX object CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Building CXX object CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++]
ignore line: [Target: m68k-apple-macos]
ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing]
ignore line: [Thread model: single]
ignore line: [gcc version 9.1.0 (GCC) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/ccQNGdi1.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/ccHCAsvB.s]
ignore line: [GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos)]
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none]
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
@ -311,14 +311,14 @@ Parsed CXX implicit link information from above output:
ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none]
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 5b31867a30cfa7e65d4bce12c39f8a21]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj /tmp/ccQNGdi1.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj /tmp/ccHCAsvB.s]
ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/]
ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [Linking CXX executable cmTC_48f0a]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_48f0a.dir/link.txt --verbose=1]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_48f0a ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000']
ignore line: [Linking CXX executable cmTC_7dacf]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7dacf.dir/link.txt --verbose=1]
ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_7dacf ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++]
ignore line: [COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper]
@ -328,13 +328,13 @@ Parsed CXX implicit link information from above output:
ignore line: [gcc version 9.1.0 (GCC) ]
ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/]
ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_48f0a' '-mcpu=68000']
link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc9elJCy.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_48f0a -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dacf' '-mcpu=68000']
link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8cPay1.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_7dacf -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group]
arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cc9elJCy.res] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cc8cPay1.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lretrocrt] ==> ignore
@ -343,10 +343,10 @@ Parsed CXX implicit link information from above output:
arg [-q] ==> ignore
arg [-undefined=_consolewrite] ==> ignore
arg [-o] ==> ignore
arg [cmTC_48f0a] ==> ignore
arg [cmTC_7dacf] ==> ignore
arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0]
arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib]
arg [CMakeFiles/cmTC_48f0a.dir/CMakeCXXCompilerABI.cpp.obj] ==> ignore
arg [CMakeFiles/cmTC_7dacf.dir/CMakeCXXCompilerABI.cpp.obj] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [--start-group] ==> ignore

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -522,12 +522,16 @@ void sendProgramToCoprocessor(char* program, char *output) {
printf("sendProgramToCoprocessor\n");
}
SetCursor(*GetCursor(watchCursor));
writeToCoprocessor("PROGRAM", program);
char serialPortResponse[MAX_RECEIVE_SIZE];
readSerialPort(serialPortResponse);
getReturnValueFromResponse(serialPortResponse, "PROGRAM", output);
SetCursor(&qd.arrow);
return;
}
@ -549,6 +553,7 @@ void callFunctionOnCoprocessor(char* functionName, char* parameters, char* outpu
// delimeter for function paramters is &&& - user must do this on their own via sprintf call or other construct - this is easiest for us to deal with
sprintf(functionCallMessage, functionTemplate, functionName, parameters);
SetCursor(*GetCursor(watchCursor));
// writeSerialPortDebug(boutRefNum, functionCallMessage);
writeToCoprocessor("FUNCTION", functionCallMessage);
@ -559,6 +564,8 @@ void callFunctionOnCoprocessor(char* functionName, char* parameters, char* outpu
memset(output, '\0', RECEIVE_WINDOW_SIZE);
getReturnValueFromResponse(serialPortResponse, "FUNCTION", output);
SetCursor(&qd.arrow);
return;
}

View File

@ -7957,9 +7957,9 @@ nk_str_append_text_char(struct nk_str *s, const char *str, short len)
// NK_ASSERT(s);
// NK_ASSERT(str);
if (!s || !str || !len) return 0;
mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * 8, 0);
mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
if (!mem) return 0;
NK_MEMCPY(mem, str, (nk_size)len * 8);
NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
s->len += nk_utf_len(str, len);
return len;
}
@ -10984,6 +10984,7 @@ nk_panel_end(struct nk_context *ctx)
scroll_offset, scroll_target, scroll_step, scroll_inc,
&ctx->style.scrollv, in, style->font);
*layout->offset_y = (short)scroll_offset;
if (in && scroll_has_scrolling)
in->mouse.scroll_delta.y = 0;
}
@ -16688,12 +16689,20 @@ nk_do_scrollbarv(nk_flags *state,
// 27 = (84/574) * 190
// target / scroll.h = scroll_offset / 574/190 =
// cursor.h = 192 / (270 / 192)
// cursor.h = 192 / 1.4 // i think this rounds to 192 / 1, but we want = 137
cursor.h = NK_MAX(scroll.h / (target / scroll.h), 0);
cursor.y = scroll.y + scroll_offset / (target / scroll.h) + style->border + style->padding.y;
cursor.h = (scroll.h * scroll.h) / target;
// y = 39 + (78 * 270) / 192
// y = 39 + 21060 / 192
// y = 39 + 110
cursor.y = scroll.y + (scroll_offset * target) / scroll.h + style->border + style->padding.y;
cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
cursor.x = scroll.x + style->border + style->padding.x;
/* calculate empty space around cursor */
empty_north.x = scroll.x;
empty_north.y = scroll.y;
@ -16709,8 +16718,12 @@ nk_do_scrollbarv(nk_flags *state,
scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
&empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
cursor.y = scroll.y + scroll_offset / (target / scroll.h) + style->border_cursor + style->padding.y;
cursor.y = scroll.y + (scroll_offset * scroll.h) / target + style->border_cursor + style->padding.y;
writeSerialPortDebug(boutRefNum, "vertical scroll barxxx!");
char x[255];
sprintf(x, "h %d, y %d, w %d, x %d, scrollh: %d, target: %d, scroll_off %d, scroll_off %d scrolly %d", cursor.h, cursor.y, cursor.w, cursor.x, scroll.h, target, scroll_off, scroll_offset, scroll.y);
writeSerialPortDebug(boutRefNum, x);
/* draw scrollbar */
if (style->draw_begin) style->draw_begin(out, style->userdata);
nk_draw_scrollbar(out, *state, style, &scroll, &cursor);

523
output_js
View File

@ -18,6 +18,234 @@ const defaultOptions = {
let client
const widthFor12ptFont = [
0,
10,
10,
10,
10,
10,
10,
10,
10,
8,
10,
10,
10,
0,
10,
10,
10,
11,
11,
9,
11,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
4,
6,
7,
10,
7,
11,
10,
3,
5,
5,
7,
7,
4,
7,
4,
7,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
4,
4,
6,
8,
6,
8,
11,
8,
8,
8,
8,
7,
7,
8,
8,
6,
7,
9,
7,
12,
9,
8,
8,
8,
8,
7,
6,
8,
8,
12,
8,
8,
8,
5,
7,
5,
8,
8,
6,
8,
8,
7,
8,
8,
6,
8,
8,
4,
6,
8,
4,
12,
8,
8,
8,
8,
6,
7,
6,
8,
8,
12,
8,
8,
8,
5,
5,
5,
8,
8
]
// this is tied to Sample.c's message window max width
const MAX_WIDTH = 285
const getNextWordLength = (word) => {
let currentWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
currentWidth += currentCharWidth
}
return currentWidth
}
const shortenText = (text) => {
let outputText = ``
let currentWidth = 0
for (const word of text.split(` `)) {
let currentWordWidth = getNextWordLength(word)
if (currentWidth + currentWordWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
currentWidth = 0
// okay, but what if the word itself is greater than max width?
if (currentWordWidth > MAX_WIDTH) {
let splitWordWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
if (splitWordWidth + currentCharWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
splitWordWidth = 0
}
splitWordWidth += currentCharWidth
outputText = `${outputText}${char}`
}
continue
}
}
currentWidth += currentWordWidth
outputText = `${outputText} ${word}`
}
return outputText
}
const splitMessages = (messages) => {
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = tempMessageOutput
} else {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = `${messageOutput}ENDLASTMESSAGE${tempMessageOutput}`
}
firstMessage = false
}
messageOutput = `${messageOutput}ENDLASTMESSAGE`
lastMessageOutput = messageOutput
return messageOutput
}
let lastMessageOutput
class iMessageClient {
@ -35,39 +263,23 @@ class iMessageClient {
})
let messages = result.data.getMessages
let messageOutput = ``
const maxPerLine = 20000
console.log(`return messages from get messages:`)
console.log(messages)
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
messageOutput = `${message.chatter}: ${message.text}`
} else {
messageOutput = `${messageOutput}ENDLASTMESSAGE${message.chatter}: ${message.text}`
}
firstMessage = false
}
return messageOutput
return splitMessages(messages)
}
async hasNewMessagesInChat (chatId) {
let currentLastMessageOutput = `${lastMessageOutput}`
let messageOutput = await this.getMessages(chatId, 0)
console.log(`new messages in chat?`)
console.log(currentLastMessageOutput !== messageOutput)
return (currentLastMessageOutput !== messageOutput).toString()
}
async sendMessage (chatId, message) {
console.log(`send messages for chat ID: ${chatId} ${message}`)
let result = await client.query({
query: gql`query sendMessage {
sendMessage(chatId: "${chatId}", message: "${message}") {
@ -78,30 +290,8 @@ class iMessageClient {
})
let messages = result.data.sendMessage
let messageOutput = ``
const maxPerLine = 20000
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
messageOutput = `${message.chatter}: ${message.text}`
} else {
messageOutput = `${messageOutput}ENDLASTMESSAGE${message.chatter}: ${message.text}`
}
firstMessage = false
}
return messageOutput
return splitMessages(messages)
}
async getChats () {
@ -135,6 +325,8 @@ class iMessageClient {
setIPAddress (IPAddress) {
console.log(`instantiate apolloclient with uri ${IPAddress}:4000/`)
try {
client = new ApolloClient({
@ -661,12 +853,233 @@ package-lock.json@@@
}
&&&
test.js@@@
let iMessageClient = new (require('./index.js'))()
const test = async () => {
let results = await iMessageClient.getChats()
console.log(`results`)
const widthFor12ptFont = [
0,
10,
10,
10,
10,
10,
10,
10,
10,
8,
10,
10,
10,
0,
10,
10,
10,
11,
11,
9,
11,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
10,
4,
6,
7,
10,
7,
11,
10,
3,
5,
5,
7,
7,
4,
7,
4,
7,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
4,
4,
6,
8,
6,
8,
11,
8,
8,
8,
8,
7,
7,
8,
8,
6,
7,
9,
7,
12,
9,
8,
8,
8,
8,
7,
6,
8,
8,
12,
8,
8,
8,
5,
7,
5,
8,
8,
6,
8,
8,
7,
8,
8,
6,
8,
8,
4,
6,
8,
4,
12,
8,
8,
8,
8,
6,
7,
6,
8,
8,
12,
8,
8,
8,
5,
5,
5,
8,
8
]
const MAX_WIDTH = 285
const getNextWordLength = (word) => {
let currentWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
currentWidth += currentCharWidth
}
return currentWidth
}
test()
const shortenText = (text) => {
let outputText = ``
let currentWidth = 0
for (const word of text.split(` `)) {
let currentWordWidth = getNextWordLength(word)
if (currentWidth + currentWordWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
currentWidth = 0
// okay, but what if the word itself is greater than max width?
if (currentWordWidth > MAX_WIDTH) {
let splitWordWidth = 0
for (const char of word.split(``)) {
let currentCharWidth = widthFor12ptFont[char.charCodeAt()]
if (splitWordWidth + currentCharWidth > MAX_WIDTH) {
outputText = `${outputText}ENDLASTMESSAGE`
splitWordWidth = 0
}
splitWordWidth += currentCharWidth
outputText = `${outputText}${char}`
}
currentWidth += splitWordWidth
continue
}
}
currentWidth += currentWordWidth
outputText = `${outputText} ${word}`
}
return outputText
}
const splitMessages = (messages) => {
let firstMessage = true
if (!messages) {
return ``
}
for (const message of messages) {
if (firstMessage) {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = tempMessageOutput
} else {
let tempMessageOutput = `${message.chatter}: ${message.text}`
tempMessageOutput = shortenText(tempMessageOutput)
messageOutput = `${messageOutput}ENDLASTMESSAGE${tempMessageOutput}`
}
firstMessage = false
}
messageOutput = `${messageOutput}ENDLASTMESSAGE`
lastMessageOutput = messageOutput
return messageOutput
}
console.log(splitMessages([{chatter: `me`, text: 'me: were gonna end up with so much shit on our counter tops that well have to prep the food on the floor with the dogs'}]))

File diff suppressed because it is too large Load Diff