mirror of https://gitlab.com/nakst/essence
remove ES_LIST_VIEW_NON_LINEAR
This commit is contained in:
parent
7e65dafaa9
commit
2b5e5f53a0
|
@ -284,7 +284,7 @@ void BookmarkAdd(String path, bool saveConfiguration = true) {
|
|||
if (saveConfiguration) ConfigurationSave();
|
||||
|
||||
for (uintptr_t i = 0; i < instances.Length(); i++) {
|
||||
EsListViewInsert(instances[i]->placesView, PLACES_VIEW_GROUP_BOOKMARKS, bookmarks.Length(), bookmarks.Length());
|
||||
EsListViewInsert(instances[i]->placesView, PLACES_VIEW_GROUP_BOOKMARKS, bookmarks.Length(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ void BookmarkRemove(String path) {
|
|||
bookmarks.Delete(i);
|
||||
|
||||
for (uintptr_t i = 0; i < instances.Length(); i++) {
|
||||
EsListViewRemove(instances[i]->placesView, PLACES_VIEW_GROUP_BOOKMARKS, i + 1, i + 1);
|
||||
EsListViewRemove(instances[i]->placesView, PLACES_VIEW_GROUP_BOOKMARKS, i + 1, 1);
|
||||
}
|
||||
|
||||
ConfigurationSave();
|
||||
|
|
|
@ -420,7 +420,7 @@ void DriveRemove(const char *prefix, size_t prefixBytes) {
|
|||
found = true;
|
||||
|
||||
for (uintptr_t i = 0; i < instances.Length(); i++) {
|
||||
EsListViewRemove(instances[i]->placesView, PLACES_VIEW_GROUP_DRIVES, index, index);
|
||||
EsListViewRemove(instances[i]->placesView, PLACES_VIEW_GROUP_DRIVES, index, 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -457,7 +457,7 @@ void DriveAdd(const char *prefix, size_t prefixBytes) {
|
|||
drives.Add(drive);
|
||||
|
||||
for (uintptr_t i = 0; i < instances.Length(); i++) {
|
||||
EsListViewInsert(instances[i]->placesView, PLACES_VIEW_GROUP_DRIVES, drives.Length(), drives.Length());
|
||||
EsListViewInsert(instances[i]->placesView, PLACES_VIEW_GROUP_DRIVES, drives.Length(), 1);
|
||||
}
|
||||
|
||||
EsMutexRelease(&drivesMutex);
|
||||
|
|
|
@ -60,10 +60,10 @@ bool InstanceLoadFolder(Instance *instance, String path /* takes ownership */, i
|
|||
HistoryEntry historyEntry = {};
|
||||
historyEntry.path = instance->path;
|
||||
|
||||
EsGeneric focusedIndex;
|
||||
EsListViewIndex focusedIndex;
|
||||
|
||||
if (EsListViewGetFocusedItem(instance->list, nullptr, &focusedIndex)) {
|
||||
String name = instance->listContents[focusedIndex.u].entry->GetName();
|
||||
String name = instance->listContents[focusedIndex].entry->GetName();
|
||||
historyEntry.focusedItem = StringDuplicate(name);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ void InstanceAddSingle(Instance *instance, ListEntry entry) {
|
|||
}
|
||||
|
||||
instance->listContents.Insert(entry, low);
|
||||
EsListViewInsert(instance->list, 0, low, low);
|
||||
EsListViewInsert(instance->list, 0, low, 1);
|
||||
|
||||
if (entry.selected) {
|
||||
EsListViewSelect(instance->list, 0, low);
|
||||
|
@ -344,13 +344,13 @@ void InstanceAddContents(Instance *instance, HashTable *newEntries) {
|
|||
}
|
||||
|
||||
if (oldListEntryCount) {
|
||||
EsListViewRemove(instance->list, 0, 0, oldListEntryCount - 1);
|
||||
EsListViewRemove(instance->list, 0, 0, oldListEntryCount);
|
||||
}
|
||||
|
||||
InstanceSortListContents(instance->listContents.array, instance->listContents.Length(), instance->viewSettings.sortColumn);
|
||||
|
||||
if (instance->listContents.Length()) {
|
||||
EsListViewInsert(instance->list, 0, 0, instance->listContents.Length() - 1);
|
||||
EsListViewInsert(instance->list, 0, 0, instance->listContents.Length());
|
||||
|
||||
if (instance->delayedFocusItem.bytes) {
|
||||
for (uintptr_t i = 0; i < instance->listContents.Length(); i++) {
|
||||
|
@ -378,7 +378,7 @@ ListEntry InstanceRemoveSingle(Instance *instance, FolderEntry *folderEntry) {
|
|||
if (compare == 0) {
|
||||
ListEntry entry = instance->listContents[middle];
|
||||
InstanceRemoveInternal(instance, &entry);
|
||||
EsListViewRemove(instance->list, 0, middle, middle);
|
||||
EsListViewRemove(instance->list, 0, middle, 1);
|
||||
instance->listContents.Delete(middle);
|
||||
InstanceUpdateStatusString(instance);
|
||||
return entry;
|
||||
|
@ -401,7 +401,7 @@ void InstanceRemoveContents(Instance *instance) {
|
|||
EsAssert(instance->selectedItemCount == 0); // After removing all items none should be selected.
|
||||
|
||||
if (instance->listContents.Length()) {
|
||||
EsListViewRemove(instance->list, 0, 0, instance->listContents.Length() - 1);
|
||||
EsListViewRemove(instance->list, 0, 0, instance->listContents.Length());
|
||||
EsListViewContentChanged(instance->list);
|
||||
}
|
||||
|
||||
|
@ -609,7 +609,7 @@ void ListItemGenerateThumbnailTaskComplete(Instance *, Task *task) {
|
|||
|
||||
Thumbnail *ListItemGetThumbnail(EsElement *element) {
|
||||
Instance *instance = element->instance;
|
||||
ListEntry *entry = &instance->listContents[EsListViewGetIndexFromItem(element).u];
|
||||
ListEntry *entry = &instance->listContents[EsListViewGetIndexFromItem(element)];
|
||||
Thumbnail *thumbnail = thumbnailCache.Get(&entry->entry->id);
|
||||
return thumbnail;
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
Instance *instance = element->instance;
|
||||
|
||||
if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
|
||||
int column = message->getContent.column, index = message->getContent.index.i;
|
||||
int column = message->getContent.column, index = message->getContent.index;
|
||||
EsAssert(index < (int) instance->listContents.Length() && index >= 0);
|
||||
ListEntry *listEntry = &instance->listContents[index];
|
||||
FolderEntry *entry = listEntry->entry;
|
||||
|
@ -704,7 +704,7 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
}
|
||||
}
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_GET_SUMMARY) {
|
||||
int index = message->getContent.index.i;
|
||||
int index = message->getContent.index;
|
||||
EsAssert(index < (int) instance->listContents.Length() && index >= 0);
|
||||
ListEntry *listEntry = &instance->listContents[index];
|
||||
FolderEntry *entry = listEntry->entry;
|
||||
|
@ -714,7 +714,7 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
message->getContent.icon = fileType->iconID;
|
||||
message->getContent.richText = true;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_SELECT_RANGE) {
|
||||
for (intptr_t i = message->selectRange.fromIndex.i; i <= message->selectRange.toIndex.i; i++) {
|
||||
for (intptr_t i = message->selectRange.fromIndex; i <= message->selectRange.toIndex; i++) {
|
||||
ListEntry *entry = &instance->listContents[i];
|
||||
if (entry->selected) { instance->selectedItemCount--; instance->selectedItemsTotalSize -= entry->entry->size; }
|
||||
entry->selected = message->selectRange.toggle ? !entry->selected : message->selectRange.select;
|
||||
|
@ -725,7 +725,7 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
StringDestroy(&instance->delayedFocusItem);
|
||||
InstanceUpdateStatusString(instance);
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_SELECT) {
|
||||
ListEntry *entry = &instance->listContents[message->selectItem.index.i];
|
||||
ListEntry *entry = &instance->listContents[message->selectItem.index];
|
||||
if (entry->selected) { instance->selectedItemCount--; instance->selectedItemsTotalSize -= entry->entry->size; }
|
||||
entry->selected = message->selectItem.isSelected;
|
||||
if (entry->selected) { instance->selectedItemCount++; instance->selectedItemsTotalSize += entry->entry->size; }
|
||||
|
@ -733,10 +733,10 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
StringDestroy(&instance->delayedFocusItem);
|
||||
InstanceUpdateStatusString(instance);
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_IS_SELECTED) {
|
||||
ListEntry *entry = &instance->listContents[message->selectItem.index.i];
|
||||
ListEntry *entry = &instance->listContents[message->selectItem.index];
|
||||
message->selectItem.isSelected = entry->selected;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_CHOOSE_ITEM) {
|
||||
ListEntry *listEntry = &instance->listContents[message->chooseItem.index.i];
|
||||
ListEntry *listEntry = &instance->listContents[message->chooseItem.index];
|
||||
|
||||
if (listEntry) {
|
||||
FolderEntry *entry = listEntry->entry;
|
||||
|
@ -777,7 +777,7 @@ int ListCallback(EsElement *element, EsMessage *message) {
|
|||
} else if (message->type == ES_MSG_LIST_VIEW_CREATE_ITEM) {
|
||||
EsElement *element = message->createItem.item;
|
||||
element->messageUser = ListItemMessage;
|
||||
ListItemCreated(element, message->createItem.index.u, false);
|
||||
ListItemCreated(element, message->createItem.index, false);
|
||||
} else if (message->type == ES_MSG_MOUSE_RIGHT_CLICK) {
|
||||
EsMenu *menu = EsMenuCreate(element, ES_MENU_AT_CURSOR);
|
||||
|
||||
|
@ -826,7 +826,7 @@ int PlacesViewCallback(EsElement *element, EsMessage *message) {
|
|||
|
||||
if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
|
||||
int group = message->getContent.group;
|
||||
int index = message->getContent.index.i;
|
||||
int index = message->getContent.index;
|
||||
|
||||
if (group == PLACES_VIEW_GROUP_DRIVES) {
|
||||
// TODO Use namespace lookup.
|
||||
|
@ -851,33 +851,33 @@ int PlacesViewCallback(EsElement *element, EsMessage *message) {
|
|||
}
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_SELECT && message->selectItem.isSelected) {
|
||||
if (message->selectItem.group == PLACES_VIEW_GROUP_DRIVES) {
|
||||
if (message->selectItem.index.i == 0) {
|
||||
if (message->selectItem.index == 0) {
|
||||
InstanceLoadFolder(instance, StringAllocateAndFormat("%z", interfaceString_FileManagerDrivesPage), LOAD_FOLDER_NO_FOCUS);
|
||||
} else {
|
||||
Drive *drive = &drives[message->selectItem.index.i - 1];
|
||||
Drive *drive = &drives[message->selectItem.index - 1];
|
||||
InstanceLoadFolder(instance, StringAllocateAndFormat("%s/", drive->prefixBytes, drive->prefix), LOAD_FOLDER_NO_FOCUS);
|
||||
}
|
||||
} else if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && message->selectItem.index.i) {
|
||||
String string = bookmarks[message->selectItem.index.i - 1];
|
||||
} else if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && message->selectItem.index) {
|
||||
String string = bookmarks[message->selectItem.index - 1];
|
||||
InstanceLoadFolder(instance, StringAllocateAndFormat("%s", STRFMT(string)), LOAD_FOLDER_NO_FOCUS);
|
||||
}
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_IS_SELECTED) {
|
||||
if (message->selectItem.group == PLACES_VIEW_GROUP_DRIVES) {
|
||||
if (message->selectItem.index.i == 0) {
|
||||
if (message->selectItem.index == 0) {
|
||||
message->selectItem.isSelected = 0 == EsStringCompareRaw(INTERFACE_STRING(FileManagerDrivesPage),
|
||||
instance->path.text, instance->path.bytes);
|
||||
} else {
|
||||
Drive *drive = &drives[message->selectItem.index.i - 1];
|
||||
Drive *drive = &drives[message->selectItem.index - 1];
|
||||
message->selectItem.isSelected = 0 == EsStringCompareRaw(drive->prefix, drive->prefixBytes,
|
||||
instance->path.text, instance->path.bytes - 1);
|
||||
}
|
||||
} else if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && message->selectItem.index.i) {
|
||||
String string = bookmarks[message->selectItem.index.i - 1];
|
||||
} else if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && message->selectItem.index) {
|
||||
String string = bookmarks[message->selectItem.index - 1];
|
||||
message->selectItem.isSelected = 0 == EsStringCompareRaw(string.text, string.bytes,
|
||||
instance->path.text, instance->path.bytes);
|
||||
}
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_CONTEXT_MENU) {
|
||||
if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && !message->selectItem.index.i) {
|
||||
if (message->selectItem.group == PLACES_VIEW_GROUP_BOOKMARKS && !message->selectItem.index) {
|
||||
bool isCurrentFolderBookmarked = false;
|
||||
|
||||
for (uintptr_t i = 0; i < bookmarks.Length(); i++) {
|
||||
|
|
|
@ -153,7 +153,7 @@ int FontListMessage(EsElement *element, EsMessage *message) {
|
|||
|
||||
if (message->type == ES_MSG_LIST_VIEW_CREATE_ITEM) {
|
||||
EsPanel *panel = EsPanelCreate(message->createItem.item, ES_CELL_FILL, &styleFontInformationPanel);
|
||||
EsFontInformation *font = &instance->fonts[message->createItem.index.u];
|
||||
EsFontInformation *font = &instance->fonts[message->createItem.index];
|
||||
|
||||
EsPanel *row = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, &styleFontInformationRow);
|
||||
// EsIconDisplayCreate(row, ES_FLAGS_DEFAULT, ES_STYLE_ICON_DISPLAY_SMALL, ES_ICON_FONT_X_GENERIC);
|
||||
|
@ -285,7 +285,7 @@ void LoadFontsFromDatabase(Instance *instance) {
|
|||
return EsStringCompareRaw(fontLeft->name, fontLeft->nameBytes, fontRight->name, fontRight->nameBytes);
|
||||
}, 0);
|
||||
|
||||
EsListViewInsert(instance->fontList, 0, 0, instance->fonts.Length() - 1);
|
||||
EsListViewInsert(instance->fontList, 0, 0, instance->fonts.Length());
|
||||
}
|
||||
|
||||
void BackCommand(Instance *instance, EsElement *, EsCommand *) {
|
||||
|
|
|
@ -195,7 +195,7 @@ void UpdateProcesses(Instance *instance) {
|
|||
|
||||
for (uintptr_t i = 0; i < previous.Length(); i++) {
|
||||
if (!FindProcessByPID(processes, previous[i].data.pid)) {
|
||||
EsListViewRemove(instance->listViewProcesses, 0, i, i);
|
||||
EsListViewRemove(instance->listViewProcesses, 0, i, 1);
|
||||
previous.Delete(i--);
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ void UpdateProcesses(Instance *instance) {
|
|||
|
||||
for (uintptr_t i = 0; i < processes.Length(); i++) {
|
||||
if (!FindProcessByPID(previous, processes[i].data.pid)) {
|
||||
EsListViewInsert(instance->listViewProcesses, 0, i, i);
|
||||
EsListViewInsert(instance->listViewProcesses, 0, i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ void UpdateDisplay(Instance *instance, int index) {
|
|||
} else if (index == DISPLAY_PCI_DEVICES) {
|
||||
size_t count = EsSyscall(ES_SYSCALL_DEBUG_COMMAND, index, (uintptr_t) pciDevices, sizeof(pciDevices) / sizeof(pciDevices[0]), 0);
|
||||
EsListViewRemoveAll(instance->listViewPCIDevices, 0);
|
||||
EsListViewInsert(instance->listViewPCIDevices, 0, 0, count - 1);
|
||||
EsListViewInsert(instance->listViewPCIDevices, 0, 0, count);
|
||||
EsPanelSwitchTo(instance->switcher, instance->listViewPCIDevices, ES_TRANSITION_NONE);
|
||||
} else if (index == DISPLAY_MEMORY) {
|
||||
EsMemoryStatistics statistics = {};
|
||||
|
@ -341,7 +341,7 @@ void UpdateDisplay(Instance *instance, int index) {
|
|||
|
||||
int ListViewProcessesCallback(EsElement *element, EsMessage *message) {
|
||||
if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
|
||||
int column = message->getContent.column, index = message->getContent.index.i;
|
||||
int column = message->getContent.column, index = message->getContent.index;
|
||||
ProcessItem *item = &processes[index];
|
||||
if (column == 0) GET_CONTENT("%s", item->data.nameBytes, item->data.name);
|
||||
else if (column == 1) { if (item->data.pid == -1) GET_CONTENT("n/a"); else GET_CONTENT("%d", item->data.pid); }
|
||||
|
@ -350,9 +350,9 @@ int ListViewProcessesCallback(EsElement *element, EsMessage *message) {
|
|||
else if (column == 4) GET_CONTENT("%d", item->data.handleCount);
|
||||
else EsAssert(false);
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_IS_SELECTED) {
|
||||
message->selectItem.isSelected = processes[message->selectItem.index.u].data.pid == selectedPID;
|
||||
message->selectItem.isSelected = processes[message->selectItem.index].data.pid == selectedPID;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_SELECT && message->selectItem.isSelected) {
|
||||
selectedPID = processes[message->selectItem.index.u].data.pid;
|
||||
selectedPID = processes[message->selectItem.index].data.pid;
|
||||
EsCommandSetDisabled(&element->instance->commandTerminateProcess, selectedPID < 0 || !FindProcessByPID(processes, selectedPID));
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -363,7 +363,7 @@ int ListViewProcessesCallback(EsElement *element, EsMessage *message) {
|
|||
|
||||
int ListViewPCIDevicesCallback(EsElement *, EsMessage *message) {
|
||||
if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
|
||||
int column = message->getContent.column, index = message->getContent.index.i;
|
||||
int column = message->getContent.column, index = message->getContent.index;
|
||||
|
||||
EsPCIDevice *entry = pciDevices + index;
|
||||
|
||||
|
|
|
@ -6695,12 +6695,12 @@ int InspectorElementItemCallback(EsElement *element, EsMessage *message) {
|
|||
InspectorWindow *inspector = (InspectorWindow *) element->instance;
|
||||
|
||||
if (message->type == ES_MSG_HOVERED_START) {
|
||||
InspectorElementEntry *entry = &inspector->elements[EsListViewGetIndexFromItem(element).u];
|
||||
InspectorElementEntry *entry = &inspector->elements[EsListViewGetIndexFromItem(element)];
|
||||
if (entry->element->parent) entry->element->parent->Repaint(true);
|
||||
else entry->element->Repaint(true);
|
||||
inspector->hoveredElement = *entry;
|
||||
} else if (message->type == ES_MSG_HOVERED_END || message->type == ES_MSG_DESTROY) {
|
||||
InspectorElementEntry *entry = &inspector->elements[EsListViewGetIndexFromItem(element).u];
|
||||
InspectorElementEntry *entry = &inspector->elements[EsListViewGetIndexFromItem(element)];
|
||||
if (entry->element->parent) entry->element->parent->Repaint(true);
|
||||
else entry->element->Repaint(true);
|
||||
inspector->hoveredElement = {};
|
||||
|
@ -6795,7 +6795,7 @@ int InspectorElementListCallback(EsElement *element, EsMessage *message) {
|
|||
InspectorWindow *inspector = (InspectorWindow *) element->instance;
|
||||
|
||||
if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
|
||||
int column = message->getContent.column, index = message->getContent.index.i;
|
||||
int column = message->getContent.column, index = message->getContent.index;
|
||||
EsAssert(index >= 0 && index < (int) inspector->elements.Length());
|
||||
InspectorElementEntry *entry = &inspector->elements[index];
|
||||
|
||||
|
@ -6811,7 +6811,7 @@ int InspectorElementListCallback(EsElement *element, EsMessage *message) {
|
|||
|
||||
return ES_HANDLED;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_GET_INDENT) {
|
||||
message->getIndent.indent = inspector->elements[message->getIndent.index.i].depth;
|
||||
message->getIndent.indent = inspector->elements[message->getIndent.index].depth;
|
||||
return ES_HANDLED;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_CREATE_ITEM) {
|
||||
message->createItem.item->messageUser = InspectorElementItemCallback;
|
||||
|
@ -6821,7 +6821,7 @@ int InspectorElementListCallback(EsElement *element, EsMessage *message) {
|
|||
inspector->elements[inspector->selectedElement].element->state &= ~UI_STATE_INSPECTING;
|
||||
}
|
||||
|
||||
inspector->selectedElement = message->selectItem.isSelected ? message->selectItem.index.i : -1;
|
||||
inspector->selectedElement = message->selectItem.isSelected ? message->selectItem.index : -1;
|
||||
|
||||
if (inspector->selectedElement != -1) {
|
||||
EsElement *e = inspector->elements[inspector->selectedElement].element;
|
||||
|
@ -6832,7 +6832,7 @@ int InspectorElementListCallback(EsElement *element, EsMessage *message) {
|
|||
InspectorUpdateEditor(inspector);
|
||||
return ES_HANDLED;
|
||||
} else if (message->type == ES_MSG_LIST_VIEW_IS_SELECTED) {
|
||||
message->selectItem.isSelected = message->selectItem.index.i == inspector->selectedElement;
|
||||
message->selectItem.isSelected = message->selectItem.index == inspector->selectedElement;
|
||||
return ES_HANDLED;
|
||||
}
|
||||
|
||||
|
@ -6945,7 +6945,7 @@ void InspectorNotifyElementDestroyed(EsElement *element) {
|
|||
inspector->selectedElement--;
|
||||
}
|
||||
|
||||
EsListViewRemove(inspector->elementList, 0, i, i);
|
||||
EsListViewRemove(inspector->elementList, 0, i, 1);
|
||||
inspector->elements.Delete(i);
|
||||
return;
|
||||
}
|
||||
|
@ -7013,7 +7013,7 @@ void InspectorNotifyElementCreated(EsElement *element) {
|
|||
entry.element = element;
|
||||
entry.depth = depth;
|
||||
inspector->elements.Insert(entry, insertAfterIndex + 1);
|
||||
EsListViewInsert(inspector->elementList, 0, insertAfterIndex + 1, insertAfterIndex + 1);
|
||||
EsListViewInsert(inspector->elementList, 0, insertAfterIndex + 1, 1);
|
||||
}
|
||||
|
||||
void InspectorFindElementsRecursively(InspectorWindow *inspector, EsElement *element, int depth) {
|
||||
|
@ -7031,7 +7031,7 @@ void InspectorRefreshElementList(InspectorWindow *inspector) {
|
|||
EsListViewRemoveAll(inspector->elementList, 0);
|
||||
inspector->elements.Free();
|
||||
InspectorFindElementsRecursively(inspector, inspector->instance->window, 0);
|
||||
EsListViewInsert(inspector->elementList, 0, 0, inspector->elements.Length() - 1);
|
||||
EsListViewInsert(inspector->elementList, 0, 0, inspector->elements.Length());
|
||||
}
|
||||
|
||||
void InspectorNotifyElementPainted(EsElement *element, EsPainter *painter) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -27,6 +27,7 @@ type_name int64_t EsFileOffsetDifference;
|
|||
type_name uint64_t EsAudioDeviceID;
|
||||
type_name uint16_t EsFontFamily;
|
||||
type_name uint64_t EsTimer;
|
||||
type_name int64_t EsListViewIndex;
|
||||
|
||||
define ES_SCANCODE_A (0x04)
|
||||
define ES_SCANCODE_B (0x05)
|
||||
|
@ -518,18 +519,13 @@ define ES_LIST_VIEW_HORIZONTAL (1 << 0) // Layout horizontally instead of vert
|
|||
define ES_LIST_VIEW_VARIABLE_SIZE (1 << 1) // Each item can be a different size.
|
||||
// You need to respond to the LIST_VIEW_MEASURE_ITEM message.
|
||||
// The size of items cannot depend on the size of the parent.
|
||||
define ES_LIST_VIEW_TILED (1 << 2) // Multiple items per band. Incompatible with variable size items, columns mode and non-linear mode.
|
||||
define ES_LIST_VIEW_NON_LINEAR (1 << 3) // Indices within a group are arbitrary values. They must be stable.
|
||||
// You need to respond to LIST_VIEW_NEXT_INDEX, LIST_VIEW_PREVIOUS_INDEX,
|
||||
// LIST_VIEW_COMPARE_INDICES, LIST_VIEW_FIRST_INDEX, and LIST_VIEW_LAST_INDEX messages.
|
||||
// If the flag is not set, indices are consecutive within a group, starting at 0.
|
||||
// These are non-stable, but are updated automatically when items are inserted/removed.
|
||||
define ES_LIST_VIEW_SINGLE_SELECT (1 << 4) // One item can be selected. By default, selections are disabled.
|
||||
define ES_LIST_VIEW_MULTI_SELECT (1 << 5) // Multiple items can be selected.
|
||||
define ES_LIST_VIEW_CHOICE_SELECT (1 << 6) // Exactly one item is always selected. Dragging on the list view causes the selection to 'slide' between items.
|
||||
define ES_LIST_VIEW_COLUMNS (1 << 7) // Display a column header and let items have multiple values. Incompatible with horizontal and tiled layouts.
|
||||
define ES_LIST_VIEW_FIXED_ITEMS (1 << 8) // Use the fixed item API rather than the callback API.
|
||||
define ES_LIST_VIEW_CENTER_TILES (1 << 9) // Center tiled items.
|
||||
define ES_LIST_VIEW_TILED (1 << 2) // Multiple items per band. Incompatible with variable size items and columns mode.
|
||||
define ES_LIST_VIEW_SINGLE_SELECT (1 << 3) // One item can be selected. By default, selections are disabled.
|
||||
define ES_LIST_VIEW_MULTI_SELECT (1 << 4) // Multiple items can be selected.
|
||||
define ES_LIST_VIEW_CHOICE_SELECT (1 << 5) // Exactly one item is always selected. Dragging on the list view causes the selection to 'slide' between items.
|
||||
define ES_LIST_VIEW_COLUMNS (1 << 6) // Display a column header and let items have multiple values. Incompatible with horizontal and tiled layouts.
|
||||
define ES_LIST_VIEW_FIXED_ITEMS (1 << 7) // Use the fixed item API rather than the callback API.
|
||||
define ES_LIST_VIEW_CENTER_TILES (1 << 8) // Center tiled items.
|
||||
|
||||
define ES_LIST_VIEW_GROUP_HAS_HEADER (1 << 0) // The first item in the group is a header.
|
||||
define ES_LIST_VIEW_GROUP_HAS_FOOTER (1 << 1) // The last item in the group is a footer.
|
||||
|
@ -1000,13 +996,7 @@ enum EsMessageType {
|
|||
ES_MSG_TEXTBOX_ACTIVATE_BREADCRUMB = 0x5208 // For EsTextboxUseBreadcrumbOverlay.
|
||||
|
||||
// List view messages:
|
||||
ES_MSG_LIST_VIEW_COMPARE_INDICES = 0x5300
|
||||
ES_MSG_LIST_VIEW_NEXT_INDEX = 0x5301
|
||||
ES_MSG_LIST_VIEW_PREVIOUS_INDEX = 0x5302
|
||||
ES_MSG_LIST_VIEW_FIRST_INDEX = 0x5303
|
||||
ES_MSG_LIST_VIEW_LAST_INDEX = 0x5304
|
||||
ES_MSG_LIST_VIEW_FIND_INDEX = 0x5305
|
||||
ES_MSG_LIST_VIEW_COUNT_ITEMS = 0x5306
|
||||
ES_MSG_LIST_VIEW_MEASURE_RANGE = 0x5307
|
||||
ES_MSG_LIST_VIEW_MEASURE_ITEM = 0x5308
|
||||
ES_MSG_LIST_VIEW_CREATE_ITEM = 0x5309
|
||||
|
@ -1546,41 +1536,36 @@ struct EsMessageItemToString {
|
|||
|
||||
// List view messages.
|
||||
|
||||
struct EsMessageCompareIndices {
|
||||
int32_t group;
|
||||
EsGeneric left, right;
|
||||
int result;
|
||||
};
|
||||
|
||||
struct EsMessageIterateIndex {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
|
||||
// FIND_INDEX and FIND_POSITION: (TODO Pass the reference item?)
|
||||
int64_t position;
|
||||
};
|
||||
|
||||
struct EsMessageItemRange {
|
||||
int32_t group;
|
||||
EsGeneric firstIndex, lastIndex;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex firstIndex;
|
||||
uint64_t count;
|
||||
int64_t result;
|
||||
};
|
||||
|
||||
struct EsMessageMeasureItem {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
int64_t result;
|
||||
};
|
||||
|
||||
struct EsMessageCreateItem {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
EsElement *item;
|
||||
};
|
||||
|
||||
struct EsMessageGetContent {
|
||||
EsGeneric index;
|
||||
int32_t group;
|
||||
EsListViewIndex index;
|
||||
EsListViewIndex group;
|
||||
uint32_t icon;
|
||||
EsBuffer *buffer;
|
||||
bool richText;
|
||||
|
@ -1588,32 +1573,32 @@ struct EsMessageGetContent {
|
|||
};
|
||||
|
||||
struct EsMessageGetIndent {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
|
||||
uint8_t indent;
|
||||
};
|
||||
|
||||
struct EsMessageSelectRange {
|
||||
EsGeneric fromIndex, toIndex;
|
||||
int32_t group;
|
||||
EsListViewIndex fromIndex, toIndex;
|
||||
EsListViewIndex group;
|
||||
bool select, toggle;
|
||||
};
|
||||
|
||||
struct EsMessageSelectItem {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
bool isSelected;
|
||||
};
|
||||
|
||||
struct EsMessageChooseItem {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
};
|
||||
|
||||
struct EsMessageSearchItem {
|
||||
int32_t group;
|
||||
EsGeneric index;
|
||||
EsListViewIndex group;
|
||||
EsListViewIndex index;
|
||||
STRING query;
|
||||
};
|
||||
|
||||
|
@ -1759,7 +1744,6 @@ struct EsMessage {
|
|||
const EsStyle *childStyleVariant;
|
||||
|
||||
// List view messages:
|
||||
EsMessageCompareIndices compareIndices;
|
||||
EsMessageIterateIndex iterateIndex;
|
||||
EsMessageItemRange itemRange;
|
||||
EsMessageMeasureItem measureItem;
|
||||
|
@ -2369,30 +2353,30 @@ function EsListView *EsListViewCreate(EsElement *parent, uint64_t flags = ES_FLA
|
|||
const EsStyle *style = ES_NULL, const EsStyle *itemStyle = ES_NULL,
|
||||
const EsStyle *headerItemStyle = ES_NULL, const EsStyle *footerItemStyle = ES_NULL);
|
||||
|
||||
function EsGeneric EsListViewGetIndexFromItem(EsElement *element, int32_t *group = ES_NULL);
|
||||
function EsListViewIndex EsListViewGetIndexFromItem(EsElement *element, EsListViewIndex *group = ES_NULL);
|
||||
function void EsListViewEnumerateVisibleItems(EsListView *view, EsListViewEnumerateVisibleItemsCallbackFunction callback);
|
||||
|
||||
function void EsListViewSetColumns(EsListView *view, EsListViewColumn *columns, size_t columnCount);
|
||||
function void EsListViewSetEmptyMessage(EsListView *view, STRING message = BLANK_STRING);
|
||||
function void EsListViewSetMaximumItemsPerBand(EsListView *view, int maximumItemsPerBand);
|
||||
function void EsListViewSelect(EsListView *view, int32_t group, EsGeneric index);
|
||||
function void EsListViewFocusItem(EsListView *view, int32_t group, EsGeneric index);
|
||||
function bool EsListViewGetFocusedItem(EsListView *view, int32_t *group, EsGeneric *index); // Returns false if not item was focused.
|
||||
function void EsListViewInvalidateContent(EsListView *view, int32_t group, EsGeneric index);
|
||||
function void EsListViewSelect(EsListView *view, EsListViewIndex group, EsListViewIndex index);
|
||||
function void EsListViewFocusItem(EsListView *view, EsListViewIndex group, EsListViewIndex index);
|
||||
function bool EsListViewGetFocusedItem(EsListView *view, EsListViewIndex *group, EsListViewIndex *index); // Returns false if not item was focused.
|
||||
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 EsListViewScrollToEnd(EsListView *view);
|
||||
|
||||
function EsTextbox *EsListViewCreateInlineTextbox(EsListView *view, int32_t group, EsGeneric index, uint32_t flags = ES_FLAGS_DEFAULT);
|
||||
function EsTextbox *EsListViewCreateInlineTextbox(EsListView *view, EsListViewIndex group, EsListViewIndex index, uint32_t flags = ES_FLAGS_DEFAULT);
|
||||
|
||||
// (Callback items.)
|
||||
function void EsListViewInsertGroup(EsListView *view, int32_t group, uint32_t flags = ES_FLAGS_DEFAULT);
|
||||
function void EsListViewInsert(EsListView *view, int32_t group, EsGeneric firstIndex, EsGeneric lastIndex, int64_t count = -1);
|
||||
function void EsListViewRemove(EsListView *view, int32_t group, EsGeneric firstIndex, EsGeneric lastIndex, int64_t count = -1);
|
||||
function void EsListViewRemoveAll(EsListView *view, int32_t group);
|
||||
function void EsListViewInsertGroup(EsListView *view, EsListViewIndex group, uint32_t flags = ES_FLAGS_DEFAULT);
|
||||
function void EsListViewInsert(EsListView *view, EsListViewIndex group, EsListViewIndex firstIndex, EsListViewIndex count);
|
||||
function void EsListViewRemove(EsListView *view, EsListViewIndex group, EsListViewIndex firstIndex, EsListViewIndex count);
|
||||
function void EsListViewRemoveAll(EsListView *view, EsListViewIndex group);
|
||||
// (Fixed items.)
|
||||
function void EsListViewInsertFixedItem(EsListView *view, STRING string = BLANK_STRING, EsGeneric data = ES_NULL, intptr_t index = -1);
|
||||
function void EsListViewInsertFixedItem(EsListView *view, STRING string = BLANK_STRING, EsGeneric data = ES_NULL, EsListViewIndex index = -1);
|
||||
function bool EsListViewSelectFixedItem(EsListView *view, EsGeneric data); // Returns false if the item was not found.
|
||||
function bool EsListViewGetSelectedFixedItem(EsListView *view, EsGeneric *data); // Returns false if no item was selected.
|
||||
|
|
|
@ -126,6 +126,8 @@ EsApplicationStart=124
|
|||
EsINIFormat=125
|
||||
EsINIZeroTerminate=126
|
||||
EsIconIDFromString=127
|
||||
EsListViewInsert=130
|
||||
EsListViewRemove=131
|
||||
EsEventCreate=132
|
||||
EsEventForward=133
|
||||
EsBufferFormat=134
|
||||
|
@ -304,8 +306,6 @@ EsUndoInUndo=307
|
|||
EsUndoPop=308
|
||||
EsTextboxSetUndoManager=309
|
||||
EsListViewInsertGroup=310
|
||||
EsListViewInsert=311
|
||||
EsListViewRemove=312
|
||||
EsListViewRemoveAll=313
|
||||
EsSystemShowShutdownDialog=314
|
||||
EsListViewSetColumns=315
|
||||
|
|
Loading…
Reference in New Issue