Skip to content

Conversation

@fosterbrereton
Copy link
Member

This PR adds eve_t::dump() which outputs the view_proxy_t forest to stderr. The format looks like an eve2 layout description, except the name of the widget is the underlying placeable instance, and the parameters are taken directly from the view_proxy_t's attributes. Example:

some_dialog(left: 0, top: 0, width: 362, height: 138, horizontal: default, vertical: default, placement: row) {
    some_column(left: 20, top: 20, width: 240, height: 98, horizontal: forward, vertical: forward, placement: column) {
        some_subview(left: 20, top: 20, width: 240, height: 43, horizontal: forward_fill, vertical: forward_fill, placement: row) {
            some_subview(left: 0, top: 0, width: 240, height: 43, horizontal: forward_fill, vertical: forward_fill, placement: column) {
                some_row(left: 0, top: 0, width: 240, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: row) {
                    some_row(left: 0, top: 0, width: 183, height: 19, horizontal: forward_fill, vertical: forward_fill, placement: row) {
                        some_statictext(left: 0, top: 3, width: 183, height: 16, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
                    }
                    some_row(left: 195, top: 0, width: 45, height: 24, horizontal: reverse, vertical: reverse, placement: row) {
                        some_unitnumericedit(left: 195, top: 0, width: 45, height: 24, horizontal: reverse, vertical: reverse, placement: leaf);
                    }
                }
                some_slider(left: 0, top: 29, width: 240, height: 14, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
            }
        }
        some_subview(left: 20, top: 75, width: 240, height: 43, horizontal: forward_fill, vertical: forward_fill, placement: row) {
            some_subview(left: 0, top: 0, width: 240, height: 43, horizontal: forward_fill, vertical: forward_fill, placement: column) {
                some_row(left: 0, top: 0, width: 240, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: row) {
                    some_row(left: 0, top: 0, width: 183, height: 19, horizontal: forward_fill, vertical: forward_fill, placement: row) {
                        some_statictext(left: 0, top: 3, width: 183, height: 16, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
                    }
                    some_row(left: 195, top: 0, width: 45, height: 24, horizontal: reverse, vertical: reverse, placement: row) {
                        some_unitnumericedit(left: 195, top: 0, width: 45, height: 24, horizontal: reverse, vertical: reverse, placement: leaf);
                    }
                }
                some_slider(left: 0, top: 29, width: 240, height: 14, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
            }
        }
    }
    some_column(left: 272, top: 20, width: 70, height: 96, horizontal: forward, vertical: forward, placement: column) {
        some_button(left: 272, top: 20, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
        some_overlay(left: 272, top: 56, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: overlay) {
            some_button(left: 272, top: 56, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
            some_button(left: 272, top: 56, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
            some_button(left: 272, top: 56, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
        }
        some_tabview(left: 0, top: 0, width: 0, height: 0, horizontal: forward_fill, vertical: forward_fill, placement: column) {
            some_button(left: 0, top: 0, width: 0, height: 0, horizontal: default, vertical: default, placement: leaf);
        }
        some_column(left: 272, top: 92, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: column) {
            some_row(left: 272, top: 92, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: row) {
                some_checkbox(left: 272, top: 92, width: 70, height: 24, horizontal: forward_fill, vertical: forward_fill, placement: leaf);
            }
        }
    }
}

Copy link
Member

@sean-parent sean-parent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A unit test for these changes is required.


auto top = eve.add_placeable(adobe::eve_t::iterator(), adobe::layout_attributes_t(), false, placeable_row, false);

eve.print_debug(result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the string matches something known.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this, too, but the name of the type is implementation dependent, so will change from compiler to compiler. Do you have a suggestion on how that could be mitigated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this workaround will suffice?

Copy link
Member

@sean-parent sean-parent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sean-parent sean-parent merged commit a5bc4ce into main Jun 10, 2025
13 checks passed
@fosterbrereton fosterbrereton deleted the fosterbrereton/eve-dump branch June 10, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants