mirror of https://gitlab.com/nakst/essence
cleanup
This commit is contained in:
parent
c1259773bc
commit
b79a286045
|
@ -587,17 +587,10 @@ int EsMessageSend(EsElement *element, EsMessage *message) {
|
|||
response = element->messageUser(element, message);
|
||||
}
|
||||
|
||||
bool handledByUser = response;
|
||||
|
||||
if (response == 0 && element->messageClass) {
|
||||
response = element->messageClass(element, message);
|
||||
}
|
||||
|
||||
if ((element->state & UI_STATE_INSPECTING) && message->type != ES_MSG_GET_INSPECTOR_INFORMATION) {
|
||||
InspectorNotifyElementEvent(element, "message", "Element processed message '%z' with response %i%z.\n",
|
||||
EnumLookupNameFromValue(enumStrings_EsMessageType, message->type), response, handledByUser ? " (from user callback)" : "");
|
||||
}
|
||||
|
||||
if (message->type >= ES_MSG_STATE_CHANGE_MESSAGE_START && message->type <= ES_MSG_STATE_CHANGE_MESSAGE_END) {
|
||||
((EsElement *) element)->MaybeRefreshStyle();
|
||||
}
|
||||
|
|
|
@ -8034,10 +8034,12 @@ void InspectorSetup(EsWindow *window) {
|
|||
|
||||
inspector->selectedElement = -1;
|
||||
|
||||
EsPanel *panel = EsPanelCreate(window, ES_CELL_FILL, ES_STYLE_PANEL_FILLED);
|
||||
EsSplitter *splitter = EsSplitterCreate(window, ES_CELL_FILL | ES_SPLITTER_VERTICAL);
|
||||
EsPanel *panel1 = EsPanelCreate(splitter, ES_CELL_FILL, ES_STYLE_PANEL_FILLED);
|
||||
EsPanel *panel2 = EsPanelCreate(splitter, ES_CELL_FILL, ES_STYLE_PANEL_FILLED);
|
||||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
EsPanel *toolbar = EsPanelCreate(panel1, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
inspector->visualizeRepaints = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR, 0, "Visualize repaints");
|
||||
EsButtonOnCommand(inspector->visualizeRepaints, InspectorVisualizeRepaints);
|
||||
inspector->visualizeLayoutBounds = EsButtonCreate(toolbar, ES_BUTTON_TOOLBAR, 0, "Visualize layout bounds");
|
||||
|
@ -8046,13 +8048,13 @@ void InspectorSetup(EsWindow *window) {
|
|||
EsButtonOnCommand(inspector->visualizePaintSteps, InspectorVisualizePaintSteps);
|
||||
}
|
||||
|
||||
inspector->elementList = EsListViewCreate(panel, ES_CELL_FILL | ES_LIST_VIEW_COLUMNS | ES_LIST_VIEW_SINGLE_SELECT);
|
||||
inspector->elementList = EsListViewCreate(panel1, ES_CELL_FILL | ES_LIST_VIEW_COLUMNS | ES_LIST_VIEW_SINGLE_SELECT);
|
||||
inspector->elementList->messageUser = InspectorElementListCallback;
|
||||
EsListViewSetColumns(inspector->elementList, inspectorElementListColumns, sizeof(inspectorElementListColumns) / sizeof(EsListViewColumn));
|
||||
EsListViewInsertGroup(inspector->elementList, 0);
|
||||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
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);
|
||||
|
@ -8092,7 +8094,7 @@ void InspectorSetup(EsWindow *window) {
|
|||
}
|
||||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
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);
|
||||
|
@ -8117,7 +8119,7 @@ void InspectorSetup(EsWindow *window) {
|
|||
}
|
||||
|
||||
{
|
||||
EsPanel *toolbar = EsPanelCreate(panel, ES_CELL_H_FILL | ES_PANEL_HORIZONTAL, ES_STYLE_PANEL_TOOLBAR);
|
||||
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:");
|
||||
inspector->contentTextbox = EsTextboxCreate(toolbar, ES_ELEMENT_DISABLED | ES_TEXTBOX_EDIT_BASED);
|
||||
|
@ -8129,7 +8131,7 @@ void InspectorSetup(EsWindow *window) {
|
|||
}
|
||||
|
||||
{
|
||||
inspector->listEvents = EsListViewCreate(panel, ES_CELL_FILL | ES_LIST_VIEW_CHOICE_SELECT | ES_LIST_VIEW_FIXED_ITEMS, ES_STYLE_LIST_CHOICE_BORDERED);
|
||||
inspector->listEvents = EsListViewCreate(panel2, ES_CELL_FILL | ES_LIST_VIEW_CHOICE_SELECT | ES_LIST_VIEW_FIXED_ITEMS, ES_STYLE_LIST_CHOICE_BORDERED);
|
||||
}
|
||||
|
||||
InspectorRefreshElementList(inspector);
|
||||
|
|
|
@ -2015,7 +2015,7 @@ function EsError EsDeviceControl(EsHandle handle, EsDeviceControlType type, void
|
|||
|
||||
// Processes and threads.
|
||||
|
||||
function EsError EsProcessCreate(EsProcessCreationArguments *arguments, EsProcessInformation *information);
|
||||
function EsError EsProcessCreate(const EsProcessCreationArguments *arguments, EsProcessInformation *information);
|
||||
function int EsProcessGetExitStatus(EsHandle process);
|
||||
function EsObjectID EsProcessGetID(EsHandle process);
|
||||
function void EsProcessGetState(EsHandle process, EsProcessState *state);
|
||||
|
|
|
@ -38,7 +38,7 @@ bool EsMemoryDecommit(void *pointer, size_t bytes) {
|
|||
return ES_SUCCESS == (intptr_t) EsSyscall(ES_SYSCALL_MEMORY_COMMIT, (uintptr_t) pointer >> ES_PAGE_BITS, bytes >> ES_PAGE_BITS, 1, 0);
|
||||
}
|
||||
|
||||
EsError EsProcessCreate(EsProcessCreationArguments *arguments, EsProcessInformation *information) {
|
||||
EsError EsProcessCreate(const EsProcessCreationArguments *arguments, EsProcessInformation *information) {
|
||||
EsProcessInformation _information;
|
||||
if (!information) information = &_information;
|
||||
|
||||
|
|
Binary file not shown.
|
@ -2375,6 +2375,9 @@ UIRectangle CanvasGetObjectBounds(Object *object) {
|
|||
int32_t w = PropertyReadInt32(object, "_graphW") * canvas->zoom;
|
||||
int32_t h = PropertyReadInt32(object, "_graphH") * canvas->zoom;
|
||||
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
|
||||
UIRectangle bounds = UI_RECT_4(x, x + w, y, y + h);
|
||||
|
||||
if (object->flags & OBJECT_IS_SELECTED) {
|
||||
|
@ -2656,14 +2659,16 @@ int CanvasMessage(UIElement *element, UIMessage message, int di, void *dp) {
|
|||
UIDrawBorder(painter, UIRectangleAdd(bounds, UI_RECT_1I(-3)), 0xFF4092FF, UI_RECT_1(3));
|
||||
}
|
||||
|
||||
UIDrawString(painter, UI_RECT_4(bounds.l, element->bounds.r, bounds.t - ui.glyphHeight, bounds.t),
|
||||
object->cName, -1, 0xFF000000, UI_ALIGN_LEFT, nullptr);
|
||||
if (object->type == OBJ_COMMENT || canvas->zoom > 0.1f) {
|
||||
UIDrawString(painter, UI_RECT_4(bounds.l, element->bounds.r, bounds.t - ui.glyphHeight, bounds.t),
|
||||
object->cName, -1, 0xFF000000, UI_ALIGN_LEFT, nullptr);
|
||||
}
|
||||
|
||||
UIDrawRectangle(painter, bounds, 0xFFE0E0E0, 0xFF404040, UI_RECT_1(1));
|
||||
UIDrawBlock(painter, UI_RECT_4(bounds.l + 1, bounds.r + 1, bounds.b, bounds.b + 1), 0xFF404040);
|
||||
UIDrawBlock(painter, UI_RECT_4(bounds.r, bounds.r + 1, bounds.t + 1, bounds.b + 1), 0xFF404040);
|
||||
|
||||
if (isConditional) {
|
||||
if (isConditional && canvas->zoom > 0.1f) {
|
||||
UIRectangle indicator = UI_RECT_4(bounds.l - ui.glyphWidth, bounds.l, bounds.t, bounds.t + ui.glyphHeight);
|
||||
UIDrawBlock(painter, indicator, 0xFFFFFF00);
|
||||
UIDrawString(painter, indicator, "?", -1, 0xFF000000, UI_ALIGN_CENTER, nullptr);
|
||||
|
@ -2911,7 +2916,7 @@ int CanvasMessage(UIElement *element, UIMessage message, int di, void *dp) {
|
|||
while (divisions > 0) factor *= perDivision, divisions--;
|
||||
while (divisions < 0) factor /= perDivision, divisions++;
|
||||
if (canvas->zoom * factor > 4) factor = 4 / canvas->zoom;
|
||||
if (canvas->zoom * factor < 0.1) factor = 0.1 / canvas->zoom;
|
||||
if (canvas->zoom * factor < 0.05) factor = 0.05 / canvas->zoom;
|
||||
int mx = element->window->cursorX - element->bounds.l;
|
||||
int my = element->window->cursorY - element->bounds.t;
|
||||
canvas->zoom *= factor;
|
||||
|
@ -3594,8 +3599,8 @@ int main(int argc, char **argv) {
|
|||
|
||||
graphControls = UIPanelCreate(canvas, UI_PANEL_HORIZONTAL | UI_ELEMENT_PARENT_PUSH);
|
||||
graphControls->gap = -1;
|
||||
UIButtonCreate(0, UI_BUTTON_SMALL, "Arrow mode \x18", -1)->invoke = CanvasArrowMode;
|
||||
UIButtonCreate(0, UI_BUTTON_SMALL, "Add object \x18", -1)->invoke = ObjectAddCommand;
|
||||
UIButtonCreate(0, UI_BUTTON_SMALL, "Arrow mode \x18", -1)->invoke = CanvasArrowMode;
|
||||
UIParentPop();
|
||||
|
||||
prototypeControls = UIPanelCreate(canvas, UI_PANEL_HORIZONTAL | UI_ELEMENT_PARENT_PUSH);
|
||||
|
|
Loading…
Reference in New Issue