mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-09 19:11:38 -07:00
eliminate old eval watch view code
This commit is contained in:
@@ -5483,61 +5483,6 @@ df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBloc
|
||||
MemoryZeroStruct(to_push);
|
||||
}
|
||||
|
||||
internal DF_ExpandKey
|
||||
df_key_from_viz_block_idx_off(DF_EvalVizBlock *block, U64 idx_off)
|
||||
{
|
||||
DF_ExpandKey key = block->key;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
if(idx_off < dim_1u64(block->semantic_idx_range) &&
|
||||
block->semantic_idx_range.min+idx_off < block->backing_search_items.count)
|
||||
{
|
||||
key.child_num = block->backing_search_items.v[block->semantic_idx_range.min+idx_off].idx;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
key.child_num = block->semantic_idx_range.min+1+idx_off;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
internal B32
|
||||
df_viz_block_contains_key(DF_EvalVizBlock *block, DF_ExpandKey key)
|
||||
{
|
||||
B32 result = 0;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
U64 item_num = dbgi_fuzzy_item_num_from_array_element_idx__linear_search(&block->backing_search_items, key.child_num);
|
||||
result = (item_num != 0 && contains_1u64(block->semantic_idx_range, item_num-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (block->semantic_idx_range.min+1 <= key.child_num && key.child_num < block->semantic_idx_range.max+1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal U64
|
||||
df_idx_off_from_viz_block_key(DF_EvalVizBlock *block, DF_ExpandKey key)
|
||||
{
|
||||
U64 idx_off = 0;
|
||||
if(block->backing_search_items.v != 0)
|
||||
{
|
||||
U64 item_num = dbgi_fuzzy_item_num_from_array_element_idx__linear_search(&block->backing_search_items, key.child_num);
|
||||
if(item_num != 0 && contains_1u64(block->semantic_idx_range, item_num-1))
|
||||
{
|
||||
U64 item_idx = item_num-1;
|
||||
idx_off = item_idx-block->semantic_idx_range.min;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
idx_off = key.child_num - (block->semantic_idx_range.min+1);
|
||||
}
|
||||
return idx_off;
|
||||
}
|
||||
|
||||
internal S64
|
||||
df_row_num_from_viz_block_list_key(DF_EvalVizBlockList *blocks, DF_ExpandKey key)
|
||||
{
|
||||
|
||||
@@ -1587,9 +1587,6 @@ internal DF_EvalVizBlockList df_eval_viz_block_list_from_eval_view_expr_num(Aren
|
||||
internal void df_eval_viz_block_list_concat__in_place(DF_EvalVizBlockList *dst, DF_EvalVizBlockList *to_push);
|
||||
|
||||
//- rjf: viz block list <-> table coordinates
|
||||
internal DF_ExpandKey df_key_from_viz_block_idx_off(DF_EvalVizBlock *block, U64 idx);
|
||||
internal B32 df_viz_block_contains_key(DF_EvalVizBlock *block, DF_ExpandKey key);
|
||||
internal U64 df_idx_off_from_viz_block_key(DF_EvalVizBlock *block, DF_ExpandKey key);
|
||||
internal S64 df_row_num_from_viz_block_list_key(DF_EvalVizBlockList *blocks, DF_ExpandKey key);
|
||||
internal DF_ExpandKey df_key_from_viz_block_list_row_num(DF_EvalVizBlockList *blocks, S64 row_num);
|
||||
|
||||
|
||||
@@ -1507,122 +1507,6 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: empty row for edits
|
||||
#if 0
|
||||
if(visible_row_rng.max >= scroll_list_params.item_range.max-1) if(modifiable)
|
||||
{
|
||||
ui_set_next_flags(disabled_flags);
|
||||
UI_NamedTableVectorF("empty_add_new_row")
|
||||
{
|
||||
B32 row_selected = ((semantic_idx+1) == cursor.y);
|
||||
|
||||
//- rjf: expression
|
||||
{
|
||||
B32 cell_selected = (row_selected && cursor.x == DF_EvalWatchViewColumnKind_Expr);
|
||||
|
||||
// rjf: begin editing
|
||||
if(cell_selected && (edit_begin || edit_begin_or_expand))
|
||||
{
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = 0;
|
||||
ewv->input_cursor = txt_pt(1, 1);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: build
|
||||
UI_Signal sig = {0};
|
||||
B32 expr_editing_active = 0;
|
||||
UI_TableCell UI_Font(code_font)
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
expr_editing_active = ui_is_focus_active();
|
||||
sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &ewv->input_cursor, &ewv->input_mark, ewv->input_buffer, sizeof(ewv->input_buffer), &ewv->input_size, 0, str8_lit(""), "###empty_row_expr");
|
||||
edit_commit = edit_commit || sig.commit;
|
||||
}
|
||||
|
||||
// rjf: press -> select & commit if not selected
|
||||
if(sig.pressed)
|
||||
{
|
||||
pressed = 1;
|
||||
edit_commit = edit_commit || (ewv->input_editing && !cell_selected);
|
||||
next_cursor = v2s64(DF_EvalWatchViewColumnKind_Expr, (semantic_idx+1));
|
||||
}
|
||||
|
||||
// rjf: double-click -> begin editing
|
||||
if(sig.double_clicked && !ewv->input_editing)
|
||||
{
|
||||
ui_kill_action();
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = 0;
|
||||
ewv->input_cursor = txt_pt(1, 1);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
// rjf: autocomplete lister
|
||||
if(expr_editing_active && !edit_end)
|
||||
{
|
||||
df_set_autocomp_lister_query(ws, sig.box->key, ctrl_ctx, DF_AutoCompListerFlag_Locals, str8(ewv->input_buffer, ewv->input_size));
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: value
|
||||
{
|
||||
B32 cell_selected = (row_selected && cursor.x == DF_EvalWatchViewColumnKind_Value);
|
||||
UI_TableCell UI_Font(code_font)
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###val_BLANK");
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
if(sig.pressed)
|
||||
{
|
||||
pressed = 1;
|
||||
edit_commit = edit_commit || (ewv->input_editing && !cell_selected);
|
||||
next_cursor = v2s64(DF_EvalWatchViewColumnKind_Value, (semantic_idx+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: type
|
||||
{
|
||||
B32 cell_selected = (row_selected && cursor.x == DF_EvalWatchViewColumnKind_Type);
|
||||
UI_TableCell UI_Font(code_font)
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###type_BLANK");
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
if(sig.pressed)
|
||||
{
|
||||
pressed = 1;
|
||||
edit_commit = edit_commit || (ewv->input_editing && !cell_selected);
|
||||
next_cursor = v2s64(DF_EvalWatchViewColumnKind_Type, (semantic_idx+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: view rule
|
||||
{
|
||||
B32 cell_selected = (row_selected && cursor.x == DF_EvalWatchViewColumnKind_ViewRule);
|
||||
UI_TableCell UI_Font(code_font)
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "###view_rule_BLANK");
|
||||
UI_Signal sig = ui_signal_from_box(box);
|
||||
if(sig.pressed)
|
||||
{
|
||||
pressed = 1;
|
||||
edit_commit = edit_commit || (ewv->input_editing && !cell_selected);
|
||||
next_cursor = v2s64(DF_EvalWatchViewColumnKind_ViewRule, (semantic_idx+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1756,63 +1640,6 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
ewv->selected_parent_key = df_expand_key_make(0, 0);
|
||||
ewv->selected_key = df_expand_key_make(0, 0);
|
||||
if(cursor.y == 0)
|
||||
{
|
||||
ewv->selected_parent_key = df_expand_key_make(0, 0);
|
||||
ewv->selected_key = df_expand_key_make(0, 0);
|
||||
}
|
||||
else if(cursor.y >= blocks.total_semantic_row_count+1)
|
||||
{
|
||||
ewv->selected_parent_key = df_expand_key_make(1, 1);
|
||||
ewv->selected_key = df_expand_key_make(1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DF_EvalVizBlock *block_before_found = 0;
|
||||
DF_EvalVizBlock *found_block = 0;
|
||||
DF_EvalVizBlock *prev = 0;
|
||||
S64 scan_y = 1;
|
||||
for(DF_EvalVizBlock *block = blocks.first; block != 0; prev = block, block = block->next)
|
||||
{
|
||||
S64 advance = (S64)dim_1u64(block->semantic_idx_range);
|
||||
if(scan_y <= cursor.y && cursor.y < scan_y+advance)
|
||||
{
|
||||
block_before_found = prev;
|
||||
found_block = block;
|
||||
ewv->selected_parent_key = block->parent_key;
|
||||
ewv->selected_key = df_key_from_viz_block_idx_off(block, cursor.y-scan_y);
|
||||
break;
|
||||
}
|
||||
scan_y += advance;
|
||||
}
|
||||
|
||||
// rjf: go to parent on collapses
|
||||
if(found_block != 0)
|
||||
{
|
||||
DF_ExpandNode *node = df_expand_node_from_key(&eval_view->expand_tree_table, found_block->parent_key);
|
||||
if(node != 0)
|
||||
{
|
||||
for(DF_ExpandNode *n = node; n != 0; n = n->parent)
|
||||
{
|
||||
if(n->expanded == 0)
|
||||
{
|
||||
DF_ExpandNode *parent = n->parent;
|
||||
ewv->selected_key = parent ? n->key : df_expand_key_make(5381, 1);
|
||||
ewv->selected_parent_key = parent ? parent->key : df_expand_key_make(5381, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(block_before_found != 0 && found_block->depth > 0)
|
||||
{
|
||||
ewv->selected_key = block_before_found->key;
|
||||
ewv->selected_parent_key = block_before_found->parent_key;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(!df_expand_key_match(ewv->selected_key, last_selected_key) ||
|
||||
!df_expand_key_match(ewv->selected_parent_key, last_selected_parent_key))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user