fix system header dependency file generation; add EsSpacerChangeStyle

This commit is contained in:
nakst 2022-02-06 10:44:37 +00:00
parent e8bd0f55ff
commit 5d4bfa613b
5 changed files with 20 additions and 8 deletions

View File

@ -3513,7 +3513,7 @@ int ProcessSpacerMessage(EsElement *element, EsMessage *message) {
return 0; return 0;
} }
EsElement *EsSpacerCreate(EsElement *panel, uint64_t flags, const EsStyle *style, int width, int height) { EsSpacer *EsSpacerCreate(EsElement *panel, uint64_t flags, const EsStyle *style, int width, int height) {
EsSpacer *spacer = (EsSpacer *) EsHeapAllocate(sizeof(EsSpacer), true); EsSpacer *spacer = (EsSpacer *) EsHeapAllocate(sizeof(EsSpacer), true);
if (!spacer) return nullptr; if (!spacer) return nullptr;
spacer->Initialise(panel, flags, ProcessSpacerMessage, style); spacer->Initialise(panel, flags, ProcessSpacerMessage, style);
@ -3523,6 +3523,12 @@ EsElement *EsSpacerCreate(EsElement *panel, uint64_t flags, const EsStyle *style
return spacer; return spacer;
} }
void EsSpacerChangeStyle(EsSpacer *spacer, const EsStyle *style) {
EsMessageMutexCheck();
EsAssert(spacer->messageClass == ProcessSpacerMessage);
spacer->SetStyle(style);
}
EsElement *EsCustomElementCreate(EsElement *parent, uint64_t flags, const EsStyle *style) { EsElement *EsCustomElementCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
EsElement *element = (EsElement *) EsHeapAllocate(sizeof(EsElement), true); EsElement *element = (EsElement *) EsHeapAllocate(sizeof(EsElement), true);
if (!element) return nullptr; if (!element) return nullptr;

View File

@ -18,6 +18,7 @@ opaque_type EsListDisplay EsElement;
opaque_type EsCanvasPane EsElement; opaque_type EsCanvasPane EsElement;
opaque_type EsSlider EsElement; opaque_type EsSlider EsElement;
opaque_type EsScrollView EsElement; opaque_type EsScrollView EsElement;
opaque_type EsSpacer EsElement;
opaque_type EsTextPlan none; opaque_type EsTextPlan none;
opaque_type EsPaintTarget none; opaque_type EsPaintTarget none;
opaque_type EsUndoManager none; opaque_type EsUndoManager none;
@ -2533,7 +2534,7 @@ function void EsSliderSetValue(EsSlider *slider, double newValue, bool sendUpdat
// Panels, spacers and splitters. // Panels, spacers and splitters.
function EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL); function EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
function EsElement *EsSpacerCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, int width = 0, int height = 0); function EsSpacer *EsSpacerCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, int width = 0, int height = 0);
function EsSplitter *EsSplitterCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL); function EsSplitter *EsSplitterCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
function EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL); function EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
@ -2546,6 +2547,8 @@ function void EsPanelStartMovementAnimation(EsPanel *panel, float timeMultiplier
function EsButton *EsPanelRadioGroupGetChecked(EsPanel *panel); function EsButton *EsPanelRadioGroupGetChecked(EsPanel *panel);
function void EsSpacerChangeStyle(EsSpacer *spacer, const EsStyle *newStyle);
// Static displays. // Static displays.
function EsIconDisplay *EsIconDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, uint32_t iconID = 0); function EsIconDisplay *EsIconDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, uint32_t iconID = 0);

View File

@ -345,6 +345,7 @@ EsListDisplayCreate=343
EsCRTfabsf=344 EsCRTfabsf=344
EsCRTisnanf=345 EsCRTisnanf=345
EsListDisplaySetCounterContinuation=346 EsListDisplaySetCounterContinuation=346
EsSpacerChangeStyle=347
EsImageDisplayLoadBits=348 EsImageDisplayLoadBits=348
EsImageDisplayLoadFromMemory=349 EsImageDisplayLoadFromMemory=349
EsTextDisplaySetupSyntaxHighlighting=350 EsTextDisplaySetupSyntaxHighlighting=350

View File

@ -104,11 +104,10 @@ bool CheckDependencies(const char *applicationName) {
} }
for (int i = 0; !needsRebuild && i < arrlen(dependencies.files); i++) { for (int i = 0; !needsRebuild && i < arrlen(dependencies.files); i++) {
struct stat s; struct stat s = { 0 };
// printf("%s, %s\n", applicationName, dependencies.files[i]);
if (stat(dependencies.files[i], &s) || s.st_mtime > dependencies.timeStamp) { if (stat(dependencies.files[i], &s) || s.st_mtime > dependencies.timeStamp) {
// printf("%s, %s, %ld, %ld\n", applicationName, dependencies.files[i], s.st_mtime, dependencies.timeStamp);
needsRebuild = true; needsRebuild = true;
break; break;
} }
@ -171,6 +170,7 @@ void ParseDependencies(const char *dependencyFile, const char *applicationName,
struct stat s; struct stat s;
if (stat(dependencyFile, &s) == 0) { if (stat(dependencyFile, &s) == 0) {
// printf("%s %ld %ld\n", applicationName, buildStartTimeStamp, s.st_mtime);
list.timeStamp = s.st_mtime; list.timeStamp = s.st_mtime;
if (buildStartTimeStamp < s.st_mtime) list.timeStamp = buildStartTimeStamp; if (buildStartTimeStamp < s.st_mtime) list.timeStamp = buildStartTimeStamp;
list.optimised = _optimisationsEnabled; list.optimised = _optimisationsEnabled;

View File

@ -1190,7 +1190,9 @@ void OutputZig(Entry *root) {
} }
int HeaderGeneratorMain(int argc, char **argv) { int HeaderGeneratorMain(int argc, char **argv) {
if (argc < 2) { bool system = argc == 3 && 0 == strcmp(argv[1], "system");
if (system) {
outputDependencies = FileOpen(DEST_DEPENDENCIES ".tmp", 'w'); outputDependencies = FileOpen(DEST_DEPENDENCIES ".tmp", 'w');
FilePrintFormat(outputDependencies, ": \n"); FilePrintFormat(outputDependencies, ": \n");
} }
@ -1204,7 +1206,7 @@ int HeaderGeneratorMain(int argc, char **argv) {
language = argv[1]; language = argv[1];
output = FileOpen(argv[2], 'w'); output = FileOpen(argv[2], 'w');
if (0 == strcmp(argv[1], "system")) { if (system) {
outputAPIArray = FileOpen(DEST_API_ARRAY, 'w'); outputAPIArray = FileOpen(DEST_API_ARRAY, 'w');
outputSyscallArray = FileOpen(DEST_SYSCALL_ARRAY, 'w'); outputSyscallArray = FileOpen(DEST_SYSCALL_ARRAY, 'w');
outputEnumStringsArray = FileOpen(DEST_ENUM_STRINGS_ARRAY, 'w'); outputEnumStringsArray = FileOpen(DEST_ENUM_STRINGS_ARRAY, 'w');
@ -1319,7 +1321,7 @@ int HeaderGeneratorMain(int argc, char **argv) {
Log("Unsupported language '%s'.\nLanguage must be one of: 'c', 'odin'.\n", language); Log("Unsupported language '%s'.\nLanguage must be one of: 'c', 'odin'.\n", language);
} }
if (argc < 2) { if (system) {
rename(DEST_DEPENDENCIES ".tmp", DEST_DEPENDENCIES); rename(DEST_DEPENDENCIES ".tmp", DEST_DEPENDENCIES);
} }