MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxMessageWindowProc

Function fxMessageWindowProc

xs/platforms/win_xs.c:47–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45static LRESULT CALLBACK fxMessageWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
46
47LRESULT CALLBACK fxMessageWindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
48{
49 switch(message) {
50 case WM_PROMISE: {
51 txMachine* the = (txMachine*)GetWindowLongPtr(window, 0);
52 fxRunPromiseJobs(the);
53 } break;
54 case WM_SERVICE: {
55 txMachine* the = (txMachine*)GetWindowLongPtr(window, 0);
56 (*the->threadCallback)(the->thread);
57 } break;
58 case WM_WORKER: {
59 txMachine* the = (txMachine*)GetWindowLongPtr(window, 0);
60 txWorkerJob* job;
61 EnterCriticalSection(&(the->workerMutex));
62 job = the->workerQueue;
63 the->workerQueue = NULL;
64 LeaveCriticalSection(&(the->workerMutex));
65 while (job) {
66 txWorkerJob* next = job->next;
67 (*job->callback)(the, job);
68 c_free(job);
69 job = next;
70 }
71 } break;
72#ifdef mxDebug
73 case WM_XSBUG: {
74 txMachine* the = (txMachine*)GetWindowLongPtr(window, 0);
75 if (fxIsReadable(the)) {
76 fxDebugCommand(the);
77 if (the->breakOnStartFlag) {
78 fxBeginHost(the);
79 fxDebugLoop(the, NULL, 0, "C: xsDebugger");
80 fxEndHost(the);
81 }
82 }
83 } break;
84#endif
85 default:
86 return DefWindowProc(window, message, wParam, lParam);
87 }
88 return 0;
89}
90
91void fxCreateMachinePlatform(txMachine* the)
92{

Callers

nothing calls this directly

Calls 6

fxRunPromiseJobsFunction · 0.85
fxDebugCommandFunction · 0.85
fxBeginHostFunction · 0.85
fxDebugLoopFunction · 0.85
fxEndHostFunction · 0.85
fxIsReadableFunction · 0.70

Tested by

no test coverage detected