js: Add a new function whereby C can ask JS for a preferred board size

Currently JS has no opinion.
This commit is contained in:
Ben Harris
2022-10-29 21:45:11 +01:00
parent 14eb35da4a
commit 33b5c48429
2 changed files with 18 additions and 1 deletions

View File

@ -563,6 +563,20 @@ mergeInto(LibraryManager.library, {
statusbar.textContent = UTF8ToString(ptr);
},
/*
* bool js_canvas_get_preferred_size(int *wp, int *hp);
*
* This is called before calling midend_size() to set a puzzle to
* the default size. If the JavaScript layer has an opinion about
* how big the puzzle should be, it can overwrite *wp and *hp with
* its preferred size, and return true if the "user" parameter to
* midend_size() should be true. Otherwise it should leave them
* alone and return false.
*/
js_canvas_get_preferred_size: function(wp, hp) {
return false;
},
/*
* void js_canvas_set_size(int w, int h);
*