mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 12:15:00 -07:00
fixes for variable size rows in new eval visualization structures / integration
This commit is contained in:
@@ -201,6 +201,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(default)
|
||||
result.row_exprs_count = Min(needed_row_count, members->count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -219,6 +220,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(default)
|
||||
result.row_exprs_count = Min(needed_row_count, enumvals->count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -237,6 +239,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(default)
|
||||
result.row_exprs_count = Min(needed_row_count, accel->array_count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -253,6 +256,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(default)
|
||||
result.row_exprs_count = 1;
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
result.row_exprs[0] = e_expr_ref_deref(arena, expr);
|
||||
result.row_members[0] = &e_member_nil;
|
||||
|
||||
@@ -805,7 +805,6 @@ ev2_block_range_list_from_tree(Arena *arena, EV2_BlockTree *block_tree)
|
||||
EV2_Block *next_child;
|
||||
Rng1U64 block_relative_range;
|
||||
};
|
||||
U64 base_num = 0;
|
||||
BlockTask start_task = {0, block_tree->root, block_tree->root->first, r1u64(0, block_tree->root->row_count)};
|
||||
for(BlockTask *t = &start_task; t != 0; t = t->next)
|
||||
{
|
||||
@@ -821,8 +820,8 @@ ev2_block_range_list_from_tree(Arena *arena, EV2_BlockTree *block_tree)
|
||||
if(block_num_visual_rows != 0)
|
||||
{
|
||||
EV2_BlockRangeNode *n = push_array(arena, EV2_BlockRangeNode, 1);
|
||||
n->v.block = t->block;
|
||||
n->v.range = block_relative_range;
|
||||
n->v.block = t->block;
|
||||
n->v.range = block_relative_range;
|
||||
SLLQueuePush(list.first, list.last, n);
|
||||
list.count += 1;
|
||||
}
|
||||
@@ -863,7 +862,7 @@ ev2_block_range_from_num(EV2_BlockRangeList *block_ranges, U64 num)
|
||||
U64 base_num = 0;
|
||||
for(EV2_BlockRangeNode *n = block_ranges->first; n != 0; n = n->next)
|
||||
{
|
||||
U64 range_size = dim_1u64(n->v.range);
|
||||
U64 range_size = n->v.block->single_item ? 1 : dim_1u64(n->v.range);
|
||||
Rng1U64 global_range = r1u64(base_num, base_num + range_size);
|
||||
if(contains_1u64(global_range, num))
|
||||
{
|
||||
@@ -886,7 +885,7 @@ ev2_key_from_num(EV2_BlockRangeList *block_ranges, U64 num)
|
||||
U64 base_num = 0;
|
||||
for(EV2_BlockRangeNode *n = block_ranges->first; n != 0; n = n->next)
|
||||
{
|
||||
U64 range_size = dim_1u64(n->v.range);
|
||||
U64 range_size = n->v.block->single_item ? 1 : dim_1u64(n->v.range);
|
||||
Rng1U64 global_range = r1u64(base_num, base_num + range_size);
|
||||
if(contains_1u64(global_range, num))
|
||||
{
|
||||
@@ -912,13 +911,14 @@ ev2_num_from_key(EV2_BlockRangeList *block_ranges, EV_Key key)
|
||||
if(hash == key.parent_hash)
|
||||
{
|
||||
U64 relative_num = n->v.block->expand_view_rule_info->expr_expand_num_from_id(key.child_id, n->v.block->expand_view_rule_info_user_data);
|
||||
if(contains_1u64(n->v.range, relative_num-1))
|
||||
Rng1U64 num_range = r1u64(n->v.range.min, n->v.block->single_item ? (n->v.range.min+1) : n->v.range.max);
|
||||
if(contains_1u64(num_range, relative_num-1))
|
||||
{
|
||||
result = base_num + (relative_num - 1 - n->v.range.min);
|
||||
break;
|
||||
}
|
||||
}
|
||||
base_num += dim_1u64(n->v.range);
|
||||
base_num += n->v.block->single_item ? 1 : dim_1u64(n->v.range);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -964,7 +964,17 @@ ev2_windowed_row_list_from_block_range_list(Arena *arena, EV_View *view, String8
|
||||
rows.count_before_visual += num_skipped;
|
||||
if(block_num_visual_rows != 0 && num_skipped != 0)
|
||||
{
|
||||
rows.count_before_semantic += n->v.block->single_item ? 1 : num_skipped;
|
||||
if(n->v.block->single_item)
|
||||
{
|
||||
if(num_skipped >= block_num_visual_rows)
|
||||
{
|
||||
rows.count_before_semantic += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rows.count_before_semantic += num_skipped;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: generate rows before next splitting child
|
||||
@@ -981,9 +991,9 @@ ev2_windowed_row_list_from_block_range_list(Arena *arena, EV_View *view, String8
|
||||
rows.count += 1;
|
||||
row->block = n->v.block;
|
||||
row->key = ev_key_make(ev_hash_from_key(row->block->key), 1);
|
||||
row->visual_size = n->v.block->single_item ? n->v.block->row_count : 1;
|
||||
row->visual_size_skipped = 0; // TODO(rjf)
|
||||
row->visual_size_chopped = 0; // TODO(rjf)
|
||||
row->visual_size = n->v.block->single_item ? (n->v.block->row_count - (num_skipped + num_chopped)) : 1;
|
||||
row->visual_size_skipped = num_skipped;
|
||||
row->visual_size_chopped = num_chopped;
|
||||
row->string = n->v.block->string;
|
||||
row->expr = n->v.block->expr;
|
||||
row->member = &e_member_nil;
|
||||
@@ -1023,12 +1033,16 @@ ev2_windowed_row_list_from_block_range_list(Arena *arena, EV_View *view, String8
|
||||
row->block = n->v.block;
|
||||
row->key = row_key;
|
||||
row->visual_size = 1;
|
||||
row->visual_size_skipped = 0; // TODO(rjf)
|
||||
row->visual_size_chopped = 0; // TODO(rjf)
|
||||
row->visual_size_skipped = 0;
|
||||
row->visual_size_chopped = 0;
|
||||
row->string = expand_range_info.row_strings[idx];
|
||||
row->expr = row_expr__resolved;
|
||||
row->member = expand_range_info.row_members[idx];
|
||||
row->view_rules = row_view_rules;
|
||||
if(expand_range_info.row_view_rules[idx].size != 0)
|
||||
{
|
||||
ev_key_set_view_rule(view, row->key, expand_range_info.row_view_rules[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ struct EV_ExpandRangeInfo
|
||||
{
|
||||
U64 row_exprs_count;
|
||||
String8 *row_strings;
|
||||
String8 *row_view_rules;
|
||||
E_Expr **row_exprs;
|
||||
E_Member **row_members;
|
||||
};
|
||||
|
||||
@@ -248,7 +248,7 @@ rd_entity_child_from_kind(RD_Entity *entity, RD_EntityKind kind)
|
||||
RD_Entity *result = &d_nil_entity;
|
||||
for(RD_Entity *child = entity->first; !rd_entity_is_nil(child); child = child->next)
|
||||
{
|
||||
if(child->kind == kind)
|
||||
if(!(child->flags & RD_EntityFlag_MarkedForDeletion) && child->kind == kind)
|
||||
{
|
||||
result = child;
|
||||
break;
|
||||
@@ -7921,14 +7921,18 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(watches)
|
||||
result.row_exprs_count = Min(needed_row_count, accel->entities.count+1);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
U64 entity_idx = idx_range.min + row_expr_idx;
|
||||
if(entity_idx < accel->entities.count)
|
||||
{
|
||||
result.row_exprs[row_expr_idx] = e_parse_expr_from_text(arena, accel->entities.v[entity_idx]->string);
|
||||
result.row_strings[row_expr_idx] = accel->entities.v[entity_idx]->string;
|
||||
RD_Entity *entity = accel->entities.v[entity_idx];
|
||||
RD_Entity *view_rule = rd_entity_child_from_kind(entity, RD_EntityKind_ViewRule);
|
||||
result.row_exprs[row_expr_idx] = e_parse_expr_from_text(arena, entity->string);
|
||||
result.row_strings[row_expr_idx] = entity->string;
|
||||
result.row_view_rules[row_expr_idx] = view_rule->string;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7998,6 +8002,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(locals)
|
||||
result.row_exprs_count = Min(needed_row_count, accel->count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -8036,6 +8041,7 @@ EV_VIEW_RULE_EXPR_EXPAND_RANGE_INFO_FUNCTION_DEF(registers)
|
||||
result.row_exprs_count = Min(needed_row_count, accel->count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -8291,6 +8297,7 @@ rd_ev_view_rule_expr_expand_range_info__meta_entities(Arena *arena, EV_View *vie
|
||||
result.row_exprs_count = Min(needed_row_count, accel->entities.count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -8375,6 +8382,7 @@ rd_ev_view_rule_expr_expand_range_info__meta_ctrl_entities(Arena *arena, EV_View
|
||||
result.row_exprs_count = Min(needed_row_count, accel->entities.count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
@@ -8438,6 +8446,7 @@ rd_ev_view_rule_expr_expand_range_info__debug_info_tables(Arena *arena, EV_View
|
||||
result.row_exprs_count = Min(needed_row_count, accel->items.count);
|
||||
result.row_exprs = push_array(arena, E_Expr *, result.row_exprs_count);
|
||||
result.row_strings = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_view_rules = push_array(arena, String8, result.row_exprs_count);
|
||||
result.row_members = push_array(arena, E_Member *, result.row_exprs_count);
|
||||
for EachIndex(row_expr_idx, result.row_exprs_count)
|
||||
{
|
||||
|
||||
@@ -1192,9 +1192,10 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
//
|
||||
if(snap_to_cursor)
|
||||
{
|
||||
Rng1S64 item_range = r1s64(0, block_tree.total_row_count);
|
||||
Rng1S64 scroll_row_idx_range = r1s64(item_range.min, ClampBot(item_range.min, item_range.max-1));
|
||||
S64 cursor_item_idx = cursor_tbl.y-1;
|
||||
Rng1S64 item_range = r1s64(0, block_tree.total_item_count);
|
||||
Rng1S64 row_range = r1s64(0, block_tree.total_row_count);
|
||||
Rng1S64 scroll_row_idx_range = r1s64(row_range.min, ClampBot(row_range.min, row_range.max-1));
|
||||
S64 cursor_item_idx = cursor_tbl.y;
|
||||
if(item_range.min <= cursor_item_idx && cursor_item_idx <= item_range.max)
|
||||
{
|
||||
UI_ScrollPt *scroll_pt = &scroll_pos.y;
|
||||
@@ -1454,7 +1455,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
{
|
||||
default:{}break;
|
||||
case RD_WatchViewColumnKind_Expr:
|
||||
if(modifiable && filter.size == 0)
|
||||
if(modifiable)
|
||||
{
|
||||
RD_WatchViewCollectionInfo collection_info = rd_collection_info_from_num(&block_ranges, tbl.y);
|
||||
if(collection_info.kind != RD_EntityKind_Nil)
|
||||
@@ -1623,6 +1624,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
snap_to_cursor = 1;
|
||||
RD_EntityList entities_to_remove = {0};
|
||||
RD_WatchViewPoint next_cursor_pt = {0};
|
||||
B32 next_cursor_set = 0;
|
||||
for(S64 y = selection_tbl.min.y; y <= selection_tbl.max.y; y += 1)
|
||||
{
|
||||
for(S64 x = selection_tbl.min.x; x <= selection_tbl.max.x; x += 1)
|
||||
@@ -1661,6 +1663,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
}
|
||||
RD_WatchViewPoint new_pt = {0, parent_key, key};
|
||||
next_cursor_pt = new_pt;
|
||||
next_cursor_set = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1674,6 +1677,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
RD_Entity *view_rule = rd_entity_child_from_kind(entity, RD_EntityKind_ViewRule);
|
||||
rd_entity_mark_for_deletion(view_rule);
|
||||
}
|
||||
ev_key_set_view_rule(eval_view, collection_info.key, str8_zero());
|
||||
}break;
|
||||
}
|
||||
|
||||
@@ -1727,7 +1731,10 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
{
|
||||
rd_entity_mark_for_deletion(n->entity);
|
||||
}
|
||||
ewv->cursor = ewv->mark = ewv->next_cursor = ewv->next_mark = next_cursor_pt;
|
||||
if(next_cursor_set)
|
||||
{
|
||||
ewv->cursor = ewv->mark = ewv->next_cursor = ewv->next_mark = next_cursor_pt;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
@@ -1736,7 +1743,7 @@ rd_watch_view_build(RD_WatchViewState *ewv, RD_WatchViewFlags flags, String8 roo
|
||||
if(!ewv->text_editing && !(evt->flags & UI_EventFlag_Delete) && !(evt->flags & UI_EventFlag_Reorder))
|
||||
{
|
||||
B32 cursor_tbl_min_is_empty_selection[Axis2_COUNT] = {0, 1};
|
||||
Rng2S64 cursor_tbl_range = r2s64(v2s64(0, 0), v2s64(ewv->column_count-1, block_tree.total_row_count-1));
|
||||
Rng2S64 cursor_tbl_range = r2s64(v2s64(0, 0), v2s64(ewv->column_count-1, block_tree.total_item_count-1));
|
||||
Vec2S32 delta = evt->delta_2s32;
|
||||
if(evt->flags & UI_EventFlag_PickSelectSide && !MemoryMatchStruct(&selection_tbl.min, &selection_tbl.max))
|
||||
{
|
||||
|
||||
@@ -3212,7 +3212,7 @@ rd_line_edit(RD_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx
|
||||
|
||||
//- rjf: focus cursor
|
||||
{
|
||||
F32 visible_dim_px = dim_2f32(box->rect).x;
|
||||
F32 visible_dim_px = dim_2f32(box->rect).x - expander_size_px - ui_top_font_size()*depth;
|
||||
if(visible_dim_px != 0)
|
||||
{
|
||||
Rng1F32 cursor_range_px = r1f32(cursor_off-ui_top_font_size()*2.f, cursor_off+ui_top_font_size()*2.f);
|
||||
|
||||
Reference in New Issue
Block a user