mirror of https://gitlab.com/nakst/essence
theming: replace EsStyle alias hack with EsStyleID
This commit is contained in:
parent
5fd3ee2da3
commit
4224a1b670
|
@ -357,7 +357,7 @@ void ProcessApplicationMessage(EsMessage *message) {
|
|||
EsSpacerCreate(panel, ES_CELL_FILL);
|
||||
gameArea = EsCustomElementCreate(panel, ES_ELEMENT_FOCUSABLE);
|
||||
gameArea->messageUser = GameAreaMessage;
|
||||
EsSpacerCreate(panel, ES_FLAGS_DEFAULT, nullptr, 30, 0);
|
||||
EsSpacerCreate(panel, ES_FLAGS_DEFAULT, 0, 30, 0);
|
||||
EsPanel *info = EsPanelCreate(panel);
|
||||
EsSpacerCreate(panel, ES_CELL_FILL);
|
||||
|
||||
|
@ -365,12 +365,12 @@ void ProcessApplicationMessage(EsMessage *message) {
|
|||
info->messageUser = InfoPanelMessage;
|
||||
EsTextDisplayCreate(info, ES_CELL_H_FILL, ES_STYLE_TEXT_LABEL_SECONDARY, INTERFACE_STRING(Game2048Score));
|
||||
scoreDisplay = EsTextDisplayCreate(info, ES_CELL_H_FILL, ES_STYLE_TEXT_HEADING0);
|
||||
EsSpacerCreate(info, ES_FLAGS_DEFAULT, nullptr, 0, 10);
|
||||
EsSpacerCreate(info, ES_FLAGS_DEFAULT, 0, 0, 10);
|
||||
highScoreDisplay = EsTextDisplayCreate(info, ES_CELL_H_FILL | ES_TEXT_DISPLAY_RICH_TEXT, ES_STYLE_TEXT_LABEL_SECONDARY);
|
||||
EsSpacerCreate(info, ES_CELL_FILL);
|
||||
EsTextDisplayCreate(info, ES_CELL_H_FILL | ES_TEXT_DISPLAY_RICH_TEXT, ES_STYLE_TEXT_PARAGRAPH_SECONDARY, INTERFACE_STRING(Game2048Instructions));
|
||||
EsSpacerCreate(info, ES_FLAGS_DEFAULT, nullptr, 0, 10);
|
||||
EsButton *newGame = EsButtonCreate(info, ES_CELL_H_LEFT | ES_BUTTON_NOT_FOCUSABLE, nullptr, INTERFACE_STRING(Game2048NewGame));
|
||||
EsSpacerCreate(info, ES_FLAGS_DEFAULT, 0, 0, 10);
|
||||
EsButton *newGame = EsButtonCreate(info, ES_CELL_H_LEFT | ES_BUTTON_NOT_FOCUSABLE, 0, INTERFACE_STRING(Game2048NewGame));
|
||||
newGame->accessKey = 'N';
|
||||
EsButtonOnCommand(newGame, NewGameCommand);
|
||||
|
||||
|
|
|
@ -173,12 +173,12 @@ void InstanceRefreshViewType(Instance *instance) {
|
|||
EsCommandSetCheck(&instance->commandViewThumbnails, instance->viewSettings.viewType == VIEW_THUMBNAILS ? ES_CHECK_CHECKED : ES_CHECK_UNCHECKED, false);
|
||||
|
||||
if (instance->viewSettings.viewType == VIEW_DETAILS) {
|
||||
EsListViewChangeStyles(instance->list, &styleFolderView, ES_STYLE_LIST_ITEM, nullptr, nullptr, ES_LIST_VIEW_COLUMNS, ES_LIST_VIEW_TILED);
|
||||
EsListViewChangeStyles(instance->list, EsStyleIntern(&styleFolderView), ES_STYLE_LIST_ITEM, 0, 0, ES_LIST_VIEW_COLUMNS, ES_LIST_VIEW_TILED);
|
||||
EsListViewAddAllColumns(instance->list);
|
||||
} else if (instance->viewSettings.viewType == VIEW_TILES) {
|
||||
EsListViewChangeStyles(instance->list, &styleFolderViewTiled, ES_STYLE_LIST_ITEM_TILE, nullptr, nullptr, ES_LIST_VIEW_TILED, ES_LIST_VIEW_COLUMNS);
|
||||
EsListViewChangeStyles(instance->list, EsStyleIntern(&styleFolderViewTiled), ES_STYLE_LIST_ITEM_TILE, 0, 0, ES_LIST_VIEW_TILED, ES_LIST_VIEW_COLUMNS);
|
||||
} else if (instance->viewSettings.viewType == VIEW_THUMBNAILS) {
|
||||
EsListViewChangeStyles(instance->list, &styleFolderViewTiled, &styleFolderItemThumbnail, nullptr, nullptr, ES_LIST_VIEW_TILED, ES_LIST_VIEW_COLUMNS);
|
||||
EsListViewChangeStyles(instance->list, EsStyleIntern(&styleFolderViewTiled), EsStyleIntern(&styleFolderItemThumbnail), 0, 0, ES_LIST_VIEW_TILED, ES_LIST_VIEW_COLUMNS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1134,7 +1134,7 @@ void InstanceCreateUI(Instance *instance) {
|
|||
// Places:
|
||||
|
||||
instance->placesView = EsListViewCreate(splitter, ES_CELL_EXPAND | ES_CELL_COLLAPSABLE | ES_LIST_VIEW_SINGLE_SELECT | ES_CELL_V_FILL,
|
||||
&stylePlacesView, ES_STYLE_LIST_ITEM, ES_STYLE_LIST_ITEM, nullptr);
|
||||
EsStyleIntern(&stylePlacesView), ES_STYLE_LIST_ITEM, ES_STYLE_LIST_ITEM, 0);
|
||||
instance->placesView->accessKey = 'P';
|
||||
instance->placesView->messageUser = PlacesViewCallback;
|
||||
EsListViewInsertGroup(instance->placesView, PLACES_VIEW_GROUP_BOOKMARKS, ES_LIST_VIEW_GROUP_HAS_HEADER | ES_LIST_VIEW_GROUP_INDENT);
|
||||
|
@ -1144,7 +1144,7 @@ void InstanceCreateUI(Instance *instance) {
|
|||
|
||||
// Main list:
|
||||
|
||||
instance->list = EsListViewCreate(splitter, ES_CELL_FILL | ES_LIST_VIEW_COLUMNS | ES_LIST_VIEW_MULTI_SELECT, &styleFolderView);
|
||||
instance->list = EsListViewCreate(splitter, ES_CELL_FILL | ES_LIST_VIEW_COLUMNS | ES_LIST_VIEW_MULTI_SELECT, EsStyleIntern(&styleFolderView));
|
||||
instance->list->accessKey = 'L';
|
||||
instance->list->messageUser = ListCallback;
|
||||
EsListViewRegisterColumn(instance->list, COLUMN_NAME, INTERFACE_STRING(FileManagerColumnName), ES_LIST_VIEW_COLUMN_HAS_MENU);
|
||||
|
|
|
@ -153,12 +153,12 @@ int FontListMessage(EsElement *element, EsMessage *message) {
|
|||
Instance *instance = element->instance;
|
||||
|
||||
if (message->type == ES_MSG_LIST_VIEW_CREATE_ITEM) {
|
||||
EsPanel *panel = EsPanelCreate(message->createItem.item, ES_CELL_FILL, &styleFontInformationPanel);
|
||||
EsPanel *panel = EsPanelCreate(message->createItem.item, ES_CELL_FILL, EsStyleIntern(&styleFontInformationPanel));
|
||||
EsFontInformation *font = &instance->fonts[message->createItem.index];
|
||||
|
||||
EsPanel *row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &styleFontInformationRow);
|
||||
EsPanel *row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleFontInformationRow));
|
||||
// EsIconDisplayCreate(row, ES_FLAGS_DEFAULT, ES_STYLE_ICON_DISPLAY_SMALL, ES_ICON_FONT_X_GENERIC);
|
||||
EsTextDisplayCreate(row, ES_FLAGS_DEFAULT, &styleFontName, font->name, font->nameBytes);
|
||||
EsTextDisplayCreate(row, ES_FLAGS_DEFAULT, EsStyleIntern(&styleFontName), font->name, font->nameBytes);
|
||||
EsSpacerCreate(row, ES_CELL_H_FILL, ES_STYLE_SEPARATOR_HORIZONTAL);
|
||||
|
||||
EsElement *preview = EsCustomElementCreate(panel, ES_CELL_FILL, ES_STYLE_TEXT_PARAGRAPH);
|
||||
|
@ -172,7 +172,7 @@ int FontListMessage(EsElement *element, EsMessage *message) {
|
|||
if (font->availableWeightsItalic & (1 << i)) variants++;
|
||||
}
|
||||
|
||||
row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &styleFontInformationRow);
|
||||
row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleFontInformationRow));
|
||||
|
||||
char description[256]; // TODO Localization.
|
||||
size_t descriptionBytes = EsStringFormat(description, sizeof(description), "%s " HYPHENATION_POINT " %d variant%z",
|
||||
|
@ -316,7 +316,7 @@ int InstanceCallback(Instance *instance, EsMessage *message) {
|
|||
|
||||
EsElementDestroyContents(instance->fontPreview);
|
||||
|
||||
EsPanel *titleRow = EsPanelCreate(instance->fontPreview, ES_CELL_H_CENTER | ES_PANEL_HORIZONTAL, &styleFontInformationRow);
|
||||
EsPanel *titleRow = EsPanelCreate(instance->fontPreview, ES_CELL_H_CENTER | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleFontInformationRow));
|
||||
EsIconDisplayCreate(titleRow, ES_FLAGS_DEFAULT, ES_STYLE_ICON_DISPLAY, ES_ICON_FONT_X_GENERIC);
|
||||
EsTextDisplayCreate(titleRow, ES_FLAGS_DEFAULT, ES_STYLE_TEXT_HEADING0, message->instanceOpen.nameOrPath, message->instanceOpen.nameOrPathBytes);
|
||||
EsSpacerCreate(instance->fontPreview, ES_FLAGS_DEFAULT, 0, 0, 20);
|
||||
|
@ -324,7 +324,7 @@ int InstanceCallback(Instance *instance, EsMessage *message) {
|
|||
int sizes[] = { 12, 18, 24, 36, 48, 60, 72, 0 };
|
||||
|
||||
for (uintptr_t i = 0; sizes[i]; i++) {
|
||||
EsPanel *row = EsPanelCreate(instance->fontPreview, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &styleFontInformationRow);
|
||||
EsPanel *row = EsPanelCreate(instance->fontPreview, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleFontInformationRow));
|
||||
char buffer[64];
|
||||
EsTextDisplayCreate(row, ES_FLAGS_DEFAULT, 0, buffer, EsStringFormat(buffer, sizeof(buffer), "%d", sizes[i]));
|
||||
EsTextDisplay *display = EsTextDisplayCreate(row, ES_TEXT_DISPLAY_NO_FONT_SUBSTITUTION);
|
||||
|
@ -376,7 +376,7 @@ void _start() {
|
|||
// Font list page:
|
||||
|
||||
uint64_t flags = ES_CELL_FILL | ES_LIST_VIEW_TILED | ES_LIST_VIEW_CENTER_TILES;
|
||||
EsListView *fontList = EsListViewCreate(instance->switcher, flags, &styleFontList, &styleFontItem);
|
||||
EsListView *fontList = EsListViewCreate(instance->switcher, flags, EsStyleIntern(&styleFontList), EsStyleIntern(&styleFontItem));
|
||||
EsListViewSetMaximumItemsPerBand(fontList, 4);
|
||||
EsListViewInsertGroup(fontList, 0);
|
||||
instance->fontList = fontList;
|
||||
|
@ -388,7 +388,7 @@ void _start() {
|
|||
|
||||
// Font preview page:
|
||||
|
||||
instance->fontPreview = EsPanelCreate(instance->switcher, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, &styleFontPreviewPage);
|
||||
instance->fontPreview = EsPanelCreate(instance->switcher, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&styleFontPreviewPage));
|
||||
|
||||
// Font list toolbar:
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ void MenuImage(Instance *instance, EsElement *element, EsCommand *) {
|
|||
EsMenu *menu = EsMenuCreate(element);
|
||||
|
||||
EsMenuAddItem(menu, ES_MENU_ITEM_HEADER, INTERFACE_STRING(ImageEditorCanvasSize));
|
||||
EsPanel *table = EsPanelCreate(menu, ES_PANEL_HORIZONTAL | ES_PANEL_TABLE, &styleImageMenuTable);
|
||||
EsPanel *table = EsPanelCreate(menu, ES_PANEL_HORIZONTAL | ES_PANEL_TABLE, EsStyleIntern(&styleImageMenuTable));
|
||||
EsPanelSetBands(table, 2, 2);
|
||||
|
||||
char buffer[64];
|
||||
|
|
|
@ -304,15 +304,15 @@ void _start() {
|
|||
EsElement *toolbar = EsWindowGetToolbar(window);
|
||||
EsPanel *section = EsPanelCreate(toolbar, ES_PANEL_HORIZONTAL);
|
||||
EsTextDisplayCreate(section, ES_FLAGS_DEFAULT, 0, EsLiteral("Nick:"));
|
||||
instance->textboxNick = EsTextboxCreate(section, ES_FLAGS_DEFAULT, &styleSmallTextbox);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
instance->textboxNick = EsTextboxCreate(section, ES_FLAGS_DEFAULT, EsStyleIntern(&styleSmallTextbox));
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
section = EsPanelCreate(toolbar, ES_PANEL_HORIZONTAL);
|
||||
EsTextDisplayCreate(section, ES_FLAGS_DEFAULT, 0, EsLiteral("Address:"));
|
||||
instance->textboxAddress = EsTextboxCreate(section, ES_FLAGS_DEFAULT, &styleSmallTextbox);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
instance->textboxAddress = EsTextboxCreate(section, ES_FLAGS_DEFAULT, EsStyleIntern(&styleSmallTextbox));
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
section = EsPanelCreate(toolbar, ES_PANEL_HORIZONTAL);
|
||||
EsTextDisplayCreate(section, ES_FLAGS_DEFAULT, 0, EsLiteral("Port:"));
|
||||
instance->textboxPort = EsTextboxCreate(section, ES_FLAGS_DEFAULT, &styleSmallTextbox);
|
||||
instance->textboxPort = EsTextboxCreate(section, ES_FLAGS_DEFAULT, EsStyleIntern(&styleSmallTextbox));
|
||||
EsSpacerCreate(toolbar, ES_CELL_H_FILL);
|
||||
instance->buttonConnect = EsButtonCreate(toolbar, ES_FLAGS_DEFAULT, 0, EsLiteral("Connect"));
|
||||
EsButtonOnCommand(instance->buttonConnect, ConnectCommand);
|
||||
|
@ -320,10 +320,10 @@ void _start() {
|
|||
// Create the main area.
|
||||
|
||||
EsPanel *panel = EsPanelCreate(window, ES_PANEL_VERTICAL | ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_DIVIDER);
|
||||
instance->textboxOutput = EsTextboxCreate(panel, ES_CELL_FILL | ES_TEXTBOX_MULTILINE, &styleOutputTextbox);
|
||||
instance->textboxOutput = EsTextboxCreate(panel, ES_CELL_FILL | ES_TEXTBOX_MULTILINE, EsStyleIntern(&styleOutputTextbox));
|
||||
EsPanelCreate(panel, ES_CELL_H_FILL, ES_STYLE_SEPARATOR_HORIZONTAL);
|
||||
EsPanel *inputArea = EsPanelCreate(panel, ES_PANEL_HORIZONTAL | ES_CELL_H_FILL, ES_STYLE_PANEL_FILLED);
|
||||
instance->textboxInput = EsTextboxCreate(inputArea, ES_CELL_FILL, &styleInputTextbox);
|
||||
instance->textboxInput = EsTextboxCreate(inputArea, ES_CELL_FILL, EsStyleIntern(&styleInputTextbox));
|
||||
instance->textboxInput->messageUser = TextboxInputCallback;
|
||||
EsElementSetDisabled(instance->textboxInput);
|
||||
}
|
||||
|
|
|
@ -236,12 +236,12 @@ const char *textTypes[] = {
|
|||
void AddPadding(Instance *instance, int32_t before, int32_t after) {
|
||||
if (instance->inListDepth) return;
|
||||
if (before < instance->paddingBefore) before = instance->paddingBefore;
|
||||
EsSpacerCreate(instance->active, ES_FLAGS_DEFAULT, nullptr, 0, before);
|
||||
EsSpacerCreate(instance->active, ES_FLAGS_DEFAULT, 0, 0, before);
|
||||
instance->paddingBefore = after;
|
||||
}
|
||||
|
||||
void CreateStyledTextDisplay(Instance *instance, EsStyle *style, uint64_t flags = ES_CELL_H_FILL) {
|
||||
EsTextDisplay *display = EsTextDisplayCreate(instance->active, flags, style);
|
||||
void CreateStyledTextDisplay(Instance *instance, const EsStyle *style, uint64_t flags = ES_CELL_H_FILL) {
|
||||
EsTextDisplay *display = EsTextDisplayCreate(instance->active, flags, EsStyleIntern(style));
|
||||
EsTextRun *runs = (EsTextRun *) EsHeapAllocate(sizeof(EsTextRun) * (instance->spans.Length() + 1), false);
|
||||
|
||||
for (uintptr_t i = 0; i < instance->spans.Length(); i++) {
|
||||
|
@ -296,14 +296,14 @@ int ParserEnterBlock(MD_BLOCKTYPE type, void *detail, void *_instance) {
|
|||
EsListDisplaySetCounterStart(display, ((MD_BLOCK_OL_DETAIL *) detail)->start - 1);
|
||||
} else if (type == MD_BLOCK_QUOTE) {
|
||||
AddPadding(instance, QUOTE_PADDING_BEFORE, QUOTE_PADDING_AFTER);
|
||||
instance->active = EsPanelCreate(instance->active, ES_CELL_H_FILL, &styleQuote);
|
||||
instance->active = EsPanelCreate(instance->active, ES_CELL_H_FILL, EsStyleIntern(&styleQuote));
|
||||
instance->inBlockQuote = true;
|
||||
} else if (type == MD_BLOCK_LI) {
|
||||
instance->active = EsPanelCreate(instance->active, ES_CELL_H_FILL, &styleList);
|
||||
instance->active = EsPanelCreate(instance->active, ES_CELL_H_FILL, EsStyleIntern(&styleList));
|
||||
instance->inListDepth++;
|
||||
} else if (type == MD_BLOCK_TABLE) {
|
||||
AddPadding(instance, TABLE_PADDING_BEFORE, TABLE_PADDING_AFTER);
|
||||
EsPanel *table = EsPanelCreate(instance->active, ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_CELL_H_SHRINK, &styleTable);
|
||||
EsPanel *table = EsPanelCreate(instance->active, ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_CELL_H_SHRINK, EsStyleIntern(&styleTable));
|
||||
instance->active = table;
|
||||
instance->tableColumnCount = 0;
|
||||
}
|
||||
|
@ -348,14 +348,14 @@ int ParserLeaveBlock(MD_BLOCKTYPE type, void *detail, void *_instance) {
|
|||
CreateStyledTextDisplay(instance, level == 1 ? &styleHeading1 : level == 2 ? &styleHeading2 : &styleHeading3);
|
||||
|
||||
if (level <= 2) {
|
||||
EsSpacerCreate(instance->active, ES_FLAGS_DEFAULT, nullptr, 0, HEADING_UNDERLINE_GAP);
|
||||
EsSpacerCreate(instance->active, ES_CELL_H_FILL, &styleHeadingUnderline, 0, 0);
|
||||
EsSpacerCreate(instance->active, ES_FLAGS_DEFAULT, 0, 0, HEADING_UNDERLINE_GAP);
|
||||
EsSpacerCreate(instance->active, ES_CELL_H_FILL, EsStyleIntern(&styleHeadingUnderline), 0, 0);
|
||||
}
|
||||
} else if (type == MD_BLOCK_CODE) {
|
||||
MD_BLOCK_CODE_DETAIL *code = (MD_BLOCK_CODE_DETAIL *) detail;
|
||||
AddPadding(instance, PARAGRAPH_PADDING_BEFORE, PARAGRAPH_PADDING_AFTER);
|
||||
EsElement *wrapper = EsPanelCreate(instance->active, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL | ES_PANEL_H_SCROLL_AUTO, &styleCodeBlock);
|
||||
EsTextDisplay *display = EsTextDisplayCreate(wrapper, ES_TEXT_DISPLAY_PREFORMATTED, &styleCode, instance->text.array, instance->text.Length());
|
||||
EsElement *wrapper = EsPanelCreate(instance->active, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleCodeBlock));
|
||||
EsTextDisplay *display = EsTextDisplayCreate(wrapper, ES_TEXT_DISPLAY_PREFORMATTED, EsStyleIntern(&styleCode), instance->text.array, instance->text.Length());
|
||||
|
||||
if (0 == EsStringCompare(code->lang.text, code->lang.size, EsLiteral("ini"))) {
|
||||
EsTextDisplaySetupSyntaxHighlighting(display, ES_SYNTAX_HIGHLIGHTING_LANGUAGE_INI);
|
||||
|
@ -369,7 +369,7 @@ int ParserLeaveBlock(MD_BLOCKTYPE type, void *detail, void *_instance) {
|
|||
instance->inBlockQuote = false;
|
||||
} else if (type == MD_BLOCK_HR) {
|
||||
AddPadding(instance, HR_PADDING_BEFORE, HR_PADDING_AFTER);
|
||||
EsSpacerCreate(instance->active, ES_CELL_H_FILL, &styleHorizontalRule, 0, 0);
|
||||
EsSpacerCreate(instance->active, ES_CELL_H_FILL, EsStyleIntern(&styleHorizontalRule), 0, 0);
|
||||
} else if (type == MD_BLOCK_TABLE) {
|
||||
EsPanel *panel = (EsPanel *) instance->active;
|
||||
|
||||
|
@ -491,8 +491,8 @@ void ProcessApplicationMessage(EsMessage *message) {
|
|||
EsInstanceSetClassViewer(instance, nullptr);
|
||||
EsWindow *window = instance->window;
|
||||
EsPanel *wrapper = EsPanelCreate(instance->window, ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_DIVIDER);
|
||||
EsPanel *background = EsPanelCreate(wrapper, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, &styleBackground);
|
||||
instance->root = EsPanelCreate(background, ES_CELL_H_SHRINK, &styleRoot);
|
||||
EsPanel *background = EsPanelCreate(wrapper, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&styleBackground));
|
||||
instance->root = EsPanelCreate(background, ES_CELL_H_SHRINK, EsStyleIntern(&styleRoot));
|
||||
EsWindowSetIcon(window, ES_ICON_TEXT_MARKDOWN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,11 +189,11 @@ void MessageLoopThread(EsGeneric) {
|
|||
EsWindow *window = instance->window;
|
||||
EsWindowSetIcon(window, ES_ICON_UTILITIES_TERMINAL);
|
||||
EsPanel *panel = EsPanelCreate(window, ES_PANEL_VERTICAL | ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_BACKGROUND);
|
||||
textboxOutput = EsTextboxCreate(panel, ES_TEXTBOX_MULTILINE | ES_CELL_FILL, &styleOutputTextbox);
|
||||
textboxOutput = EsTextboxCreate(panel, ES_TEXTBOX_MULTILINE | ES_CELL_FILL, EsStyleIntern(&styleOutputTextbox));
|
||||
EsSpacerCreate(panel, ES_CELL_H_FILL, ES_STYLE_SEPARATOR_HORIZONTAL);
|
||||
EsPanel *row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &styleInputRow);
|
||||
EsPanel *row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleInputRow));
|
||||
EsTextDisplayCreate(row, ES_FLAGS_DEFAULT, ES_STYLE_TEXT_LABEL, EsLiteral("Input:"));
|
||||
textboxInput = EsTextboxCreate(row, ES_CELL_H_FILL, &styleInputTextbox);
|
||||
textboxInput = EsTextboxCreate(row, ES_CELL_H_FILL, EsStyleIntern(&styleInputTextbox));
|
||||
EsTextboxEnableSmartReplacement(textboxInput, false);
|
||||
EsTextboxSetReadOnly(textboxOutput, true);
|
||||
textboxInput->messageUser = ProcessTextboxInputMessage;
|
||||
|
|
|
@ -650,19 +650,19 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
|
||||
if (type->type == T_INT) {
|
||||
char *buffer = EsStringAllocateAndFormat(&bytes, "%d", value.i);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputData, buffer, bytes);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputData), buffer, bytes);
|
||||
EsHeapFree(buffer);
|
||||
} else if (type->type == T_BOOL) {
|
||||
char *buffer = EsStringAllocateAndFormat(&bytes, "%z", value.i ? "true" : "false");
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputData, buffer, bytes);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputData), buffer, bytes);
|
||||
EsHeapFree(buffer);
|
||||
} else if (type->type == T_NULL) {
|
||||
char *buffer = EsStringAllocateAndFormat(&bytes, "%z", "null");
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputData, buffer, bytes);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputData), buffer, bytes);
|
||||
EsHeapFree(buffer);
|
||||
} else if (type->type == T_FLOAT) {
|
||||
char *buffer = EsStringAllocateAndFormat(&bytes, "%F", value.f);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputData, buffer, bytes);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputData), buffer, bytes);
|
||||
EsHeapFree(buffer);
|
||||
} else if (type->type == T_STR) {
|
||||
EsAssert(context->heapEntriesAllocated > (uint64_t) value.i);
|
||||
|
@ -680,10 +680,10 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
EsImageDisplayLoadFromMemory(display, valueText, valueBytes);
|
||||
} else if (EsUTF8IsValid(valueText, valueBytes)) {
|
||||
char *buffer = EsStringAllocateAndFormat(&bytes, "\u201C%s\u201D", valueBytes, valueText);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputData, buffer, bytes);
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputData), buffer, bytes);
|
||||
EsHeapFree(buffer);
|
||||
} else {
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputParagraphItalic, EsLiteral("Binary data string.\n"));
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraphItalic), EsLiteral("Binary data string.\n"));
|
||||
}
|
||||
} else if (type->type == T_LIST && type->firstChild->type == T_STRUCT) {
|
||||
EsAssert(context->heapEntriesAllocated > (uint64_t) value.i);
|
||||
|
@ -693,7 +693,7 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
EsAssert(context->heapEntriesAllocated > (uint64_t) listEntry->list[0].i);
|
||||
EsAssert(context->heap[listEntry->list[0].i].type == T_STRUCT);
|
||||
|
||||
EsPanel *table = EsPanelCreate(parent, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL | ES_PANEL_TABLE | ES_PANEL_H_SCROLL_AUTO, &styleTable);
|
||||
EsPanel *table = EsPanelCreate(parent, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL | ES_PANEL_TABLE | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleTable));
|
||||
EsPanelSetBands(table, context->heap[listEntry->list[0].i].fieldCount);
|
||||
EsPanelTableAddBandDecorator(table, { .index = 0, .repeatEvery = 0, .axis = 1, .appearance = &styleAppearanceRowHeader });
|
||||
EsPanelTableAddBandDecorator(table, { .index = 1, .repeatEvery = 2, .axis = 1, .appearance = &styleAppearanceRowEven });
|
||||
|
@ -704,7 +704,7 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
|
||||
while (field) {
|
||||
EsTextDisplayCreate(table, ES_CELL_H_CENTER | ES_CELL_V_CENTER,
|
||||
&styleRowHeaderText, field->token.text, field->token.textBytes);
|
||||
EsStyleIntern(&styleRowHeaderText), field->token.text, field->token.textBytes);
|
||||
field = field->sibling;
|
||||
}
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
|
||||
while (field) {
|
||||
EsAssert(j != itemEntry->fieldCount);
|
||||
AddREPLResult(context, EsPanelCreate(table, ES_CELL_H_CENTER | ES_CELL_V_TOP, &styleTableCell),
|
||||
AddREPLResult(context, EsPanelCreate(table, ES_CELL_H_CENTER | ES_CELL_V_TOP, EsStyleIntern(&styleTableCell)),
|
||||
field->firstChild, itemEntry->fields[j]);
|
||||
field = field->sibling;
|
||||
j++;
|
||||
|
@ -727,18 +727,18 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
}
|
||||
} else if (type->type == T_LIST) {
|
||||
normalList:;
|
||||
EsPanel *panel = EsPanelCreate(parent, ES_CELL_H_FILL | ES_PANEL_VERTICAL | ES_PANEL_STACK, &styleList);
|
||||
EsPanel *panel = EsPanelCreate(parent, ES_CELL_H_FILL | ES_PANEL_VERTICAL | ES_PANEL_STACK, EsStyleIntern(&styleList));
|
||||
EsAssert(context->heapEntriesAllocated > (uint64_t) value.i);
|
||||
HeapEntry *entry = &context->heap[value.i];
|
||||
EsAssert(entry->type == T_LIST);
|
||||
|
||||
if (!entry->length) {
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputParagraphItalic,
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraphItalic),
|
||||
EsLiteral("Empty list.\n"));
|
||||
}
|
||||
|
||||
for (uintptr_t i = 0; i < entry->length; i++) {
|
||||
EsPanel *item = EsPanelCreate(panel, ES_CELL_H_FILL, (i % 2) ? &styleListRowOdd : &styleListRowEven);
|
||||
EsPanel *item = EsPanelCreate(panel, ES_CELL_H_FILL, EsStyleIntern((i % 2) ? &styleListRowOdd : &styleListRowEven));
|
||||
AddREPLResult(context, item, type->firstChild, entry->list[i]);
|
||||
}
|
||||
} else if (type->type == T_STRUCT) {
|
||||
|
@ -752,16 +752,16 @@ void AddREPLResult(ExecutionContext *context, EsElement *parent, Node *type, Val
|
|||
|
||||
while (field) {
|
||||
EsAssert(i != entry->fieldCount);
|
||||
EsPanel *item = EsPanelCreate(panel, ES_CELL_H_FILL, (i % 2) ? &styleListRowOdd : &styleListRowEven);
|
||||
EsPanel *item = EsPanelCreate(panel, ES_CELL_H_FILL, EsStyleIntern((i % 2) ? &styleListRowOdd : &styleListRowEven));
|
||||
AddREPLResult(context, item, field->firstChild, entry->fields[i]);
|
||||
field = field->sibling;
|
||||
i++;
|
||||
}
|
||||
} else if (type->type == T_FUNCPTR) {
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputParagraphItalic,
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraphItalic),
|
||||
EsLiteral("Function pointer.\n"));
|
||||
} else {
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, &styleOutputParagraphItalic,
|
||||
EsTextDisplayCreate(parent, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraphItalic),
|
||||
EsLiteral("The type of the result was not recognized.\n"));
|
||||
}
|
||||
}
|
||||
|
@ -812,12 +812,12 @@ void ScriptThread(EsGeneric _instance) {
|
|||
instance->gotREPLResult = false;
|
||||
|
||||
if (result == 0) {
|
||||
EsSpacerChangeStyle(instance->outputDecoration, &styleOutputDecorationSuccess);
|
||||
EsSpacerChangeStyle(instance->outputDecoration, EsStyleIntern(&styleOutputDecorationSuccess));
|
||||
} else {
|
||||
EsSpacerChangeStyle(instance->outputDecoration, &styleOutputDecorationFailure);
|
||||
EsSpacerChangeStyle(instance->outputDecoration, EsStyleIntern(&styleOutputDecorationFailure));
|
||||
}
|
||||
|
||||
instance->outputElements.Add(EsSpacerCreate(instance->root, ES_CELL_H_FILL, &styleInterCommandSpacer));
|
||||
instance->outputElements.Add(EsSpacerCreate(instance->root, ES_CELL_H_FILL, EsStyleIntern(&styleInterCommandSpacer)));
|
||||
AddPrompt(instance);
|
||||
|
||||
EsMessageMutexRelease();
|
||||
|
@ -835,16 +835,16 @@ void EnterCommand(Instance *instance) {
|
|||
instance->inputRow = nullptr;
|
||||
instance->defaultPrefixDisplay = nullptr;
|
||||
|
||||
EsPanel *commandLogRow = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, &styleInputRow);
|
||||
EsTextDisplayCreate(commandLogRow, ES_FLAGS_DEFAULT, &stylePromptText, "\u2661");
|
||||
EsTextDisplayCreate(commandLogRow, ES_CELL_H_FILL, &styleCommandLogText, data, dataBytes);
|
||||
EsPanel *commandLogRow = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleInputRow));
|
||||
EsTextDisplayCreate(commandLogRow, ES_FLAGS_DEFAULT, EsStyleIntern(&stylePromptText), "\u2661");
|
||||
EsTextDisplayCreate(commandLogRow, ES_CELL_H_FILL, EsStyleIntern(&styleCommandLogText), data, dataBytes);
|
||||
instance->outputElements.Add(commandLogRow);
|
||||
|
||||
EsAssert(!instance->outputPanel);
|
||||
EsAssert(!instance->outputDecoration);
|
||||
EsPanel *outputPanelWrapper = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, &styleOutputPanelWrapper);
|
||||
instance->outputDecoration = EsSpacerCreate(outputPanelWrapper, ES_CELL_V_FILL, &styleOutputDecorationInProgress);
|
||||
instance->outputPanel = EsPanelCreate(outputPanelWrapper, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_VERTICAL, &styleOutputPanel);
|
||||
EsPanel *outputPanelWrapper = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleOutputPanelWrapper));
|
||||
instance->outputDecoration = EsSpacerCreate(outputPanelWrapper, ES_CELL_V_FILL, EsStyleIntern(&styleOutputDecorationInProgress));
|
||||
instance->outputPanel = EsPanelCreate(outputPanelWrapper, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_VERTICAL, EsStyleIntern(&styleOutputPanel));
|
||||
|
||||
instance->inputText = data;
|
||||
instance->inputBytes = dataBytes;
|
||||
|
@ -870,12 +870,12 @@ void AddOutput(Instance *instance, const char *text, size_t textBytes) {
|
|||
if (text[i] == '\n') {
|
||||
if (EsUTF8IsValid(instance->outputLineBuffer, instance->outputLineBufferBytes)) {
|
||||
EsMessageMutexAcquire();
|
||||
EsTextDisplayCreate(instance->outputPanel, ES_CELL_H_FILL, &styleOutputParagraph,
|
||||
EsTextDisplayCreate(instance->outputPanel, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraph),
|
||||
instance->outputLineBuffer, instance->outputLineBufferBytes);
|
||||
EsMessageMutexRelease();
|
||||
} else {
|
||||
EsMessageMutexAcquire();
|
||||
EsTextDisplayCreate(instance->outputPanel, ES_CELL_H_FILL, &styleOutputParagraphItalic,
|
||||
EsTextDisplayCreate(instance->outputPanel, ES_CELL_H_FILL, EsStyleIntern(&styleOutputParagraphItalic),
|
||||
EsLiteral("Encoding error.\n"));
|
||||
EsMessageMutexRelease();
|
||||
}
|
||||
|
@ -903,10 +903,10 @@ void AddPrompt(Instance *instance) {
|
|||
instance->outputPanel = nullptr;
|
||||
instance->outputDecoration = nullptr;
|
||||
|
||||
instance->defaultPrefixDisplay = EsTextDisplayCreate(instance->root, ES_CELL_H_FILL, &stylePathDefaultPrefixDisplay, "Essence HD (0:)");
|
||||
instance->inputRow = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, &styleInputRow);
|
||||
EsTextDisplayCreate(instance->inputRow, ES_FLAGS_DEFAULT, &stylePromptText, "\u2665");
|
||||
instance->inputTextbox = EsTextboxCreate(instance->inputRow, ES_CELL_H_FILL, &styleInputTextbox);
|
||||
instance->defaultPrefixDisplay = EsTextDisplayCreate(instance->root, ES_CELL_H_FILL, EsStyleIntern(&stylePathDefaultPrefixDisplay), "Essence HD (0:)");
|
||||
instance->inputRow = EsPanelCreate(instance->root, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleInputRow));
|
||||
EsTextDisplayCreate(instance->inputRow, ES_FLAGS_DEFAULT, EsStyleIntern(&stylePromptText), "\u2665");
|
||||
instance->inputTextbox = EsTextboxCreate(instance->inputRow, ES_CELL_H_FILL, EsStyleIntern(&styleInputTextbox));
|
||||
EsTextboxEnableSmartReplacement(instance->inputTextbox, false);
|
||||
instance->inputTextbox->messageUser = InputTextboxMessage;
|
||||
EsElementFocus(instance->inputTextbox, ES_ELEMENT_FOCUS_ENSURE_VISIBLE);
|
||||
|
@ -956,12 +956,12 @@ void _start() {
|
|||
1 /* stableID */, "Ctrl+Shift+L", true /* enabled */);
|
||||
EsWindowSetIcon(instance->window, ES_ICON_UTILITIES_TERMINAL);
|
||||
EsPanel *wrapper = EsPanelCreate(instance->window, ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_DIVIDER);
|
||||
EsPanel *background = EsPanelCreate(wrapper, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, &styleBackground);
|
||||
instance->root = EsPanelCreate(background, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_VERTICAL, &styleRoot);
|
||||
EsPanel *background = EsPanelCreate(wrapper, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&styleBackground));
|
||||
instance->root = EsPanelCreate(background, ES_CELL_H_FILL | ES_PANEL_STACK | ES_PANEL_VERTICAL, EsStyleIntern(&styleRoot));
|
||||
AddPrompt(instance);
|
||||
EsElement *toolbar = EsWindowGetToolbar(instance->window);
|
||||
EsCommandAddButton(&instance->commandClearOutput,
|
||||
EsButtonCreate(toolbar, ES_FLAGS_DEFAULT, ES_NULL, EsLiteral("Clear output")));
|
||||
EsButtonCreate(toolbar, ES_FLAGS_DEFAULT, 0, EsLiteral("Clear output")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ void UpdateDisplay(Instance *instance, int index) {
|
|||
EsPanelSwitchTo(instance->switcher, instance->panelMemoryStatistics, ES_TRANSITION_NONE);
|
||||
|
||||
if (!instance->textDisplaysMemory.Length()) {
|
||||
EsPanel *panel = EsPanelCreate(instance->panelMemoryStatistics, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &stylePanelMemoryCommands);
|
||||
EsPanel *panel = EsPanelCreate(instance->panelMemoryStatistics, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&stylePanelMemoryCommands));
|
||||
EsButton *button;
|
||||
|
||||
button = EsButtonCreate(panel, ES_FLAGS_DEFAULT, 0, EsLiteral("Leak 1 MB"));
|
||||
|
@ -383,7 +383,7 @@ void ProcessApplicationMessage(EsMessage *message) {
|
|||
EsPanel *switcher = EsPanelCreate(window, ES_CELL_FILL | ES_PANEL_SWITCHER, ES_STYLE_PANEL_WINDOW_DIVIDER);
|
||||
instance->switcher = switcher;
|
||||
|
||||
instance->textboxGeneralLog = EsTextboxCreate(switcher, ES_TEXTBOX_MULTILINE | ES_CELL_FILL | ES_ELEMENT_DISABLED, &styleMonospacedTextbox);
|
||||
instance->textboxGeneralLog = EsTextboxCreate(switcher, ES_TEXTBOX_MULTILINE | ES_CELL_FILL | ES_ELEMENT_DISABLED, EsStyleIntern(&styleMonospacedTextbox));
|
||||
|
||||
instance->listViewProcesses = EsListViewCreate(switcher, ES_CELL_FILL | ES_LIST_VIEW_COLUMNS | ES_LIST_VIEW_SINGLE_SELECT | ES_LIST_VIEW_FIXED_ITEMS);
|
||||
instance->listViewProcesses->messageUser = ListViewProcessesCallback;
|
||||
|
@ -398,7 +398,7 @@ void ProcessApplicationMessage(EsMessage *message) {
|
|||
EsListViewAddAllColumns(instance->listViewProcesses);
|
||||
|
||||
instance->panelMemoryStatistics = EsPanelCreate(switcher,
|
||||
ES_CELL_FILL | ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_PANEL_V_SCROLL_AUTO, &stylePanelMemoryStatistics);
|
||||
ES_CELL_FILL | ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&stylePanelMemoryStatistics));
|
||||
EsPanelSetBands(instance->panelMemoryStatistics, 2 /* columns */);
|
||||
|
||||
EsElement *toolbar = EsWindowGetToolbar(window);
|
||||
|
|
|
@ -131,7 +131,7 @@ void FormatPopupCreate(Instance *instance) {
|
|||
EsPanel *panel = EsPanelCreate(menu, ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_POPUP);
|
||||
|
||||
{
|
||||
EsPanel *column = EsPanelCreate(panel, ES_FLAGS_DEFAULT, &styleFormatPopupColumn);
|
||||
EsPanel *column = EsPanelCreate(panel, ES_FLAGS_DEFAULT, EsStyleIntern(&styleFormatPopupColumn));
|
||||
EsTextDisplayCreate(column, ES_CELL_H_EXPAND, ES_STYLE_TEXT_LABEL, INTERFACE_STRING(CommonFormatSize));
|
||||
EsListView *list = EsListViewCreate(column, ES_LIST_VIEW_CHOICE_SELECT | ES_LIST_VIEW_FIXED_ITEMS, ES_STYLE_LIST_CHOICE_BORDERED);
|
||||
|
||||
|
@ -174,7 +174,7 @@ void FormatPopupCreate(Instance *instance) {
|
|||
}
|
||||
|
||||
{
|
||||
EsPanel *column = EsPanelCreate(panel, ES_FLAGS_DEFAULT, &styleFormatPopupColumn);
|
||||
EsPanel *column = EsPanelCreate(panel, ES_FLAGS_DEFAULT, EsStyleIntern(&styleFormatPopupColumn));
|
||||
EsTextDisplayCreate(column, ES_CELL_H_EXPAND, ES_STYLE_TEXT_LABEL, INTERFACE_STRING(CommonFormatLanguage));
|
||||
EsListView *list = EsListViewCreate(column, ES_LIST_VIEW_CHOICE_SELECT | ES_LIST_VIEW_FIXED_ITEMS, ES_STYLE_LIST_CHOICE_BORDERED);
|
||||
EsListViewFixedItemSetString(list, EsListViewFixedItemInsert(list, 0), 0, INTERFACE_STRING(CommonFormatPlainText));
|
||||
|
|
|
@ -923,6 +923,7 @@ EsMessage *EsMessageReceive() {
|
|||
FreeUnusedStyles(true /* include permanent styles */);
|
||||
theming.loadedStyles.Free();
|
||||
SystemConfigurationUnload();
|
||||
theming.internedStyles.Free();
|
||||
api.mountPoints.Free();
|
||||
api.postBox.Free();
|
||||
api.timers.Free();
|
||||
|
|
|
@ -492,14 +492,14 @@ void DesktopInspectorThread(EsGeneric) {
|
|||
bytes = EsStringFormat(buffer, sizeof(buffer), "inst: eid %d, title '%s', pid %d, docid %d, app '%z'%z",
|
||||
instance->embeddedWindowID, instance->titleBytes, instance->title, instance->process->id,
|
||||
instance->documentID, instance->application->cName, instance->isUserTask ? ", utask" : "");
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, &styleSmallParagraph, buffer, bytes);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, EsStyleIntern(&styleSmallParagraph), buffer, bytes);
|
||||
}
|
||||
|
||||
for (uintptr_t i = 0; i < desktop.allApplicationProcesses.Length(); i++) {
|
||||
ApplicationProcess *process = desktop.allApplicationProcesses[i];
|
||||
bytes = EsStringFormat(buffer, sizeof(buffer), "proc: pid %d, app '%z', instances %d",
|
||||
process->id, process->application ? process->application->cName : "??", process->instanceCount);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, &styleSmallParagraph, buffer, bytes);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, EsStyleIntern(&styleSmallParagraph), buffer, bytes);
|
||||
}
|
||||
|
||||
for (uintptr_t i = 0; i < desktop.installedApplications.Length(); i++) {
|
||||
|
@ -509,14 +509,14 @@ void DesktopInspectorThread(EsGeneric) {
|
|||
application->useSingleInstance ? ", 1inst" : "",
|
||||
application->singleProcess ? application->singleProcess->id : 0,
|
||||
application->singleInstance ? application->singleInstance->embeddedWindowID : 0);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, &styleSmallParagraph, buffer, bytes);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, EsStyleIntern(&styleSmallParagraph), buffer, bytes);
|
||||
}
|
||||
|
||||
for (uintptr_t i = 0; i < desktop.openDocuments.Count(); i++) {
|
||||
OpenDocument *document = &desktop.openDocuments[i];
|
||||
bytes = EsStringFormat(buffer, sizeof(buffer), "doc: '%s', id %d, refs %d",
|
||||
document->pathBytes, document->path, document->id, document->referenceCount);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, &styleSmallParagraph, buffer, bytes);
|
||||
EsTextDisplayCreate(panel, ES_CELL_H_FILL, EsStyleIntern(&styleSmallParagraph), buffer, bytes);
|
||||
}
|
||||
|
||||
EsMessageMutexRelease();
|
||||
|
@ -970,7 +970,7 @@ int WindowTabMessage(EsElement *element, EsMessage *message) {
|
|||
WindowTab *WindowTabCreate(ContainerWindow *container) {
|
||||
WindowTab *tab = (WindowTab *) EsHeapAllocate(sizeof(WindowTab), true);
|
||||
tab->container = container;
|
||||
tab->Initialise(container->tabBand, ES_CELL_H_FILL | ES_CELL_V_BOTTOM, WindowTabMessage, nullptr);
|
||||
tab->Initialise(container->tabBand, ES_CELL_H_FILL | ES_CELL_V_BOTTOM, WindowTabMessage, 0);
|
||||
tab->cName = "window tab";
|
||||
container->openTabs.Add(tab);
|
||||
|
||||
|
@ -1473,12 +1473,12 @@ void InstanceBlankTabCreate(EsMessage *message) {
|
|||
EsInstance *instance = _EsInstanceCreate(sizeof(BlankTabInstance), message, nullptr);
|
||||
EsWindowSetTitle(instance->window, INTERFACE_STRING(DesktopNewTabTitle));
|
||||
EsPanel *windowBackground = EsPanelCreate(instance->window, ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_BACKGROUND);
|
||||
EsPanel *content = EsPanelCreate(windowBackground, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, &styleNewTabContent);
|
||||
EsPanel *content = EsPanelCreate(windowBackground, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&styleNewTabContent));
|
||||
EsPanel *buttonGroup;
|
||||
|
||||
// Installed applications list.
|
||||
|
||||
buttonGroup = EsPanelCreate(content, ES_PANEL_VERTICAL | ES_CELL_H_SHRINK, &styleButtonGroupContainer);
|
||||
buttonGroup = EsPanelCreate(content, ES_PANEL_VERTICAL | ES_CELL_H_SHRINK, EsStyleIntern(&styleButtonGroupContainer));
|
||||
buttonGroup->separatorStylePart = ES_STYLE_BUTTON_GROUP_SEPARATOR;
|
||||
buttonGroup->separatorFlags = ES_CELL_H_FILL;
|
||||
|
||||
|
@ -2739,7 +2739,7 @@ void DesktopSetup() {
|
|||
desktop.tasksButton = EsButtonCreate(panel, ES_ELEMENT_HIDDEN, ES_STYLE_TASK_BAR_BUTTON);
|
||||
desktop.tasksButton->messageUser = TaskBarTasksButtonMessage;
|
||||
|
||||
EsButton *clockButton = EsButtonCreate(panel, ES_BUTTON_COMPACT, &styleClockButton);
|
||||
EsButton *clockButton = EsButtonCreate(panel, ES_BUTTON_COMPACT, EsStyleIntern(&styleClockButton));
|
||||
clockButton->cName = "current time";
|
||||
EsThreadCreate(TaskBarClockUpdateThread, nullptr, clockButton);
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ void UIMouseUp(EsWindow *window, EsMessage *message, bool sendClick);
|
|||
void UIMaybeRemoveFocusedElement(EsWindow *window);
|
||||
EsTextStyle TextPlanGetPrimaryStyle(EsTextPlan *plan);
|
||||
EsElement *UIFindHoverElementRecursively(EsElement *element, int offsetX, int offsetY, EsPoint position);
|
||||
const EsStyle *UIGetDefaultStyleVariant(const EsStyle *style, EsElement *parent);
|
||||
EsStyleID UIGetDefaultStyleVariant(EsStyleID style, EsElement *parent);
|
||||
void AccessKeysCenterHint(EsElement *element, EsMessage *message);
|
||||
void UIRemoveFocusFromElement(EsElement *oldFocus);
|
||||
void UIQueueEnsureVisibleMessage(EsElement *element, bool center);
|
||||
|
@ -235,7 +235,7 @@ struct EsElement : EsElementPublic {
|
|||
bool RefreshStyleState(); // Returns true if any observed bits have changed.
|
||||
void RefreshStyle(UIStyleKey *oldStyleKey = nullptr, bool alreadyRefreshStyleState = false, bool force = false);
|
||||
bool StartAnimating();
|
||||
void SetStyle(const EsStyle *stylePart, bool refreshIfChanged = true);
|
||||
void SetStyle(EsStyleID stylePart, bool refreshIfChanged = true);
|
||||
|
||||
inline void MaybeRefreshStyle() {
|
||||
if (RefreshStyleState()) {
|
||||
|
@ -262,7 +262,7 @@ struct EsElement : EsElementPublic {
|
|||
|
||||
void Repaint(bool all, EsRectangle region = ES_RECT_1(0) /* client coordinates */);
|
||||
|
||||
void Initialise(EsElement *_parent, uint64_t _flags, EsElementCallback _classCallback, const EsStyle *style);
|
||||
void Initialise(EsElement *_parent, uint64_t _flags, EsElementCallback _classCallback, EsStyleID style);
|
||||
};
|
||||
|
||||
struct MeasurementCache {
|
||||
|
@ -375,7 +375,7 @@ struct EsPanel : EsElement {
|
|||
|
||||
ScrollPane scroll;
|
||||
|
||||
const EsStyle *separatorStylePart;
|
||||
EsStyleID separatorStylePart;
|
||||
bool addingSeparator;
|
||||
uint64_t separatorFlags;
|
||||
|
||||
|
@ -926,7 +926,7 @@ EsWindow *EsWindowCreate(EsInstance *instance, EsWindowStyle style) {
|
|||
|
||||
window->id = EsSyscall(ES_SYSCALL_WINDOW_GET_ID, window->handle, 0, 0, 0);
|
||||
window->window = window;
|
||||
window->Initialise(nullptr, ES_CELL_FILL, ProcessRootMessage, nullptr);
|
||||
window->Initialise(nullptr, ES_CELL_FILL, ProcessRootMessage, 0);
|
||||
window->cName = "window";
|
||||
window->width = window->windowWidth, window->height = window->windowHeight;
|
||||
window->hovered = window;
|
||||
|
@ -943,7 +943,7 @@ EsWindow *EsWindowCreate(EsInstance *instance, EsWindowStyle style) {
|
|||
window->mainPanel->cName = "window root";
|
||||
window->toolbarSwitcher = EsPanelCreate(window, ES_ELEMENT_NON_CLIENT | ES_PANEL_SWITCHER | ES_CELL_FILL, ES_STYLE_PANEL_TOOLBAR_ROOT);
|
||||
window->toolbarSwitcher->cName = "toolbar";
|
||||
EsElement *accessKeyLayer = EsCustomElementCreate(window, ES_ELEMENT_NON_CLIENT | ES_CELL_FILL | ES_ELEMENT_NO_HOVER, nullptr);
|
||||
EsElement *accessKeyLayer = EsCustomElementCreate(window, ES_ELEMENT_NON_CLIENT | ES_CELL_FILL | ES_ELEMENT_NO_HOVER, 0);
|
||||
accessKeyLayer->cName = "access key layer";
|
||||
accessKeyLayer->messageUser = AccessKeyLayerMessage;
|
||||
window->state |= UI_STATE_Z_STACK;
|
||||
|
@ -955,7 +955,7 @@ EsWindow *EsWindowCreate(EsInstance *instance, EsWindowStyle style) {
|
|||
EsSyscall(ES_SYSCALL_WINDOW_MOVE, window->handle, (uintptr_t) &bounds, 0, ES_WINDOW_MOVE_ADJUST_TO_FIT_SCREEN);
|
||||
} else if (style == ES_WINDOW_TIP || style == ES_WINDOW_PLAIN) {
|
||||
EsSyscall(ES_SYSCALL_WINDOW_SET_PROPERTY, window->handle, style == ES_WINDOW_PLAIN ? ES_WINDOW_SOLID_TRUE : ES_FLAGS_DEFAULT, 0, ES_WINDOW_PROPERTY_SOLID);
|
||||
window->mainPanel = EsPanelCreate(window, ES_ELEMENT_NON_CLIENT | ES_CELL_FILL, nullptr);
|
||||
window->mainPanel = EsPanelCreate(window, ES_ELEMENT_NON_CLIENT | ES_CELL_FILL, 0);
|
||||
} else if (style == ES_WINDOW_MENU) {
|
||||
window->SetStyle(ES_STYLE_MENU_ROOT);
|
||||
|
||||
|
@ -1849,7 +1849,7 @@ void EsElement::RefreshStyle(UIStyleKey *_oldStyleKey, bool alreadyRefreshStyleS
|
|||
}
|
||||
}
|
||||
|
||||
void EsElement::SetStyle(const EsStyle *part, bool refreshIfChanged) {
|
||||
void EsElement::SetStyle(EsStyleID part, bool refreshIfChanged) {
|
||||
UIStyleKey oldStyleKey = currentStyleKey;
|
||||
currentStyleKey.part = (uintptr_t) part;
|
||||
|
||||
|
@ -2762,7 +2762,7 @@ Scrollbar *ScrollbarCreate(EsElement *parent, uint64_t flags) {
|
|||
}
|
||||
|
||||
return ES_HANDLED;
|
||||
}, nullptr);
|
||||
}, 0);
|
||||
|
||||
scrollbar->cName = "scrollbar";
|
||||
|
||||
|
@ -2794,7 +2794,7 @@ Scrollbar *ScrollbarCreate(EsElement *parent, uint64_t flags) {
|
|||
}
|
||||
|
||||
return ES_HANDLED;
|
||||
}, nullptr);
|
||||
}, 0);
|
||||
|
||||
scrollbar->thumb->cName = "scrollbar thumb";
|
||||
|
||||
|
@ -3082,7 +3082,7 @@ void EsScrollViewSetFixedViewport(EsScrollView *view, int axis, int32_t value) {
|
|||
bool EsScrollViewIsBarEnabled(EsScrollView *view, int axis) { return view->scroll.enabled[axis]; }
|
||||
bool EsScrollViewIsInDragScroll(EsScrollView *view) { return view->scroll.dragScrolling; }
|
||||
|
||||
EsScrollView *EsCustomScrollViewCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsScrollView *EsCustomScrollViewCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsScrollView *element = (EsScrollView *) EsHeapAllocate(sizeof(EsScrollView), true);
|
||||
if (!element) return nullptr;
|
||||
element->Initialise(parent, flags, nullptr, style);
|
||||
|
@ -3524,7 +3524,7 @@ int ProcessPanelMessage(EsElement *element, EsMessage *message) {
|
|||
return ES_HANDLED;
|
||||
}
|
||||
|
||||
EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsPanel *panel = (EsPanel *) EsHeapAllocate(sizeof(EsPanel), true);
|
||||
if (!panel) return nullptr;
|
||||
|
||||
|
@ -3560,7 +3560,7 @@ int ProcessSpacerMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EsSpacer *EsSpacerCreate(EsElement *panel, uint64_t flags, const EsStyle *style, int width, int height) {
|
||||
EsSpacer *EsSpacerCreate(EsElement *panel, uint64_t flags, EsStyleID style, int width, int height) {
|
||||
EsSpacer *spacer = (EsSpacer *) EsHeapAllocate(sizeof(EsSpacer), true);
|
||||
if (!spacer) return nullptr;
|
||||
spacer->Initialise(panel, flags, ProcessSpacerMessage, style);
|
||||
|
@ -3570,13 +3570,13 @@ EsSpacer *EsSpacerCreate(EsElement *panel, uint64_t flags, const EsStyle *style,
|
|||
return spacer;
|
||||
}
|
||||
|
||||
void EsSpacerChangeStyle(EsSpacer *spacer, const EsStyle *style) {
|
||||
void EsSpacerChangeStyle(EsSpacer *spacer, EsStyleID 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, EsStyleID style) {
|
||||
EsElement *element = (EsElement *) EsHeapAllocate(sizeof(EsElement), true);
|
||||
if (!element) return nullptr;
|
||||
element->Initialise(parent, flags, nullptr, style);
|
||||
|
@ -3867,7 +3867,7 @@ EsDialog *EsDialogShow(EsWindow *window, const char *title, ptrdiff_t titleBytes
|
|||
return dialog;
|
||||
}
|
||||
|
||||
EsButton *EsDialogAddButton(EsDialog *dialog, uint64_t flags, const EsStyle *style, const char *label, ptrdiff_t labelBytes, EsCommandCallback callback) {
|
||||
EsButton *EsDialogAddButton(EsDialog *dialog, uint64_t flags, EsStyleID style, const char *label, ptrdiff_t labelBytes, EsCommandCallback callback) {
|
||||
EsButton *button = EsButtonCreate(dialog->buttonArea, flags, style, label, labelBytes);
|
||||
|
||||
if (button) {
|
||||
|
@ -3995,7 +3995,7 @@ int ProcessCanvasPaneMessage(EsElement *element, EsMessage *message) {
|
|||
return ES_HANDLED;
|
||||
}
|
||||
|
||||
EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsCanvasPane *pane = (EsCanvasPane *) EsHeapAllocate(sizeof(EsCanvasPane), true);
|
||||
if (!pane) return nullptr;
|
||||
pane->Initialise(parent, flags, ProcessCanvasPaneMessage, style);
|
||||
|
@ -4134,7 +4134,7 @@ void EsTextDisplaySetContents(EsTextDisplay *display, const char *string, ptrdif
|
|||
InspectorNotifyElementContentChanged(display);
|
||||
}
|
||||
|
||||
EsTextDisplay *EsTextDisplayCreate(EsElement *parent, uint64_t flags, const EsStyle *style, const char *label, ptrdiff_t labelBytes) {
|
||||
EsTextDisplay *EsTextDisplayCreate(EsElement *parent, uint64_t flags, EsStyleID style, const char *label, ptrdiff_t labelBytes) {
|
||||
EsTextDisplay *display = (EsTextDisplay *) EsHeapAllocate(sizeof(EsTextDisplay), true);
|
||||
if (!display) return nullptr;
|
||||
display->Initialise(parent, flags, ProcessTextDisplayMessage, style ?: UIGetDefaultStyleVariant(ES_STYLE_TEXT_LABEL, parent));
|
||||
|
@ -4263,7 +4263,7 @@ int ProcessListDisplayMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EsListDisplay *EsListDisplayCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsListDisplay *EsListDisplayCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsListDisplay *display = (EsListDisplay *) EsHeapAllocate(sizeof(EsListDisplay), true);
|
||||
if (!display) return nullptr;
|
||||
display->Initialise(parent, flags, ProcessListDisplayMessage, style ?: ES_STYLE_LIST_DISPLAY_DEFAULT);
|
||||
|
@ -4465,7 +4465,7 @@ int ProcessButtonMessage(EsElement *element, EsMessage *message) {
|
|||
return ES_HANDLED;
|
||||
}
|
||||
|
||||
EsButton *EsButtonCreate(EsElement *parent, uint64_t flags, const EsStyle *style, const char *label, ptrdiff_t labelBytes) {
|
||||
EsButton *EsButtonCreate(EsElement *parent, uint64_t flags, EsStyleID style, const char *label, ptrdiff_t labelBytes) {
|
||||
EsButton *button = (EsButton *) EsHeapAllocate(sizeof(EsButton), true);
|
||||
if (!button) return button;
|
||||
|
||||
|
@ -4714,7 +4714,7 @@ int ProcessMenuItemMessage(EsElement *element, EsMessage *message) {
|
|||
MenuItem *MenuItemCreate(EsMenu *menu, uint64_t flags, const char *label, ptrdiff_t labelBytes) {
|
||||
MenuItem *button = (MenuItem *) EsHeapAllocate(sizeof(MenuItem), true);
|
||||
if (!button) return nullptr;
|
||||
const EsStyle *style = (flags & ES_MENU_ITEM_HEADER) ? ES_STYLE_MENU_ITEM_HEADER : ES_STYLE_MENU_ITEM_NORMAL;
|
||||
EsStyleID style = (flags & ES_MENU_ITEM_HEADER) ? ES_STYLE_MENU_ITEM_HEADER : ES_STYLE_MENU_ITEM_NORMAL;
|
||||
if (flags & ES_MENU_ITEM_HEADER) flags |= ES_ELEMENT_DISABLED;
|
||||
button->Initialise(menu, flags | ES_CELL_H_FILL, ProcessMenuItemMessage, style);
|
||||
button->cName = "menu item";
|
||||
|
@ -5727,7 +5727,7 @@ int ProcessSplitterMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EsSplitter *EsSplitterCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsSplitter *EsSplitterCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsSplitter *splitter = (EsSplitter *) EsHeapAllocate(sizeof(EsSplitter), true);
|
||||
if (!splitter) return nullptr;
|
||||
splitter->horizontal = flags & ES_SPLITTER_HORIZONTAL;
|
||||
|
@ -5805,7 +5805,7 @@ int ProcessImageDisplayMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EsImageDisplay *EsImageDisplayCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsImageDisplay *EsImageDisplayCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsImageDisplay *display = (EsImageDisplay *) EsHeapAllocate(sizeof(EsImageDisplay), true);
|
||||
if (!display) return nullptr;
|
||||
display->Initialise(parent, flags, ProcessImageDisplayMessage, style);
|
||||
|
@ -5871,7 +5871,7 @@ int ProcessIconDisplayMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
EsIconDisplay *EsIconDisplayCreate(EsElement *parent, uint64_t flags, const EsStyle *style, uint32_t iconID) {
|
||||
EsIconDisplay *EsIconDisplayCreate(EsElement *parent, uint64_t flags, EsStyleID style, uint32_t iconID) {
|
||||
EsIconDisplay *display = (EsIconDisplay *) EsHeapAllocate(sizeof(EsIconDisplay), true);
|
||||
if (!display) return nullptr;
|
||||
display->Initialise(parent, flags, ProcessIconDisplayMessage, style ?: ES_STYLE_ICON_DISPLAY);
|
||||
|
@ -5969,7 +5969,7 @@ void EsSliderSetValue(EsSlider *slider, double newValue, bool sendUpdatedMessage
|
|||
}
|
||||
}
|
||||
|
||||
EsSlider *EsSliderCreate(EsElement *parent, uint64_t flags, const EsStyle *style, double value, uint32_t steps) {
|
||||
EsSlider *EsSliderCreate(EsElement *parent, uint64_t flags, EsStyleID style, double value, uint32_t steps) {
|
||||
EsSlider *slider = (EsSlider *) EsHeapAllocate(sizeof(EsSlider), true);
|
||||
if (!slider) return nullptr;
|
||||
slider->Initialise(parent, flags | ES_ELEMENT_FOCUSABLE, ProcessSliderMessage, style ?: ES_STYLE_SLIDER_TRACK);
|
||||
|
@ -6094,7 +6094,7 @@ void EsFileMenuCreate(EsInstance *_instance, EsElement *element, uint64_t menuFl
|
|||
|
||||
EsMenu *menu = EsMenuCreate(element, menuFlags);
|
||||
if (!menu) return;
|
||||
EsPanel *panel1 = EsPanelCreate(menu, ES_PANEL_HORIZONTAL | ES_CELL_H_LEFT, &styleFileMenuDocumentInformationPanel1);
|
||||
EsPanel *panel1 = EsPanelCreate(menu, ES_PANEL_HORIZONTAL | ES_CELL_H_LEFT, EsStyleIntern(&styleFileMenuDocumentInformationPanel1));
|
||||
if (!panel1) goto show;
|
||||
|
||||
{
|
||||
|
@ -6104,14 +6104,14 @@ void EsFileMenuCreate(EsInstance *_instance, EsElement *element, uint64_t menuFl
|
|||
EsIconDisplayCreate(panel1, ES_CELL_V_TOP, 0, editorSettings->documentIconID);
|
||||
EsSpacerCreate(panel1, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
|
||||
EsPanel *panel2 = EsPanelCreate(panel1, ES_CELL_H_FILL, &styleFileMenuDocumentInformationPanel2);
|
||||
EsPanel *panel2 = EsPanelCreate(panel1, ES_CELL_H_FILL, EsStyleIntern(&styleFileMenuDocumentInformationPanel2));
|
||||
if (!panel2) goto show;
|
||||
EsPanel *switcher = EsPanelCreate(panel2, ES_CELL_H_FILL | ES_PANEL_SWITCHER | ES_PANEL_SWITCHER_MEASURE_LARGEST);
|
||||
if (!switcher) goto show;
|
||||
EsPanel *panel3 = EsPanelCreate(switcher, ES_PANEL_HORIZONTAL | ES_CELL_H_FILL, &styleFileMenuDocumentInformationPanel2);
|
||||
EsPanel *panel3 = EsPanelCreate(switcher, ES_PANEL_HORIZONTAL | ES_CELL_H_FILL, EsStyleIntern(&styleFileMenuDocumentInformationPanel2));
|
||||
if (!panel3) goto show;
|
||||
|
||||
instance->fileMenuNameTextbox = EsTextboxCreate(switcher, ES_CELL_H_FILL | ES_TEXTBOX_EDIT_BASED, &styleFileMenuNameTextbox);
|
||||
instance->fileMenuNameTextbox = EsTextboxCreate(switcher, ES_CELL_H_FILL | ES_TEXTBOX_EDIT_BASED, EsStyleIntern(&styleFileMenuNameTextbox));
|
||||
|
||||
instance->fileMenuNameSwitcher = switcher;
|
||||
instance->fileMenuNamePanel = panel3;
|
||||
|
@ -6133,7 +6133,7 @@ void EsFileMenuCreate(EsInstance *_instance, EsElement *element, uint64_t menuFl
|
|||
EsButtonOnCommand(renameButton, FileMenuRename);
|
||||
|
||||
if (!newDocument) {
|
||||
EsPanel *panel4 = EsPanelCreate(panel2, ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_CELL_H_LEFT, &styleFileMenuDocumentInformationPanel2);
|
||||
EsPanel *panel4 = EsPanelCreate(panel2, ES_PANEL_TABLE | ES_PANEL_HORIZONTAL | ES_CELL_H_LEFT, EsStyleIntern(&styleFileMenuDocumentInformationPanel2));
|
||||
if (!panel4) goto show;
|
||||
EsPanelSetBands(panel4, 2 /* columns */);
|
||||
|
||||
|
@ -6427,7 +6427,7 @@ EsPoint EsMouseGetPosition(EsElement *relativeElement) {
|
|||
}
|
||||
}
|
||||
|
||||
const EsStyle *UIGetDefaultStyleVariant(const EsStyle *style, EsElement *parent) {
|
||||
EsStyleID UIGetDefaultStyleVariant(EsStyleID style, EsElement *parent) {
|
||||
EsMessage m = { .type = ES_MSG_GET_CHILD_STYLE_VARIANT, .childStyleVariant = style };
|
||||
EsElement *ancestor = parent;
|
||||
|
||||
|
@ -6687,7 +6687,7 @@ void EsElementInsertAfter(EsElement *element) {
|
|||
gui.insertAfter = element;
|
||||
}
|
||||
|
||||
void EsElement::Initialise(EsElement *_parent, uint64_t _flags, EsElementCallback _classCallback, const EsStyle *_style) {
|
||||
void EsElement::Initialise(EsElement *_parent, uint64_t _flags, EsElementCallback _classCallback, EsStyleID _style) {
|
||||
EsMessageMutexCheck();
|
||||
|
||||
// EsPrint("New element '%z' %x with parent %x.\n", _debugName, this, _parent);
|
||||
|
|
|
@ -517,9 +517,9 @@ void InspectorSetup(EsWindow *window) {
|
|||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel1, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, "Horizontal:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, 0, "Horizontal:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
inspector->alignH[0] = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_ELEMENT_DISABLED);
|
||||
EsButtonSetIcon(inspector->alignH[0], ES_ICON_ALIGN_HORIZONTAL_LEFT);
|
||||
EsButtonOnCommand(inspector->alignH[0], InspectorHAlignLeft);
|
||||
|
@ -535,9 +535,9 @@ void InspectorSetup(EsWindow *window) {
|
|||
EsButtonOnCommand(inspector->alignH[4], InspectorHAlignShrink);
|
||||
inspector->alignH[5] = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_ELEMENT_DISABLED, 0, "Push");
|
||||
EsButtonOnCommand(inspector->alignH[5], InspectorHAlignPush);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, "Vertical:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, 0, "Vertical:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
inspector->alignV[0] = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_ELEMENT_DISABLED);
|
||||
EsButtonSetIcon(inspector->alignV[0], ES_ICON_ALIGN_VERTICAL_TOP);
|
||||
EsButtonOnCommand(inspector->alignV[0], InspectorVAlignTop);
|
||||
|
@ -557,9 +557,9 @@ void InspectorSetup(EsWindow *window) {
|
|||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel1, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, "Stack:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, 0, "Stack:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
inspector->direction[0] = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_ELEMENT_DISABLED);
|
||||
EsButtonSetIcon(inspector->direction[0], ES_ICON_GO_PREVIOUS);
|
||||
EsButtonOnCommand(inspector->direction[0], InspectorDirectionLeft);
|
||||
|
@ -572,22 +572,22 @@ void InspectorSetup(EsWindow *window) {
|
|||
inspector->direction[3] = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_ELEMENT_DISABLED);
|
||||
EsButtonSetIcon(inspector->direction[3], ES_ICON_GO_DOWN);
|
||||
EsButtonOnCommand(inspector->direction[3], InspectorDirectionDown);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 25, 0);
|
||||
inspector->addChildButton = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_BUTTON_DROPDOWN | ES_ELEMENT_DISABLED | ES_BUTTON_COMPACT, nullptr, "Add child... ");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 25, 0);
|
||||
inspector->addChildButton = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_BUTTON_DROPDOWN | ES_ELEMENT_DISABLED | ES_BUTTON_COMPACT, 0, "Add child... ");
|
||||
EsButtonOnCommand(inspector->addChildButton, InspectorAddElement);
|
||||
inspector->addSiblingButton = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_BUTTON_DROPDOWN | ES_ELEMENT_DISABLED | ES_BUTTON_COMPACT, nullptr, "Add sibling... ");
|
||||
inspector->addSiblingButton = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR | ES_BUTTON_DROPDOWN | ES_ELEMENT_DISABLED | ES_BUTTON_COMPACT, 0, "Add sibling... ");
|
||||
inspector->addSiblingButton->userData.i = 0x80;
|
||||
EsButtonOnCommand(inspector->addSiblingButton, InspectorAddElement);
|
||||
}
|
||||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel1, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, "Content:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 5, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, 0, "Content:");
|
||||
inspector->contentTextbox = EsTextboxCreate(toolbar, ES_ELEMENT_DISABLED | ES_TEXTBOX_EDIT_BASED);
|
||||
inspector->contentTextbox->messageUser = InspectorContentTextboxCallback;
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, 25, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, nullptr, "Event category filter:");
|
||||
EsSpacerCreate(toolbar, ES_FLAGS_DEFAULT, 0, 25, 0);
|
||||
EsTextDisplayCreate(toolbar, ES_FLAGS_DEFAULT, 0, "Event category filter:");
|
||||
inspector->textboxCategoryFilter = EsTextboxCreate(toolbar, ES_ELEMENT_DISABLED);
|
||||
inspector->textboxCategoryFilter->messageUser = InspectorTextboxCategoryFilterCallback;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ struct EsListView : EsElement {
|
|||
Array<ListViewGroup> groups;
|
||||
Array<ListViewItem> visibleItems;
|
||||
|
||||
const EsStyle *itemStyle, *headerItemStyle, *footerItemStyle;
|
||||
EsStyleID itemStyle, headerItemStyle, footerItemStyle;
|
||||
int64_t fixedWidth, fixedHeight;
|
||||
int64_t fixedHeaderSize, fixedFooterSize;
|
||||
|
||||
|
@ -626,7 +626,7 @@ struct EsListView : EsElement {
|
|||
visibleItem->size = MeasureItems(visibleItem->group, visibleItem->index, 1);
|
||||
|
||||
ListViewGroup *group = &groups[visibleItem->group];
|
||||
const EsStyle *style = nullptr;
|
||||
EsStyleID style = 0;
|
||||
|
||||
if ((group->flags & ES_LIST_VIEW_GROUP_HAS_HEADER) && visibleItem->index == 0) {
|
||||
style = headerItemStyle;
|
||||
|
@ -1950,7 +1950,7 @@ struct EsListView : EsElement {
|
|||
secondaryCellStyle = GetStyle(MakeStyleKey(ES_STYLE_LIST_SECONDARY_CELL, 0), false);
|
||||
selectedCellStyle = GetStyle(MakeStyleKey(ES_STYLE_LIST_SELECTED_CHOICE_CELL, 0), false);
|
||||
|
||||
EsListViewChangeStyles(this, nullptr, nullptr, nullptr, nullptr, ES_FLAGS_DEFAULT, ES_FLAGS_DEFAULT);
|
||||
EsListViewChangeStyles(this, 0, 0, 0, 0, ES_FLAGS_DEFAULT, ES_FLAGS_DEFAULT);
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT && (activeColumns.Length() || (flags & ES_LIST_VIEW_FIXED_ITEMS))) {
|
||||
uintptr_t index = message->getContent.index;
|
||||
|
||||
|
@ -2163,8 +2163,8 @@ int ListViewColumnHeaderMessage(EsElement *element, EsMessage *message) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void EsListViewChangeStyles(EsListView *view, const EsStyle *style, const EsStyle *itemStyle,
|
||||
const EsStyle *headerItemStyle, const EsStyle *footerItemStyle, uint32_t addFlags, uint32_t removeFlags) {
|
||||
void EsListViewChangeStyles(EsListView *view, EsStyleID style, EsStyleID itemStyle,
|
||||
EsStyleID headerItemStyle, EsStyleID footerItemStyle, uint32_t addFlags, uint32_t removeFlags) {
|
||||
// TODO Animating changes.
|
||||
|
||||
bool wasTiledView = view->flags & ES_LIST_VIEW_TILED;
|
||||
|
@ -2255,8 +2255,8 @@ void EsListViewChangeStyles(EsListView *view, const EsStyle *style, const EsStyl
|
|||
EsElementRelayout(view);
|
||||
}
|
||||
|
||||
EsListView *EsListViewCreate(EsElement *parent, uint64_t flags, const EsStyle *style,
|
||||
const EsStyle *itemStyle, const EsStyle *headerItemStyle, const EsStyle *footerItemStyle) {
|
||||
EsListView *EsListViewCreate(EsElement *parent, uint64_t flags, EsStyleID style,
|
||||
EsStyleID itemStyle, EsStyleID headerItemStyle, EsStyleID footerItemStyle) {
|
||||
EsListView *view = (EsListView *) EsHeapAllocate(sizeof(EsListView), true);
|
||||
if (!view) return nullptr;
|
||||
|
||||
|
@ -2276,7 +2276,7 @@ EsListView *EsListViewCreate(EsElement *parent, uint64_t flags, const EsStyle *s
|
|||
else itemStyle = ES_STYLE_LIST_ITEM;
|
||||
}
|
||||
|
||||
EsListViewChangeStyles(view, nullptr, itemStyle, headerItemStyle ?: ES_STYLE_LIST_ITEM_GROUP_HEADER,
|
||||
EsListViewChangeStyles(view, 0, itemStyle, headerItemStyle ?: ES_STYLE_LIST_ITEM_GROUP_HEADER,
|
||||
footerItemStyle ?: ES_STYLE_LIST_ITEM_GROUP_FOOTER, ES_FLAGS_DEFAULT, ES_FLAGS_DEFAULT);
|
||||
|
||||
return view;
|
||||
|
@ -2548,7 +2548,7 @@ void EsListViewAddAllColumns(EsListView *view) {
|
|||
for (uintptr_t i = 0; i < view->registeredColumns.Length(); i++) {
|
||||
view->activeColumns.Add(i);
|
||||
|
||||
EsStyle *style = (view->registeredColumns[i].flags & ES_LIST_VIEW_COLUMN_HAS_MENU) ? ES_STYLE_LIST_COLUMN_HEADER_ITEM_HAS_MENU : ES_STYLE_LIST_COLUMN_HEADER_ITEM;
|
||||
EsStyleID style = (view->registeredColumns[i].flags & ES_LIST_VIEW_COLUMN_HAS_MENU) ? ES_STYLE_LIST_COLUMN_HEADER_ITEM_HAS_MENU : ES_STYLE_LIST_COLUMN_HEADER_ITEM;
|
||||
EsElement *columnHeaderItem = EsCustomElementCreate(view->columnHeader, ES_CELL_FILL, style);
|
||||
columnHeaderItem->messageUser = ListViewColumnHeaderItemMessage;
|
||||
columnHeaderItem->cName = "column header item";
|
||||
|
|
|
@ -39,6 +39,7 @@ type_name uint64_t EsTimer;
|
|||
type_name int64_t EsListViewIndex;
|
||||
type_name uint64_t EsObjectID;
|
||||
type_name uint32_t EsDeviceColor; // TODO Make this 64-bit?
|
||||
type_name uint32_t EsStyleID;
|
||||
|
||||
define ES_SCANCODE_A (0x04)
|
||||
define ES_SCANCODE_B (0x05)
|
||||
|
@ -1368,8 +1369,8 @@ struct EsThemeAppearance {
|
|||
};
|
||||
|
||||
struct EsStyle {
|
||||
void *inherit;
|
||||
EsThemeMetrics metrics;
|
||||
EsStyleID inherit; // Must be a built-in style.
|
||||
EsThemeMetrics metrics; // Unscaled!
|
||||
EsThemeAppearance appearance;
|
||||
};
|
||||
|
||||
|
@ -1835,7 +1836,7 @@ struct EsMessage {
|
|||
EsMessageWindowActivated windowActivated;
|
||||
EsMessageScroll scroll;
|
||||
EsMessageEnsureVisible ensureVisible;
|
||||
const EsStyle *childStyleVariant;
|
||||
EsStyleID childStyleVariant;
|
||||
EsRectangle *accessKeyHintBounds;
|
||||
EsPainter *painter;
|
||||
EsCursorStyle cursorStyle;
|
||||
|
@ -2186,7 +2187,7 @@ function bool EsDrawStandardIcon(EsPainter *painter, uint32_t id, int size, EsRe
|
|||
function void EsDrawPaintTarget(EsPainter *painter, EsPaintTarget *source, EsRectangle destinationRegion, EsRectangle sourceRegion, uint8_t alpha) @opaque(painter);
|
||||
function void EsDrawText(EsPainter *painter, EsTextPlan *plan, EsRectangle bounds, const EsRectangle *clip = ES_NULL, const EsTextSelection *selectionProperties = ES_NULL) @opaque(painter) @in(selectionProperties) @in(clip);
|
||||
function void EsDrawTextSimple(EsPainter *painter, EsElement *element, EsRectangle bounds, STRING stringBytes, EsTextStyle style, uint32_t flags = ES_FLAGS_DEFAULT) @opaque(painter);
|
||||
function void EsDrawTextThemed(EsPainter *painter, EsElement *element, EsRectangle bounds, STRING stringBytes, const EsStyle *style, uint32_t flags = ES_FLAGS_DEFAULT) @opaque(painter); // The style must be one of the ES_STYLE_TEXT_... styles.
|
||||
function void EsDrawTextThemed(EsPainter *painter, EsElement *element, EsRectangle bounds, STRING stringBytes, EsStyleID style, uint32_t flags = ES_FLAGS_DEFAULT) @opaque(painter); // The style must be one of the ES_STYLE_TEXT_... styles.
|
||||
function void EsDrawTextLayers(EsPainter *painter, EsTextPlan *plan, EsRectangle bounds, const EsTextSelection *selectionProperties = ES_NULL) @opaque(painter) @in(selectionProperties);
|
||||
function void EsDrawVectorFile(EsPainter *painter, EsRectangle bounds, const void *data, size_t dataBytes) @opaque(painter) @buffer_in(data, dataBytes);
|
||||
|
||||
|
@ -2220,6 +2221,9 @@ function bool EsFontDatabaseLookupByName(STRING name, EsFontInformation *informa
|
|||
function bool EsFontDatabaseLookupByID(EsFontFamily id, EsFontInformation *information) @out(information); // Returns false if the font does not exist in the database.
|
||||
function EsFontFamily EsFontDatabaseInsertFile(const EsFontInformation *information, EsFileStore *store) @in(information); // Don't set the `id` field in EsFontInformation. The assigned ID will be returned. If nameBytes is 0, then the system will not try to match it with an existing font family. Set the corresponding bit in availableWeightsNormal/availableWeightsItalic for the file being added. The request is ignored if the specific variant is already in the database.
|
||||
|
||||
function EsStyleID EsStyleIntern(const EsStyle *style) @in(style); // Once a style has been interned, it cannot be removed. Duplicate styles will be given the same ID.
|
||||
// TODO Add an alternative API which allows for adding and removing styles dynamically.
|
||||
|
||||
// Networking.
|
||||
|
||||
function EsError EsAddressResolve(STRING domain, uint32_t flags, EsAddress *address) @todo();
|
||||
|
@ -2453,8 +2457,8 @@ function EsRectangle EsElementGetWindowBounds(EsElement *element, bool client =
|
|||
function EsRectangle EsElementGetScreenBounds(EsElement *element, bool client = true);
|
||||
|
||||
// TODO Rename these functions?
|
||||
function EsElement *EsCustomElementCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsScrollView *EsCustomScrollViewCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsElement *EsCustomElementCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function EsScrollView *EsCustomScrollViewCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
|
||||
function int EsScrollViewReceivedMessage(EsScrollView *view, EsMessage *message) @todo(); // You *must* call this *before* handling any messages. If this returns non-zero, immediately return that value from your message handler.
|
||||
function void EsScrollViewSetup(EsScrollView *view, uint8_t xMode, uint8_t yMode, uint16_t flags);
|
||||
|
@ -2488,7 +2492,7 @@ function void EsMenuCloseAll();
|
|||
function void EsMenuAddCommandsFromToolbar(EsMenu *menu, EsElement *element);
|
||||
|
||||
function EsDialog *EsDialogShow(EsWindow *window, STRING title, STRING content, uint32_t iconID, uint32_t flags = ES_FLAGS_DEFAULT);
|
||||
function EsButton *EsDialogAddButton(EsDialog *dialog, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, STRING label = BLANK_STRING, EsCommandCallback callback = ES_NULL) @todo();
|
||||
function EsButton *EsDialogAddButton(EsDialog *dialog, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, STRING label = BLANK_STRING, EsCommandCallback callback = ES_NULL) @todo();
|
||||
function void EsDialogClose(EsDialog *dialog);
|
||||
function EsElement *EsDialogGetContentArea(EsDialog *dialog);
|
||||
|
||||
|
@ -2500,7 +2504,7 @@ private function void _EsUISetFont(EsFontFamily id);
|
|||
|
||||
// Buttons.
|
||||
|
||||
function EsButton *EsButtonCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, STRING label = BLANK_STRING);
|
||||
function EsButton *EsButtonCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, STRING label = BLANK_STRING);
|
||||
function void EsButtonSetIcon(EsButton *button, uint32_t iconID);
|
||||
function void EsButtonSetIconFromBits(EsButton *button, const uint32_t *bits, size_t width, size_t height, size_t stride) @matrix_in(bits, width, height, stride);
|
||||
function void EsButtonSetCheck(EsButton *button, EsCheckState checkState = ES_CHECK_CHECKED, bool sendUpdatedMessage = true);
|
||||
|
@ -2511,7 +2515,7 @@ function EsElement *EsButtonGetCheckBuddy(EsButton *button); // TODO Public pro
|
|||
|
||||
// Textboxes.
|
||||
|
||||
function EsTextbox *EsTextboxCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsTextbox *EsTextboxCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function bool EsTextboxFind(EsTextbox *textbox, STRING string, int32_t *line, int32_t *byte, uint32_t flags) @out(line) @out(byte);
|
||||
function void EsTextboxInsert(EsTextbox *textbox, STRING string = BLANK_STRING, bool sendUpdatedMessage = true); // Deletes existing selection first.
|
||||
function void EsTextboxAppend(EsTextbox *textbox, STRING string = BLANK_STRING, bool sendUpdatedMessage = true); // Ignores the user's selection.
|
||||
|
@ -2537,16 +2541,16 @@ function void EsTextboxSetReadOnly(EsTextbox *textbox, bool readOnly); // Preven
|
|||
|
||||
// Sliders.
|
||||
|
||||
function EsSlider *EsSliderCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, double value = 0, uint32_t steps = 0);
|
||||
function EsSlider *EsSliderCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, double value = 0, uint32_t steps = 0);
|
||||
function double EsSliderGetValue(EsSlider *slider);
|
||||
function void EsSliderSetValue(EsSlider *slider, double newValue, bool sendUpdatedMessage = true);
|
||||
|
||||
// Panels, spacers and splitters.
|
||||
|
||||
function EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
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 EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsPanel *EsPanelCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function EsSpacer *EsSpacerCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, int width = 0, int height = 0);
|
||||
function EsSplitter *EsSplitterCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
|
||||
function void EsPanelSetBands(EsPanel *panel, size_t columnCount, size_t rowCount = 0, const EsPanelBand *columns = ES_NULL, const EsPanelBand *rows = ES_NULL) @array_in(columns, columnCount) @array_in(rows, rowCount);
|
||||
function void EsPanelSetBandsAll(EsPanel *panel, const EsPanelBand *column = ES_NULL, const EsPanelBand *row = ES_NULL) @in(column) @in(row); // Set all the columns/rows to have the same properties. This must be called after the final number of bands has been determined/set!
|
||||
|
@ -2558,24 +2562,24 @@ function void EsPanelStartMovementAnimation(EsPanel *panel, float timeMultiplier
|
|||
|
||||
function EsButton *EsPanelRadioGroupGetChecked(EsPanel *panel);
|
||||
|
||||
function void EsSpacerChangeStyle(EsSpacer *spacer, const EsStyle *newStyle);
|
||||
function void EsSpacerChangeStyle(EsSpacer *spacer, EsStyleID newStyle);
|
||||
|
||||
// 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, EsStyleID style = 0, uint32_t iconID = 0);
|
||||
function void EsIconDisplaySetIcon(EsIconDisplay *display, uint32_t iconID);
|
||||
|
||||
function EsImageDisplay *EsImageDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsImageDisplay *EsImageDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function void EsImageDisplayLoadBits(EsImageDisplay *display, const uint32_t *bits, size_t width, size_t height, size_t stride) @matrix_in(bits, width, height);
|
||||
function void EsImageDisplayLoadFromMemory(EsImageDisplay *display, const void *buffer, size_t bufferBytes) @buffer_in(buffer, bufferBytes);
|
||||
function void EsImageDisplayPaint(EsImageDisplay *display, EsPainter *painter, EsRectangle bounds) @opaque(painter);
|
||||
|
||||
function EsTextDisplay *EsTextDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL, STRING label = BLANK_STRING);
|
||||
function EsTextDisplay *EsTextDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, STRING label = BLANK_STRING);
|
||||
function void EsTextDisplaySetContents(EsTextDisplay *display, STRING contents = BLANK_STRING);
|
||||
function void EsTextDisplaySetStyledContents(EsTextDisplay *display, const char *string, EsTextRun *runs, size_t runCount) @todo(); // See EsTextPlanCreate for how runCount works.
|
||||
function void EsTextDisplaySetupSyntaxHighlighting(EsTextDisplay *display, uint32_t language, const uint32_t *customColors = ES_NULL, size_t customColorCount = 0) @array_in(customColors, customColorCount);
|
||||
|
||||
function EsListDisplay *EsListDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, const EsStyle *style = ES_NULL);
|
||||
function EsListDisplay *EsListDisplayCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
|
||||
function void EsListDisplaySetCounterContinuation(EsListDisplay *display, EsListDisplay *previous);
|
||||
function void EsListDisplaySetCounterStart(EsListDisplay *display, uintptr_t index); // If index = 0, then the first item will be "1." or "(a)".
|
||||
|
||||
|
@ -2591,9 +2595,7 @@ function void EsColorWellSetIndeterminate(EsColorWell *well);
|
|||
|
||||
// List views.
|
||||
|
||||
function EsListView *EsListViewCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT,
|
||||
const EsStyle *style = ES_NULL, const EsStyle *itemStyle = ES_NULL,
|
||||
const EsStyle *headerItemStyle = ES_NULL, const EsStyle *footerItemStyle = ES_NULL);
|
||||
function EsListView *EsListViewCreate(EsElement *parent, uint64_t flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, EsStyleID itemStyle = 0, EsStyleID headerItemStyle = 0, EsStyleID footerItemStyle = 0);
|
||||
|
||||
function EsListViewIndex EsListViewGetIndexFromItem(EsElement *element, EsListViewIndex *group = ES_NULL) @out(group);
|
||||
function EsListViewEnumeratedVisibleItem *EsListViewEnumerateVisibleItems(EsListView *view, size_t *count) @out(count) @heap_array_out(return, count*);
|
||||
|
@ -2609,8 +2611,7 @@ function bool EsListViewGetFocusedItem(EsListView *view, EsListViewIndex *group,
|
|||
function void EsListViewInvalidateContent(EsListView *view, EsListViewIndex group, EsListViewIndex index);
|
||||
function void EsListViewInvalidateAll(EsListView *view);
|
||||
function void EsListViewContentChanged(EsListView *view);
|
||||
function void EsListViewChangeStyles(EsListView *view, const EsStyle *style, const EsStyle *itemStyle,
|
||||
const EsStyle *headerItemStyle, const EsStyle *footerItemStyle, uint32_t addFlags, uint32_t removeFlags);
|
||||
function void EsListViewChangeStyles(EsListView *view, EsStyleID style, EsStyleID itemStyle, EsStyleID headerItemStyle, EsStyleID footerItemStyle, uint32_t addFlags, uint32_t removeFlags);
|
||||
function void EsListViewScrollToEnd(EsListView *view);
|
||||
function EsPoint EsListViewGetAnnouncementPointForSelection(EsListView *view);
|
||||
|
||||
|
|
|
@ -289,8 +289,8 @@ void SettingsAddTitle(EsElement *container, SettingsPage *page) {
|
|||
}
|
||||
|
||||
void SettingsPageUnimplemented(EsElement *element, SettingsPage *page) {
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, &styleSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL | ES_CELL_H_SHRINK, &styleSettingsGroupContainer2);
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleSettingsGroupContainer));
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL | ES_CELL_H_SHRINK, EsStyleIntern(&styleSettingsGroupContainer2));
|
||||
SettingsAddTitle(container, page);
|
||||
|
||||
EsPanel *warningRow = EsPanelCreate(container, ES_CELL_H_CENTER | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_FORM_TABLE);
|
||||
|
@ -468,7 +468,7 @@ void SettingsAddSlider(EsElement *table, const char *string, ptrdiff_t stringByt
|
|||
|
||||
EsPanel *stack = EsPanelCreate(table, ES_CELL_H_FILL);
|
||||
EsTextDisplayCreate(stack, ES_CELL_H_LEFT, 0, string, stringBytes);
|
||||
EsPanel *row = EsPanelCreate(stack, ES_PANEL_HORIZONTAL | ES_CELL_H_FILL, &styleSliderRow);
|
||||
EsPanel *row = EsPanelCreate(stack, ES_PANEL_HORIZONTAL | ES_CELL_H_FILL, EsStyleIntern(&styleSliderRow));
|
||||
EsTextDisplayCreate(row, ES_CELL_H_PUSH | ES_CELL_H_RIGHT, 0, lowString, lowStringBytes);
|
||||
EsSlider *slider = EsSliderCreate(row, ES_ELEMENT_FREE_USER_DATA, 0,
|
||||
LinearMap(control->minimumValue, control->maximumValue, 0, 1, control->originalValueInt), steps);
|
||||
|
@ -556,8 +556,8 @@ int SettingsDoubleClickTestMessage(EsElement *element, EsMessage *message) {
|
|||
void SettingsPageMouse(EsElement *element, SettingsPage *page) {
|
||||
EsElementSetHidden(((SettingsInstance *) element->instance)->undoButton, false);
|
||||
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, &styleSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, &styleSettingsGroupContainer2);
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleSettingsGroupContainer));
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, EsStyleIntern(&styleSettingsGroupContainer2));
|
||||
SettingsAddTitle(container, page);
|
||||
|
||||
EsPanel *table;
|
||||
|
@ -565,7 +565,7 @@ void SettingsPageMouse(EsElement *element, SettingsPage *page) {
|
|||
SettingsAddSlider(container, INTERFACE_STRING(DesktopSettingsMouseSpeed), 'M', "general", "cursor_speed", -20, 20, 41,
|
||||
INTERFACE_STRING(DesktopSettingsMouseSpeedSlow), INTERFACE_STRING(DesktopSettingsMouseSpeedFast));
|
||||
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, &styleSettingsCheckboxGroup);
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, EsStyleIntern(&styleSettingsCheckboxGroup));
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsMouseUseAcceleration), 'C', "general", "use_cursor_acceleration");
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsMouseSlowOnAlt), 'O', "general", "use_cursor_alt_slow");
|
||||
|
||||
|
@ -578,7 +578,7 @@ void SettingsPageMouse(EsElement *element, SettingsPage *page) {
|
|||
SettingsAddNumberBox(table, INTERFACE_STRING(DesktopSettingsMouseLinesPerScrollNotch), 'S', "general", "scroll_lines_per_notch",
|
||||
1, 100, nullptr, 0, 0.04, 1);
|
||||
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, &styleSettingsCheckboxGroup);
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, EsStyleIntern(&styleSettingsCheckboxGroup));
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsMouseSwapLeftAndRightButtons), 'B', "general", "swap_left_and_right_buttons");
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsMouseShowShadow), 'W', "general", "show_cursor_shadow");
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsMouseLocateCursorOnCtrl), 'L', "general", "locate_cursor_on_ctrl");
|
||||
|
@ -598,8 +598,8 @@ void SettingsPageMouse(EsElement *element, SettingsPage *page) {
|
|||
void SettingsPageKeyboard(EsElement *element, SettingsPage *page) {
|
||||
EsElementSetHidden(((SettingsInstance *) element->instance)->undoButton, false);
|
||||
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, &styleSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, &styleSettingsGroupContainer2);
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleSettingsGroupContainer));
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, EsStyleIntern(&styleSettingsGroupContainer2));
|
||||
SettingsAddTitle(container, page);
|
||||
|
||||
EsPanel *table;
|
||||
|
@ -628,7 +628,7 @@ void SettingsPageKeyboard(EsElement *element, SettingsPage *page) {
|
|||
|
||||
EsListViewFixedItemSelect(list, activeKeyboardLayout);
|
||||
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, &styleSettingsCheckboxGroup);
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, EsStyleIntern(&styleSettingsCheckboxGroup));
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsKeyboardUseSmartQuotes), 'Q', "general", "use_smart_quotes");
|
||||
|
||||
EsSpacerCreate(container, ES_CELL_H_FILL, ES_STYLE_SEPARATOR_HORIZONTAL);
|
||||
|
@ -669,8 +669,8 @@ void SettingsPageDisplay(EsElement *element, SettingsPage *page) {
|
|||
|
||||
EsElementSetHidden(((SettingsInstance *) element->instance)->undoButton, false);
|
||||
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, &styleSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, &styleSettingsGroupContainer2);
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleSettingsGroupContainer));
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, EsStyleIntern(&styleSettingsGroupContainer2));
|
||||
SettingsAddTitle(container, page);
|
||||
|
||||
EsPanel *warningRow = EsPanelCreate(container, ES_CELL_H_CENTER | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_FORM_TABLE);
|
||||
|
@ -744,8 +744,8 @@ void SettingsColorButtonCommand(EsInstance *, EsElement *element, EsCommand *) {
|
|||
void SettingsPageTheme(EsElement *element, SettingsPage *page) {
|
||||
// TODO Fonts, theme file, etc.
|
||||
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, &styleSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, &styleSettingsGroupContainer2);
|
||||
EsPanel *content = EsPanelCreate(element, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO | ES_PANEL_H_SCROLL_AUTO, EsStyleIntern(&styleSettingsGroupContainer));
|
||||
EsPanel *container = EsPanelCreate(content, ES_PANEL_VERTICAL, EsStyleIntern(&styleSettingsGroupContainer2));
|
||||
SettingsAddTitle(container, page);
|
||||
|
||||
EsPanel *warningRow = EsPanelCreate(container, ES_CELL_H_CENTER | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_FORM_TABLE);
|
||||
|
@ -795,7 +795,7 @@ void SettingsPageTheme(EsElement *element, SettingsPage *page) {
|
|||
EsButtonOnCommand(button, SettingsColorButtonCommand);
|
||||
}
|
||||
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, &styleSettingsCheckboxGroup);
|
||||
table = EsPanelCreate(container, ES_CELL_H_FILL, EsStyleIntern(&styleSettingsCheckboxGroup));
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsThemeEnableHoverState), 'H', "general", "enable_hover_state");
|
||||
SettingsAddCheckbox(table, INTERFACE_STRING(DesktopSettingsThemeEnableAnimations), 'M', "general", "enable_animations");
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ void InstanceSettingsCreate(EsMessage *message) {
|
|||
EsWindowSetIcon(instance->window, ES_ICON_PREFERENCES_DESKTOP);
|
||||
EsPanel *windowBackground = EsPanelCreate(instance->window, ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_BACKGROUND);
|
||||
instance->switcher = EsPanelCreate(windowBackground, ES_CELL_FILL | ES_PANEL_SWITCHER);
|
||||
EsPanel *content = EsPanelCreate(instance->switcher, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, &styleNewTabContent);
|
||||
EsPanel *content = EsPanelCreate(instance->switcher, ES_CELL_FILL | ES_PANEL_V_SCROLL_AUTO, EsStyleIntern(&styleNewTabContent));
|
||||
instance->mainPage = content;
|
||||
EsPanelSwitchTo(instance->switcher, content, ES_TRANSITION_NONE);
|
||||
|
||||
|
@ -863,7 +863,7 @@ void InstanceSettingsCreate(EsMessage *message) {
|
|||
}
|
||||
|
||||
{
|
||||
EsPanel *container = EsPanelCreate(content, ES_CELL_H_SHRINK | ES_PANEL_TABLE | ES_PANEL_HORIZONTAL, &styleAllSettingsGroupContainer);
|
||||
EsPanel *container = EsPanelCreate(content, ES_CELL_H_SHRINK | ES_PANEL_TABLE | ES_PANEL_HORIZONTAL, EsStyleIntern(&styleAllSettingsGroupContainer));
|
||||
EsPanelSetBands(container, 4);
|
||||
|
||||
EsSort(settingsPages, sizeof(settingsPages) / sizeof(settingsPages[0]), sizeof(settingsPages[0]), [] (const void *_a, const void *_b, EsGeneric) {
|
||||
|
@ -874,7 +874,7 @@ void InstanceSettingsCreate(EsMessage *message) {
|
|||
for (uintptr_t i = 0; i < sizeof(settingsPages) / sizeof(settingsPages[0]); i++) {
|
||||
SettingsPage *page = &settingsPages[i];
|
||||
EsButton *button = EsButtonCreate(container, ES_ELEMENT_NO_FOCUS_ON_CLICK | ES_CELL_H_FILL | ES_ELEMENT_STICKY_ACCESS_KEY,
|
||||
&styleSettingsButton, page->string, page->stringBytes);
|
||||
EsStyleIntern(&styleSettingsButton), page->string, page->stringBytes);
|
||||
button->userData = page;
|
||||
button->accessKey = EsCRTisalpha(page->string[0]) ? page->string[0] : page->accessKey;
|
||||
EsButtonSetIcon(button, page->iconID);
|
||||
|
|
|
@ -1,125 +1,125 @@
|
|||
define ES_STYLE_SEPARATOR_HORIZONTAL (ES_STYLE_CAST(1373))
|
||||
private define ES_STYLE_SCROLLBAR_PAD (ES_STYLE_CAST(1371))
|
||||
private define ES_STYLE_ACCESS_KEY_HINT (ES_STYLE_CAST(1221))
|
||||
private define ES_STYLE_ANNOUNCEMENT (ES_STYLE_CAST(1511))
|
||||
private define ES_STYLE_BREADCRUMB_BAR_CRUMB (ES_STYLE_CAST(1223))
|
||||
private define ES_STYLE_BREADCRUMB_BAR_OVERFLOW_ICON (ES_STYLE_CAST(1225))
|
||||
private define ES_STYLE_BREADCRUMB_BAR_PANEL (ES_STYLE_CAST(1227))
|
||||
define ES_STYLE_BUTTON_GROUP_CONTAINER (ES_STYLE_CAST(1229))
|
||||
define ES_STYLE_BUTTON_GROUP_ITEM (ES_STYLE_CAST(1231))
|
||||
define ES_STYLE_BUTTON_GROUP_SEPARATOR (ES_STYLE_CAST(1233))
|
||||
private define ES_STYLE_CANVAS_SHADOW (ES_STYLE_CAST(1451))
|
||||
private define ES_STYLE_COLOR_HEX_TEXTBOX (ES_STYLE_CAST(1245))
|
||||
private define ES_STYLE_TASK_BAR_BAR (ES_STYLE_CAST(1379))
|
||||
private define ES_STYLE_SLIDER_TRACK (ES_STYLE_CAST(1601))
|
||||
private define ES_STYLE_CHECKBOX_NORMAL (ES_STYLE_CAST(1559))
|
||||
private define ES_STYLE_SPLIT_BAR_VERTICAL (ES_STYLE_CAST(1377))
|
||||
private define ES_STYLE_WINDOW_TAB_CLOSE_BUTTON (ES_STYLE_CAST(1469))
|
||||
private define ES_STYLE_SPLIT_BAR_HORIZONTAL (ES_STYLE_CAST(1375))
|
||||
private define ES_STYLE_CHECKBOX_RADIOBOX (ES_STYLE_CAST(1567))
|
||||
define ES_STYLE_CLEAR_BACKGROUND (ES_STYLE_CAST(1597))
|
||||
private define ES_STYLE_COLOR_CHOSEN_POINT (ES_STYLE_CAST(1241))
|
||||
private define ES_STYLE_COLOR_CIRCLE (ES_STYLE_CAST(1243))
|
||||
private define ES_STYLE_TASK_BAR_BUTTON (ES_STYLE_CAST(1381))
|
||||
private define ES_STYLE_COLOR_PICKER_MAIN_PANEL (ES_STYLE_CAST(1247))
|
||||
private define ES_STYLE_COLOR_SLIDER (ES_STYLE_CAST(1249))
|
||||
private define ES_STYLE_CONTAINER_WINDOW (ES_STYLE_CAST(1251))
|
||||
private define ES_STYLE_CURSOR_LOCATOR (ES_STYLE_CAST(1591))
|
||||
define ES_STYLE_DIALOG_BUTTON_AREA (ES_STYLE_CAST(1259))
|
||||
define ES_STYLE_DIALOG_CONTENT (ES_STYLE_CAST(1261))
|
||||
define ES_STYLE_DIALOG_HEADING (ES_STYLE_CAST(1263))
|
||||
define ES_STYLE_DIALOG_SHADOW (ES_STYLE_CAST(1311))
|
||||
private define ES_STYLE_DIALOG_WRAPPER (ES_STYLE_CAST(1665))
|
||||
private define ES_STYLE_DOUBLE_CLICK_TEST (ES_STYLE_CAST(1585))
|
||||
define ES_STYLE_ICON_DISPLAY (ES_STYLE_CAST(1265))
|
||||
define ES_STYLE_ICON_DISPLAY_SMALL (ES_STYLE_CAST(1543))
|
||||
define ES_STYLE_INSTALLER_ROOT (ES_STYLE_CAST(1267))
|
||||
define ES_STYLE_LIST_CHOICE_BORDERED (ES_STYLE_CAST(1429))
|
||||
define ES_STYLE_LIST_CHOICE_ITEM (ES_STYLE_CAST(1435))
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER (ES_STYLE_CAST(1269))
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_ITEM (ES_STYLE_CAST(1271))
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_ITEM_HAS_MENU (ES_STYLE_CAST(1273))
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_SPLITTER (ES_STYLE_CAST(1275))
|
||||
private define ES_STYLE_LIST_GROUP_HEADER_CELL (ES_STYLE_CAST(1277))
|
||||
define ES_STYLE_LIST_ITEM (ES_STYLE_CAST(1279))
|
||||
define ES_STYLE_TEXT_RADIO_GROUP_LABEL (ES_STYLE_CAST(1651))
|
||||
define ES_STYLE_TEXT_PARAGRAPH_SECONDARY (ES_STYLE_CAST(1635))
|
||||
define ES_STYLE_TEXT_PARAGRAPH (ES_STYLE_CAST(1397))
|
||||
define ES_STYLE_TEXT_LABEL_SECONDARY (ES_STYLE_CAST(1395))
|
||||
define ES_STYLE_TEXT_LABEL_INVERTED (ES_STYLE_CAST(1393))
|
||||
define ES_STYLE_LIST_ITEM_GROUP_FOOTER (ES_STYLE_CAST(1281))
|
||||
define ES_STYLE_TEXT_LABEL (ES_STYLE_CAST(1391))
|
||||
private define ES_STYLE_TEXT_HEADING3 (ES_STYLE_CAST(1423))
|
||||
define ES_STYLE_TEXT_HEADING2 (ES_STYLE_CAST(1389))
|
||||
define ES_STYLE_TEXT_HEADING1 (ES_STYLE_CAST(1581))
|
||||
define ES_STYLE_TEXT_HEADING0 (ES_STYLE_CAST(1387))
|
||||
define ES_STYLE_LIST_ITEM_GROUP_HEADER (ES_STYLE_CAST(1283))
|
||||
private define ES_STYLE_TASK_BAR_NEW_WINDOW (ES_STYLE_CAST(1383))
|
||||
define ES_STYLE_TEXT_TOOLBAR (ES_STYLE_CAST(1553))
|
||||
private define ES_STYLE_TASK_BAR_EXTRA (ES_STYLE_CAST(1507))
|
||||
define ES_STYLE_LIST_ITEM_TILE (ES_STYLE_CAST(1285))
|
||||
private define ES_STYLE_LIST_PRIMARY_CELL (ES_STYLE_CAST(1287))
|
||||
private define ES_STYLE_LIST_SECONDARY_CELL (ES_STYLE_CAST(1289))
|
||||
private define ES_STYLE_LIST_SELECTED_CHOICE_CELL (ES_STYLE_CAST(1621))
|
||||
private define ES_STYLE_LIST_SELECTION_BOX (ES_STYLE_CAST(1291))
|
||||
define ES_STYLE_LIST_VIEW (ES_STYLE_CAST(1293))
|
||||
define ES_STYLE_LIST_VIEW_BORDERED (ES_STYLE_CAST(1295))
|
||||
define ES_STYLE_LIST_DISPLAY_DEFAULT (ES_STYLE_CAST(1441))
|
||||
private define ES_STYLE_MARKER_DOWN_ARROW (ES_STYLE_CAST(1297))
|
||||
private define ES_STYLE_MARKER_UP_ARROW (ES_STYLE_CAST(1501))
|
||||
private define ES_STYLE_MENU_COLUMN (ES_STYLE_CAST(1321))
|
||||
private define ES_STYLE_MENU_CONTAINER (ES_STYLE_CAST(1323))
|
||||
private define ES_STYLE_MENU_ROOT (ES_STYLE_CAST(1325))
|
||||
private define ES_STYLE_MENU_ITEM_HEADER (ES_STYLE_CAST(1299))
|
||||
private define ES_STYLE_MENU_ITEM_NORMAL (ES_STYLE_CAST(1301))
|
||||
private define ES_STYLE_MENU_SEPARATOR_HORIZONTAL (ES_STYLE_CAST(1303))
|
||||
private define ES_STYLE_MENU_SEPARATOR_VERTICAL (ES_STYLE_CAST(1305))
|
||||
private define ES_STYLE_PANEL_CONTAINER_WINDOW_ROOT (ES_STYLE_CAST(1307))
|
||||
private define ES_STYLE_PANEL_CRASH_INFO (ES_STYLE_CAST(1309))
|
||||
define ES_STYLE_PANEL_DOCUMENT (ES_STYLE_CAST(1547))
|
||||
define ES_STYLE_PANEL_FILLED (ES_STYLE_CAST(1313))
|
||||
define ES_STYLE_PANEL_FORM_TABLE (ES_STYLE_CAST(1671))
|
||||
define ES_STYLE_PANEL_GROUP_BOX (ES_STYLE_CAST(1315))
|
||||
define ES_STYLE_PANEL_INSET (ES_STYLE_CAST(1641))
|
||||
define ES_STYLE_PANEL_POPUP (ES_STYLE_CAST(1331))
|
||||
define ES_STYLE_PANEL_SHEET (ES_STYLE_CAST(1333))
|
||||
private define ES_STYLE_PANEL_SHUTDOWN_OVERLAY (ES_STYLE_CAST(1335))
|
||||
define ES_STYLE_PANEL_STATUS_BAR (ES_STYLE_CAST(1489))
|
||||
define ES_STYLE_PANEL_TOOLBAR (ES_STYLE_CAST(1337))
|
||||
define ES_STYLE_PANEL_TOOLBAR_ROOT (ES_STYLE_CAST(1339))
|
||||
define ES_STYLE_PANEL_WINDOW_BACKGROUND (ES_STYLE_CAST(1341))
|
||||
define ES_STYLE_TEXTBOX_BORDERED_MULTILINE (ES_STYLE_CAST(1399))
|
||||
define ES_STYLE_PANEL_WINDOW_DIVIDER (ES_STYLE_CAST(1343))
|
||||
define ES_STYLE_PANEL_WINDOW_WITH_STATUS_BAR_CONTENT (ES_STYLE_CAST(1483))
|
||||
private define ES_STYLE_SLIDER_POINT (ES_STYLE_CAST(1607))
|
||||
define ES_STYLE_PUSH_BUTTON_DANGEROUS (ES_STYLE_CAST(1345))
|
||||
private define ES_STYLE_TEXTBOX_INLINE (ES_STYLE_CAST(1477))
|
||||
define ES_STYLE_PUSH_BUTTON_NORMAL (ES_STYLE_CAST(1347))
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE_COMPACT (ES_STYLE_CAST(1403))
|
||||
define ES_STYLE_TEXTBOX_NO_BORDER (ES_STYLE_CAST(1405))
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE (ES_STYLE_CAST(1401))
|
||||
define ES_STYLE_TEXTBOX_TRANSPARENT (ES_STYLE_CAST(1445))
|
||||
private define ES_STYLE_PUSH_BUTTON_NORMAL_COLOR_WELL (ES_STYLE_CAST(1349))
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_DOWN (ES_STYLE_CAST(1351))
|
||||
private define ES_STYLE_WINDOW_TAB_BAND_NEW (ES_STYLE_CAST(1361))
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_LEFT (ES_STYLE_CAST(1353))
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_RIGHT (ES_STYLE_CAST(1355))
|
||||
private define ES_STYLE_WINDOW_TAB_BAND (ES_STYLE_CAST(1411))
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_UP (ES_STYLE_CAST(1357))
|
||||
private define ES_STYLE_TEXTBOX_MARGIN (ES_STYLE_CAST(1415))
|
||||
define ES_STYLE_PUSH_BUTTON_STATUS_BAR (ES_STYLE_CAST(1495))
|
||||
define ES_STYLE_PUSH_BUTTON_TOOLBAR (ES_STYLE_CAST(1359))
|
||||
private define ES_STYLE_WINDOW_TAB_ACTIVE (ES_STYLE_CAST(1407))
|
||||
define ES_STYLE_PUSH_BUTTON_TOOLBAR_BIG (ES_STYLE_CAST(1457))
|
||||
private define ES_STYLE_SCROLLBAR_BAR_HORIZONTAL (ES_STYLE_CAST(1363))
|
||||
private define ES_STYLE_WINDOW_TAB_INACTIVE (ES_STYLE_CAST(1409))
|
||||
private define ES_STYLE_SCROLLBAR_BAR_VERTICAL (ES_STYLE_CAST(1365))
|
||||
private define ES_STYLE_SCROLLBAR_THUMB_HORIZONTAL (ES_STYLE_CAST(1367))
|
||||
private define ES_STYLE_SCROLLBAR_THUMB_VERTICAL (ES_STYLE_CAST(1369))
|
||||
define ES_STYLE_TOOLBAR_SPACER (ES_STYLE_CAST(5))
|
||||
define ES_STYLE_TOOLBAR_BUTTON_GROUP_SEPARATOR (ES_STYLE_CAST(7))
|
||||
define ES_STYLE_TOOLBAR_SPACER_SMALL (ES_STYLE_CAST(3))
|
||||
define ES_STYLE_LIST_CHOICE_ITEM_2X (ES_STYLE_CAST(9))
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM (ES_STYLE_CAST(11))
|
||||
define ES_STYLE_SEPARATOR_VERTICAL (ES_STYLE_CAST(13))
|
||||
private define ES_STYLE_TASK_BAR_LIST (ES_STYLE_CAST(15))
|
||||
define ES_STYLE_SEPARATOR_HORIZONTAL (0x800002AE)
|
||||
private define ES_STYLE_SCROLLBAR_PAD (0x800002AD)
|
||||
private define ES_STYLE_ACCESS_KEY_HINT (0x80000262)
|
||||
private define ES_STYLE_ANNOUNCEMENT (0x800002F3)
|
||||
private define ES_STYLE_BREADCRUMB_BAR_CRUMB (0x80000263)
|
||||
private define ES_STYLE_BREADCRUMB_BAR_OVERFLOW_ICON (0x80000264)
|
||||
private define ES_STYLE_BREADCRUMB_BAR_PANEL (0x80000265)
|
||||
define ES_STYLE_BUTTON_GROUP_CONTAINER (0x80000266)
|
||||
define ES_STYLE_BUTTON_GROUP_ITEM (0x80000267)
|
||||
define ES_STYLE_BUTTON_GROUP_SEPARATOR (0x80000268)
|
||||
private define ES_STYLE_CANVAS_SHADOW (0x800002D5)
|
||||
private define ES_STYLE_COLOR_HEX_TEXTBOX (0x8000026E)
|
||||
private define ES_STYLE_TASK_BAR_BAR (0x800002B1)
|
||||
private define ES_STYLE_SLIDER_TRACK (0x80000320)
|
||||
private define ES_STYLE_CHECKBOX_NORMAL (0x8000030B)
|
||||
private define ES_STYLE_SPLIT_BAR_VERTICAL (0x800002B0)
|
||||
private define ES_STYLE_WINDOW_TAB_CLOSE_BUTTON (0x800002DE)
|
||||
private define ES_STYLE_SPLIT_BAR_HORIZONTAL (0x800002AF)
|
||||
private define ES_STYLE_CHECKBOX_RADIOBOX (0x8000030F)
|
||||
define ES_STYLE_CLEAR_BACKGROUND (0x8000031E)
|
||||
private define ES_STYLE_COLOR_CHOSEN_POINT (0x8000026C)
|
||||
private define ES_STYLE_COLOR_CIRCLE (0x8000026D)
|
||||
private define ES_STYLE_TASK_BAR_BUTTON (0x800002B2)
|
||||
private define ES_STYLE_COLOR_PICKER_MAIN_PANEL (0x8000026F)
|
||||
private define ES_STYLE_COLOR_SLIDER (0x80000270)
|
||||
private define ES_STYLE_CONTAINER_WINDOW (0x80000271)
|
||||
private define ES_STYLE_CURSOR_LOCATOR (0x8000031B)
|
||||
define ES_STYLE_DIALOG_BUTTON_AREA (0x80000275)
|
||||
define ES_STYLE_DIALOG_CONTENT (0x80000276)
|
||||
define ES_STYLE_DIALOG_HEADING (0x80000277)
|
||||
define ES_STYLE_DIALOG_SHADOW (0x8000028F)
|
||||
private define ES_STYLE_DIALOG_WRAPPER (0x80000340)
|
||||
private define ES_STYLE_DOUBLE_CLICK_TEST (0x80000318)
|
||||
define ES_STYLE_ICON_DISPLAY (0x80000278)
|
||||
define ES_STYLE_ICON_DISPLAY_SMALL (0x80000303)
|
||||
define ES_STYLE_INSTALLER_ROOT (0x80000279)
|
||||
define ES_STYLE_LIST_CHOICE_BORDERED (0x800002CA)
|
||||
define ES_STYLE_LIST_CHOICE_ITEM (0x800002CD)
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER (0x8000027A)
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_ITEM (0x8000027B)
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_ITEM_HAS_MENU (0x8000027C)
|
||||
private define ES_STYLE_LIST_COLUMN_HEADER_SPLITTER (0x8000027D)
|
||||
private define ES_STYLE_LIST_GROUP_HEADER_CELL (0x8000027E)
|
||||
define ES_STYLE_LIST_ITEM (0x8000027F)
|
||||
define ES_STYLE_TEXT_RADIO_GROUP_LABEL (0x80000339)
|
||||
define ES_STYLE_TEXT_PARAGRAPH_SECONDARY (0x80000331)
|
||||
define ES_STYLE_TEXT_PARAGRAPH (0x800002BA)
|
||||
define ES_STYLE_TEXT_LABEL_SECONDARY (0x800002B9)
|
||||
define ES_STYLE_TEXT_LABEL_INVERTED (0x800002B8)
|
||||
define ES_STYLE_LIST_ITEM_GROUP_FOOTER (0x80000280)
|
||||
define ES_STYLE_TEXT_LABEL (0x800002B7)
|
||||
private define ES_STYLE_TEXT_HEADING3 (0x800002C7)
|
||||
define ES_STYLE_TEXT_HEADING2 (0x800002B6)
|
||||
define ES_STYLE_TEXT_HEADING1 (0x80000316)
|
||||
define ES_STYLE_TEXT_HEADING0 (0x800002B5)
|
||||
define ES_STYLE_LIST_ITEM_GROUP_HEADER (0x80000281)
|
||||
private define ES_STYLE_TASK_BAR_NEW_WINDOW (0x800002B3)
|
||||
define ES_STYLE_TEXT_TOOLBAR (0x80000308)
|
||||
private define ES_STYLE_TASK_BAR_EXTRA (0x800002F1)
|
||||
define ES_STYLE_LIST_ITEM_TILE (0x80000282)
|
||||
private define ES_STYLE_LIST_PRIMARY_CELL (0x80000283)
|
||||
private define ES_STYLE_LIST_SECONDARY_CELL (0x80000284)
|
||||
private define ES_STYLE_LIST_SELECTED_CHOICE_CELL (0x8000032A)
|
||||
private define ES_STYLE_LIST_SELECTION_BOX (0x80000285)
|
||||
define ES_STYLE_LIST_VIEW (0x80000286)
|
||||
define ES_STYLE_LIST_VIEW_BORDERED (0x80000287)
|
||||
define ES_STYLE_LIST_DISPLAY_DEFAULT (0x800002D0)
|
||||
private define ES_STYLE_MARKER_DOWN_ARROW (0x80000288)
|
||||
private define ES_STYLE_MARKER_UP_ARROW (0x800002EE)
|
||||
private define ES_STYLE_MENU_COLUMN (0x80000294)
|
||||
private define ES_STYLE_MENU_CONTAINER (0x80000295)
|
||||
private define ES_STYLE_MENU_ROOT (0x80000296)
|
||||
private define ES_STYLE_MENU_ITEM_HEADER (0x80000289)
|
||||
private define ES_STYLE_MENU_ITEM_NORMAL (0x8000028A)
|
||||
private define ES_STYLE_MENU_SEPARATOR_HORIZONTAL (0x8000028B)
|
||||
private define ES_STYLE_MENU_SEPARATOR_VERTICAL (0x8000028C)
|
||||
private define ES_STYLE_PANEL_CONTAINER_WINDOW_ROOT (0x8000028D)
|
||||
private define ES_STYLE_PANEL_CRASH_INFO (0x8000028E)
|
||||
define ES_STYLE_PANEL_DOCUMENT (0x80000305)
|
||||
define ES_STYLE_PANEL_FILLED (0x80000290)
|
||||
define ES_STYLE_PANEL_FORM_TABLE (0x80000343)
|
||||
define ES_STYLE_PANEL_GROUP_BOX (0x80000291)
|
||||
define ES_STYLE_PANEL_INSET (0x80000334)
|
||||
define ES_STYLE_PANEL_POPUP (0x80000299)
|
||||
define ES_STYLE_PANEL_SHEET (0x8000029A)
|
||||
private define ES_STYLE_PANEL_SHUTDOWN_OVERLAY (0x8000029B)
|
||||
define ES_STYLE_PANEL_STATUS_BAR (0x800002E8)
|
||||
define ES_STYLE_PANEL_TOOLBAR (0x8000029C)
|
||||
define ES_STYLE_PANEL_TOOLBAR_ROOT (0x8000029D)
|
||||
define ES_STYLE_PANEL_WINDOW_BACKGROUND (0x8000029E)
|
||||
define ES_STYLE_TEXTBOX_BORDERED_MULTILINE (0x800002BB)
|
||||
define ES_STYLE_PANEL_WINDOW_DIVIDER (0x8000029F)
|
||||
define ES_STYLE_PANEL_WINDOW_WITH_STATUS_BAR_CONTENT (0x800002E5)
|
||||
private define ES_STYLE_SLIDER_POINT (0x80000323)
|
||||
define ES_STYLE_PUSH_BUTTON_DANGEROUS (0x800002A0)
|
||||
private define ES_STYLE_TEXTBOX_INLINE (0x800002E2)
|
||||
define ES_STYLE_PUSH_BUTTON_NORMAL (0x800002A1)
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE_COMPACT (0x800002BD)
|
||||
define ES_STYLE_TEXTBOX_NO_BORDER (0x800002BE)
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE (0x800002BC)
|
||||
define ES_STYLE_TEXTBOX_TRANSPARENT (0x800002D2)
|
||||
private define ES_STYLE_PUSH_BUTTON_NORMAL_COLOR_WELL (0x800002A2)
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_DOWN (0x800002A3)
|
||||
private define ES_STYLE_WINDOW_TAB_BAND_NEW (0x800002A8)
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_LEFT (0x800002A4)
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_RIGHT (0x800002A5)
|
||||
private define ES_STYLE_WINDOW_TAB_BAND (0x800002C1)
|
||||
private define ES_STYLE_PUSH_BUTTON_SCROLLBAR_UP (0x800002A6)
|
||||
private define ES_STYLE_TEXTBOX_MARGIN (0x800002C3)
|
||||
define ES_STYLE_PUSH_BUTTON_STATUS_BAR (0x800002EB)
|
||||
define ES_STYLE_PUSH_BUTTON_TOOLBAR (0x800002A7)
|
||||
private define ES_STYLE_WINDOW_TAB_ACTIVE (0x800002BF)
|
||||
define ES_STYLE_PUSH_BUTTON_TOOLBAR_BIG (0x800002D8)
|
||||
private define ES_STYLE_SCROLLBAR_BAR_HORIZONTAL (0x800002A9)
|
||||
private define ES_STYLE_WINDOW_TAB_INACTIVE (0x800002C0)
|
||||
private define ES_STYLE_SCROLLBAR_BAR_VERTICAL (0x800002AA)
|
||||
private define ES_STYLE_SCROLLBAR_THUMB_HORIZONTAL (0x800002AB)
|
||||
private define ES_STYLE_SCROLLBAR_THUMB_VERTICAL (0x800002AC)
|
||||
define ES_STYLE_TOOLBAR_SPACER (0x80000002)
|
||||
define ES_STYLE_TOOLBAR_BUTTON_GROUP_SEPARATOR (0x80000003)
|
||||
define ES_STYLE_TOOLBAR_SPACER_SMALL (0x80000001)
|
||||
define ES_STYLE_LIST_CHOICE_ITEM_2X (0x80000004)
|
||||
define ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM (0x80000005)
|
||||
define ES_STYLE_SEPARATOR_VERTICAL (0x80000006)
|
||||
private define ES_STYLE_TASK_BAR_LIST (0x80000007)
|
||||
|
|
|
@ -2537,7 +2537,7 @@ void EsDrawTextSimple(EsPainter *painter, EsElement *element, EsRectangle bounds
|
|||
EsDrawText(painter, EsTextPlanCreate(element, &properties, bounds, string, textRuns, 1), bounds);
|
||||
}
|
||||
|
||||
void EsDrawTextThemed(EsPainter *painter, EsElement *element, EsRectangle bounds, const char *string, ptrdiff_t stringBytes, const EsStyle *style, uint32_t flags) {
|
||||
void EsDrawTextThemed(EsPainter *painter, EsElement *element, EsRectangle bounds, const char *string, ptrdiff_t stringBytes, EsStyleID style, uint32_t flags) {
|
||||
EsTextStyle textStyle;
|
||||
GetStyle(MakeStyleKey(style, 0), true)->GetTextStyle(&textStyle);
|
||||
EsDrawTextSimple(painter, element, bounds, string, stringBytes, textStyle, flags);
|
||||
|
|
|
@ -1946,7 +1946,7 @@ int ProcessTextboxMessage(EsElement *element, EsMessage *message) {
|
|||
return response;
|
||||
}
|
||||
|
||||
EsTextbox *EsTextboxCreate(EsElement *parent, uint64_t flags, const EsStyle *style) {
|
||||
EsTextbox *EsTextboxCreate(EsElement *parent, uint64_t flags, EsStyleID style) {
|
||||
EsTextbox *textbox = (EsTextbox *) EsHeapAllocate(sizeof(EsTextbox), true);
|
||||
if (!textbox) return nullptr;
|
||||
|
||||
|
|
|
@ -236,7 +236,8 @@ typedef struct ThemeStyle {
|
|||
// **This must be the first field in the structure; see the end of Export in util/designer2.cpp.**
|
||||
uint32_t layerListOffset;
|
||||
|
||||
uint16_t id;
|
||||
uint32_t id;
|
||||
uint16_t _unused0;
|
||||
uint8_t layerCount;
|
||||
uint8_t _unused1;
|
||||
Rectangle8 paintOutsets, opaqueInsets, approximateBorders;
|
||||
|
@ -331,7 +332,7 @@ static const float gaussLookup[] = {
|
|||
|
||||
#ifndef IN_DESIGNER
|
||||
struct UIStyleKey {
|
||||
uintptr_t part;
|
||||
EsStyleID part;
|
||||
float scale;
|
||||
uint16_t stateFlags;
|
||||
uint16_t _unused1;
|
||||
|
@ -346,6 +347,7 @@ struct {
|
|||
float scale;
|
||||
HashStore<UIStyleKey, struct UIStyle *> loadedStyles;
|
||||
uint32_t windowColors[6];
|
||||
Array<EsStyle> internedStyles;
|
||||
} theming;
|
||||
#endif
|
||||
|
||||
|
@ -1212,7 +1214,7 @@ struct UIStyle {
|
|||
uint32_t observedStyleStateMask;
|
||||
EsRectangle paintOutsets, opaqueInsets;
|
||||
float scale;
|
||||
EsThemeAppearance *appearance; // An optional, custom appearance provided by the application.
|
||||
ptrdiff_t appearanceIndex; // An optional, custom appearance provided by the application.
|
||||
|
||||
// Data.
|
||||
|
||||
|
@ -1241,6 +1243,8 @@ struct UIStyle {
|
|||
};
|
||||
|
||||
void ThemeInitialise() {
|
||||
EsMessageMutexCheck();
|
||||
|
||||
if (theming.initialised) return;
|
||||
theming.initialised = true;
|
||||
|
||||
|
@ -1523,8 +1527,7 @@ void ThemeAnimationBuild(ThemeAnimation *animation, UIStyle *oldStyle, uint16_t
|
|||
_ThemeAnimationBuildAddProperties(animation, oldStyle, newStateFlags);
|
||||
}
|
||||
|
||||
void ThemeStylePrepare(UIStyle *style, UIStyleKey key) {
|
||||
EsStyle *esStyle = (key.part & 1) || (!key.part) ? nullptr : (EsStyle *) (key.part);
|
||||
void ThemeStylePrepare(UIStyle *style, EsStyle *esStyle, UIStyleKey key) {
|
||||
EsThemeMetrics *customMetrics = esStyle ? &esStyle->metrics : nullptr;
|
||||
const ThemeStyle *themeStyle = style->style;
|
||||
|
||||
|
@ -1559,9 +1562,7 @@ void ThemeStylePrepare(UIStyle *style, UIStyleKey key) {
|
|||
if (customMetrics->mask & ES_THEME_METRICS_LAYOUT_VERTICAL) style->metrics->layoutVertical = customMetrics->layoutVertical;
|
||||
}
|
||||
|
||||
if (esStyle && esStyle->appearance.enabled) {
|
||||
style->appearance = &esStyle->appearance;
|
||||
}
|
||||
style->appearanceIndex = esStyle && esStyle->appearance.enabled ? (ptrdiff_t) (key.part - 1) : -1;
|
||||
|
||||
// Apply scaling to the metrics.
|
||||
|
||||
|
@ -1600,8 +1601,10 @@ void ThemeStylePrepare(UIStyle *style, UIStyleKey key) {
|
|||
style->opaqueInsets.b = themeStyle->opaqueInsets.b * key.scale;
|
||||
}
|
||||
|
||||
if (style->appearance) {
|
||||
if ((style->appearance->backgroundColor & 0xFF000000) == 0xFF000000) {
|
||||
if (style->appearanceIndex != -1) {
|
||||
EsThemeAppearance *appearance = &theming.internedStyles[style->appearanceIndex].appearance;
|
||||
|
||||
if ((appearance->backgroundColor & 0xFF000000) == 0xFF000000) {
|
||||
style->opaqueInsets = ES_RECT_1(0);
|
||||
} else {
|
||||
style->opaqueInsets = ES_RECT_1(0x7F);
|
||||
|
@ -1616,9 +1619,8 @@ UIStyle *ThemeStyleInitialise(UIStyleKey key) {
|
|||
|
||||
// Find the ThemeStyle entry.
|
||||
|
||||
EsStyle *esStyle = (key.part & 1) || (!key.part) ? nullptr : (EsStyle *) (key.part);
|
||||
uint16_t id = esStyle ? (uint16_t) (uintptr_t) esStyle->inherit : key.part;
|
||||
if (!id) id = 1;
|
||||
EsStyle *esStyle = (key.part & 0x80000000) || (!key.part) ? nullptr : &theming.internedStyles[key.part - 1];
|
||||
EsStyleID id = (esStyle ? esStyle->inherit : key.part) & ~0x80000000;
|
||||
|
||||
EsBuffer data = theming.system;
|
||||
const ThemeHeader *header = (const ThemeHeader *) EsBufferRead(&data, sizeof(ThemeHeader));
|
||||
|
@ -1804,12 +1806,27 @@ UIStyle *ThemeStyleInitialise(UIStyleKey key) {
|
|||
layerDataByteCount += layer->dataByteCount;
|
||||
}
|
||||
|
||||
ThemeStylePrepare(style, key);
|
||||
ThemeStylePrepare(style, esStyle, key);
|
||||
return style;
|
||||
}
|
||||
|
||||
UIStyleKey MakeStyleKey(const EsStyle *style, uint16_t stateFlags) {
|
||||
return { .part = (uintptr_t) style, .scale = theming.scale, .stateFlags = stateFlags };
|
||||
UIStyleKey MakeStyleKey(EsStyleID style, uint16_t stateFlags) {
|
||||
return { .part = style, .scale = theming.scale, .stateFlags = stateFlags };
|
||||
}
|
||||
|
||||
EsStyleID EsStyleIntern(const EsStyle *style) {
|
||||
// TODO Faster lookup.
|
||||
|
||||
EsMessageMutexCheck();
|
||||
|
||||
for (uintptr_t i = 0; i < theming.internedStyles.Length(); i++) {
|
||||
if (0 == EsMemoryCompare(&theming.internedStyles[i], style, sizeof(EsStyle))) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
theming.internedStyles.AddPointer(style);
|
||||
return theming.internedStyles.Length();
|
||||
}
|
||||
|
||||
void FreeUnusedStyles(bool includePermanentStyles) {
|
||||
|
@ -1843,7 +1860,7 @@ UIStyle *GetStyle(UIStyleKey key, bool keepAround) {
|
|||
return *style;
|
||||
}
|
||||
|
||||
void GetPreferredSizeFromStylePart(const EsStyle *esStyle, int64_t *width, int64_t *height) {
|
||||
void GetPreferredSizeFromStylePart(EsStyleID esStyle, int64_t *width, int64_t *height) {
|
||||
UIStyle *style = GetStyle(MakeStyleKey(esStyle, ES_FLAGS_DEFAULT), true);
|
||||
if (width) *width = style->preferredWidth;
|
||||
if (height) *height = style->preferredHeight;
|
||||
|
@ -1917,7 +1934,7 @@ void UIStyle::PaintText(EsPainter *painter, EsElement *element, EsRectangle rect
|
|||
}
|
||||
|
||||
if (flags & (ES_DRAW_CONTENT_MARKER_DOWN_ARROW | ES_DRAW_CONTENT_MARKER_UP_ARROW)) {
|
||||
EsStyle *part = (flags & ES_DRAW_CONTENT_MARKER_DOWN_ARROW) ? ES_STYLE_MARKER_DOWN_ARROW : ES_STYLE_MARKER_UP_ARROW;
|
||||
EsStyleID part = (flags & ES_DRAW_CONTENT_MARKER_DOWN_ARROW) ? ES_STYLE_MARKER_DOWN_ARROW : ES_STYLE_MARKER_UP_ARROW;
|
||||
UIStyle *style = GetStyle(MakeStyleKey(part, 0), true);
|
||||
textBounds.r -= style->preferredWidth + gapMinor;
|
||||
EsRectangle location = ES_RECT_4PD(bounds.r - style->preferredWidth - painter->offsetX,
|
||||
|
@ -2011,8 +2028,9 @@ void UIStyle::PaintLayers(EsPainter *painter, EsRectangle location, int childTyp
|
|||
_bounds.t + opaqueInsets.t, _bounds.b - opaqueInsets.b);
|
||||
}
|
||||
|
||||
if (appearance && whichLayers == 0) {
|
||||
EsDrawRectangle(painter, _bounds, appearance->backgroundColor, appearance->borderColor, appearance->borderSize);
|
||||
if (appearanceIndex != -1 && whichLayers == 0) {
|
||||
EsThemeAppearance *themeAppearance = &theming.internedStyles[appearanceIndex].appearance;
|
||||
EsDrawRectangle(painter, _bounds, themeAppearance->backgroundColor, themeAppearance->borderColor, themeAppearance->borderSize);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
BIN
res/Theme.dat
BIN
res/Theme.dat
Binary file not shown.
|
@ -424,6 +424,7 @@ EsSliderSetValue=422
|
|||
EsClipboardCloseAndAdd=423
|
||||
EsListViewFixedItemInsert=424
|
||||
EsListViewFixedItemSetInteger=425
|
||||
EsStyleIntern=426
|
||||
EsListViewFixedItemSelect=427
|
||||
EsListViewFixedItemGetSelected=428
|
||||
EsClipboardHasFormat=429
|
||||
|
|
|
@ -1935,8 +1935,8 @@ void InstanceCreate(EsMessage *message) {
|
|||
EsCommandRegister(&commandLaunch, instance, INTERFACE_STRING(BuildCoreLaunch), CommandLaunch, 2, "F6", false);
|
||||
EsWindowSetIcon(instance->window, ES_ICON_TEXT_X_MAKEFILE);
|
||||
EsPanel *panelRoot = EsPanelCreate(instance->window, ES_CELL_FILL, ES_STYLE_PANEL_WINDOW_BACKGROUND);
|
||||
EsPanel *panelStack = EsPanelCreate(panelRoot, ES_CELL_FILL | ES_PANEL_HORIZONTAL, &stylePanelStack);
|
||||
EsPanel *panelButtonStack = EsPanelCreate(panelStack, ES_CELL_V_TOP | ES_PANEL_VERTICAL, &stylePanelButtonStack);
|
||||
EsPanel *panelStack = EsPanelCreate(panelRoot, ES_CELL_FILL | ES_PANEL_HORIZONTAL, EsStyleIntern(&stylePanelStack));
|
||||
EsPanel *panelButtonStack = EsPanelCreate(panelStack, ES_CELL_V_TOP | ES_PANEL_VERTICAL, EsStyleIntern(&stylePanelButtonStack));
|
||||
buttonBuild = EsButtonCreate(panelButtonStack, ES_BUTTON_DEFAULT, ES_NULL, INTERFACE_STRING(BuildCoreBuild));
|
||||
EsCommandAddButton(&commandBuild, buttonBuild);
|
||||
buttonBuild->accessKey = 'B';
|
||||
|
@ -1944,7 +1944,7 @@ void InstanceCreate(EsMessage *message) {
|
|||
EsCommandAddButton(&commandLaunch, buttonLaunch);
|
||||
buttonLaunch->accessKey = 'L';
|
||||
EsSpacerCreate(panelStack, ES_CELL_V_FILL, ES_STYLE_SEPARATOR_VERTICAL, 0, 0);
|
||||
textboxLog = EsTextboxCreate(panelStack, ES_TEXTBOX_MULTILINE | ES_CELL_FILL, &styleTextboxLog);
|
||||
textboxLog = EsTextboxCreate(panelStack, ES_TEXTBOX_MULTILINE | ES_CELL_FILL, EsStyleIntern(&styleTextboxLog));
|
||||
textboxLog->accessKey = 'O';
|
||||
EsTextboxSetReadOnly(textboxLog, true);
|
||||
}
|
||||
|
|
|
@ -3407,7 +3407,7 @@ void Export() {
|
|||
}
|
||||
}
|
||||
|
||||
fprintf(output, " (ES_STYLE_CAST(%d))\n", (headerID << 1) | 1);
|
||||
fprintf(output, " (0x%.8X)\n", 0x80000000 | headerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3441,7 +3441,7 @@ void Export() {
|
|||
|
||||
int32_t headerID = PropertyReadInt32(object, "headerID");
|
||||
ThemeStyle entry = {};
|
||||
entry.id = (headerID << 1) | 1;
|
||||
entry.id = (uint32_t) headerID;
|
||||
entry.layerCount = 1;
|
||||
|
||||
Object *appearance = PropertyFindOrInheritReadObject(object, "appearance");
|
||||
|
|
|
@ -956,45 +956,39 @@ void OutputOdin(Entry *root) {
|
|||
if (entry->isPrivate) continue;
|
||||
|
||||
if (entry->type == ENTRY_DEFINE) {
|
||||
const char *styleCast = strstr(entry->define.value, "STYLE_CAST(");
|
||||
const char *name = TrimPrefix(entry->name);
|
||||
const char *value = OdinReplaceTypes(entry->define.value, false);
|
||||
|
||||
if (styleCast) {
|
||||
FilePrintFormat(output, "%s :: (^Style)(uintptr(%d));\n", TrimPrefix(entry->name), atoi(styleCast + 11));
|
||||
} else {
|
||||
const char *name = TrimPrefix(entry->name);
|
||||
const char *value = OdinReplaceTypes(entry->define.value, false);
|
||||
const char *enumPrefix = NULL;
|
||||
char e[64];
|
||||
int ep = 0;
|
||||
|
||||
const char *enumPrefix = NULL;
|
||||
char e[64];
|
||||
int ep = 0;
|
||||
|
||||
for (uintptr_t i = 0; value[i]; i++) {
|
||||
if (value[i] == ' ' || value[i] == '(' || value[i] == ')'
|
||||
|| value[i] == '\t' || ep == sizeof(e) - 1) {
|
||||
// Ignore.
|
||||
} else {
|
||||
e[ep++] = value[i];
|
||||
e[ep] = 0;
|
||||
}
|
||||
for (uintptr_t i = 0; value[i]; i++) {
|
||||
if (value[i] == ' ' || value[i] == '(' || value[i] == ')'
|
||||
|| value[i] == '\t' || ep == sizeof(e) - 1) {
|
||||
// Ignore.
|
||||
} else {
|
||||
e[ep++] = value[i];
|
||||
e[ep] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < arrlen(root->children); i++) {
|
||||
if (root->children[i].type == ENTRY_ENUM) {
|
||||
for (int j = 0; j < arrlen(root->children[i].children); j++) {
|
||||
const char *enumName = TrimPrefix(root->children[i].children[j].name);
|
||||
for (int i = 0; i < arrlen(root->children); i++) {
|
||||
if (root->children[i].type == ENTRY_ENUM) {
|
||||
for (int j = 0; j < arrlen(root->children[i].children); j++) {
|
||||
const char *enumName = TrimPrefix(root->children[i].children[j].name);
|
||||
|
||||
if (0 == strcmp(enumName, e)) {
|
||||
enumPrefix = TrimPrefix(root->children[i].name);
|
||||
value = enumName;
|
||||
goto gotEnumPrefix;
|
||||
}
|
||||
if (0 == strcmp(enumName, e)) {
|
||||
enumPrefix = TrimPrefix(root->children[i].name);
|
||||
value = enumName;
|
||||
goto gotEnumPrefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gotEnumPrefix:;
|
||||
FilePrintFormat(output, "%s :: %s%s%s;\n", name, enumPrefix ? enumPrefix : "", enumPrefix ? "." : "", value);
|
||||
}
|
||||
|
||||
gotEnumPrefix:;
|
||||
FilePrintFormat(output, "%s :: %s%s%s;\n", name, enumPrefix ? enumPrefix : "", enumPrefix ? "." : "", value);
|
||||
} else if (entry->type == ENTRY_STRUCT) {
|
||||
FilePrintFormat(output, "%s :: struct {\n", TrimPrefix(entry->name));
|
||||
OutputOdinRecord(entry, 0);
|
||||
|
@ -1065,10 +1059,6 @@ char *ZigRemoveTabs(const char *string) {
|
|||
void OutputZigType(Entry *entry) {
|
||||
if (0 == strcmp(entry->variable.type, "void") && entry->variable.pointer) {
|
||||
entry->variable.type = (char *) "u8";
|
||||
} else if (0 == strcmp(entry->variable.type, "EsStyle")) {
|
||||
assert(entry->variable.pointer);
|
||||
entry->variable.type = (char *) "usize";
|
||||
entry->variable.pointer--;
|
||||
}
|
||||
|
||||
FilePrintFormat(output, "%c%.*s%s%s",
|
||||
|
@ -1211,7 +1201,6 @@ void OutputZig(Entry *root) {
|
|||
FilePrintFormat(output, "const INSTANCE_TYPE = Instance;\n");
|
||||
FilePrintFormat(output, "pub const STRING = extern struct { ptr : [*] const u8, len : usize, };\n");
|
||||
FilePrintFormat(output, "pub fn Str(x : [] const u8) STRING { return STRING { .ptr = x.ptr, .len = x.len }; }\n");
|
||||
FilePrintFormat(output, "fn STYLE_CAST (x : isize) isize { return x; }\n");
|
||||
|
||||
for (int i = 0; i < arrlen(root->children); i++) {
|
||||
Entry *entry = root->children + i;
|
||||
|
@ -1263,6 +1252,7 @@ void Analysis(Entry *root) {
|
|||
Entry *resolved = NULL;
|
||||
Entry *unresolved = NULL;
|
||||
bool understood = false;
|
||||
const char *unresolvableName = NULL;
|
||||
|
||||
for (int i = 0; i < arrlen(entry->annotations); i++) {
|
||||
Entry *annotation = entry->annotations + i;
|
||||
|
@ -1314,10 +1304,6 @@ void Analysis(Entry *root) {
|
|||
goto resolved;
|
||||
}
|
||||
|
||||
if (e.variable.pointer == 1 && e.variable.isConst && (0 == strcmp(e.variable.type, "EsStyle"))) {
|
||||
goto resolved;
|
||||
}
|
||||
|
||||
for (int k = 0; k < arrlen(root->children); k++) {
|
||||
if (!root->children[k].name) continue;
|
||||
if (strcmp(e.variable.type, root->children[k].name)) continue;
|
||||
|
@ -1452,6 +1438,7 @@ void Analysis(Entry *root) {
|
|||
}
|
||||
}
|
||||
|
||||
unresolvableName = e.name;
|
||||
goto end;
|
||||
resolved:;
|
||||
arrput(resolved, e);
|
||||
|
@ -1475,7 +1462,10 @@ void Analysis(Entry *root) {
|
|||
}
|
||||
}
|
||||
|
||||
assert(hasTODOMarker == !understood);
|
||||
if (hasTODOMarker == understood) {
|
||||
Log("%s %s\n", entry->children[0].name, unresolvableName);
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue