diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 03b6cafa..77c5d55c 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -6349,7 +6349,7 @@ rd_window_frame(void) ProfBeginFunction(); ////////////////////////////// - //- rjf: unpack context + //- rjf: @window_frame_part unpack context // RD_Cfg *window = rd_cfg_from_id(rd_regs()->window); RD_WindowState *ws = rd_window_state_from_cfg(rd_cfg_from_id(rd_regs()->window)); @@ -6357,11 +6357,12 @@ rd_window_frame(void) B32 window_is_focused = (os_window_is_focused(ws->os) || ws->window_temporarily_focused_ipc); B32 popup_is_open = (rd_state->popup_active); B32 query_is_open = (ws->query_is_active); + U64 hover_eval_open_delay_us = 400000; B32 hover_eval_is_open = (!popup_is_open && !query_is_open && ws->hover_eval_string.size != 0 && - ws->hover_eval_first_frame_idx+20 < ws->hover_eval_last_frame_idx && - rd_state->frame_index-ws->hover_eval_last_frame_idx < 20); + ws->hover_eval_firstt_us+hover_eval_open_delay_us < ws->hover_eval_lastt_us && + rd_state->time_in_us - ws->hover_eval_lastt_us < hover_eval_open_delay_us); if(!window_is_focused || popup_is_open) { ws->menu_bar_key_held = 0; @@ -6370,7 +6371,7 @@ rd_window_frame(void) ui_select_state(ws->ui); ////////////////////////////// - //- rjf: compute window's theme + //- rjf: @window_frame_part compute window's theme // { //- rjf: for this window, scan upwards, and then try the project, then the user, until we @@ -6488,7 +6489,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: pre-emptively rasterize common glyphs on the first frame + //- rjf: @window_frame_part pre-emptively rasterize common glyphs on the first frame // if(rd_state->first_window_state == ws && rd_state->last_window_state == ws && ws->frames_alive == 0) { @@ -6534,7 +6535,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: commit window's position/status to underlying cfg tree + //- rjf: @window_frame_part commit window's position/status to underlying cfg tree // { Temp scratch = scratch_begin(0, 0); @@ -6622,49 +6623,19 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: fill panel/view interaction registers + //- rjf: @window_frame_part fill panel/view interaction registers // rd_regs()->panel = panel_tree.focused->cfg->id; rd_regs()->view = panel_tree.focused->selected_tab->id; ////////////////////////////// - //- rjf: gather listers - // - typedef struct ListerTask ListerTask; - struct ListerTask - { - ListerTask *next; - RD_Lister *lister; - UI_Key root_key; - }; - ListerTask *first_lister_task = 0; - ListerTask *last_lister_task = 0; - ProfScope("build all listers") - { - if(ws->autocomp_lister != 0 && ws->autocomp_lister_last_frame_idx+1 >= rd_state->frame_index) - { - ListerTask *task = push_array(scratch.arena, ListerTask, 1); - SLLQueuePush(first_lister_task, last_lister_task, task); - task->lister = ws->autocomp_lister; - task->root_key = ui_key_from_stringf(ui_key_zero(), "###lister_%p", task->lister); - } - if(ws->top_query_lister != 0) - { - ListerTask *task = push_array(scratch.arena, ListerTask, 1); - SLLQueuePush(first_lister_task, last_lister_task, task); - task->lister = ws->top_query_lister; - task->root_key = ui_key_from_stringf(ui_key_zero(), "###lister_%p", task->lister); - } - } - - ////////////////////////////// - //- rjf: build UI + //- rjf: @window_frame_part build UI // UI_Box *lister_box = &ui_nil_box; ProfScope("build UI") { //////////////////////////// - //- rjf: set up + //- rjf: @window_ui_part set up // { // rjf: gather font info @@ -6714,7 +6685,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: calculate top-level rectangles + //- rjf: @window_ui_part calculate top-level rectangles/sizes // Rng2F32 window_rect = os_client_rect_from_window(ws->os); Vec2F32 window_rect_dim = dim_2f32(window_rect); @@ -6725,7 +6696,7 @@ rd_window_frame(void) content_rect = pad_2f32(content_rect, -window_edge_px); //////////////////////////// - //- rjf: truncated string hover + //- rjf: @window_ui_part truncated string hover // if(ui_string_hover_active()) UI_Tooltip { @@ -6737,7 +6708,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: drag/drop tooltips + //- rjf: @window_ui_part drag/drop tooltips // if(rd_state->drag_drop_regs_slot != RD_RegSlot_Null && rd_drag_is_active()) { @@ -6918,7 +6889,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: drag/drop visualization tooltips + //- rjf: @window_ui_part drag/drop visualization tooltips // if(rd_drag_is_active() && window_is_focused) RD_RegsScope(.window = rd_state->drag_drop_regs->window, @@ -6968,7 +6939,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: developer menu + //- rjf: @window_ui_part developer menu // if(ws->dev_menu_is_open) RD_Font(RD_FontSlot_Code) { @@ -7090,7 +7061,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: top-level registers context menu + //- rjf: @window_ui_part top-level registers context menu // UI_CtxMenu(rd_state->ctx_menu_key) UI_PrefWidth(ui_em(50.f, 1.f)) { @@ -7352,7 +7323,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: drop-completion context menu + //- rjf: @window_ui_part drop-completion context menu // if(ws->drop_completion_paths.node_count != 0) { @@ -7429,7 +7400,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: popup + //- rjf: @window_ui_part popup // { if(rd_state->popup_t > 0.005f) UI_TextAlignment(UI_TextAlign_Center) UI_Focus(rd_state->popup_active ? UI_FocusKind_Root : UI_FocusKind_Off) @@ -7479,108 +7450,328 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: build query + //- rjf: @window_ui_part gather all tasks to build floating views // - if(query_is_open) + typedef struct FloatingViewTask FloatingViewTask; + struct FloatingViewTask { - //- rjf: unpack query parameters - String8 cmd_name = ws->query_cmd_name; - RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name); - B32 size_query_by_expr_eval = (cmd_kind_info->query.expr.size == 0); - B32 query_is_anchored = (!ui_box_is_nil(ui_box_from_key(ws->query_regs->ui_key))); - - //- rjf: build & prepare view for query ui - RD_Cfg *window_query = rd_immediate_cfg_from_keyf("window_query_%p", window); - RD_Cfg *view = rd_cfg_child_from_string_or_alloc(window_query, str8_lit("watch")); - RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression")); - RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query")); - RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd")); - rd_cfg_new_replace(cmd, cmd_name); - rd_cfg_child_from_string_or_alloc(view, str8_lit("lister")); - RD_ViewState *vs = rd_view_state_from_cfg(view); - vs->query_is_selected = 1; - String8 query_expression = cmd_kind_info->query.expr; - if(query_expression.size == 0) + FloatingViewTask *next; + RD_Cfg *view; + F32 row_height_px; + Rng2F32 rect; + String8 view_name; + String8 expr; + B32 is_focused; + UI_Signal signal; // NOTE(rjf): output, from build + }; + FloatingViewTask *hover_eval_floating_view_task = 0; + FloatingViewTask *query_floating_view_task = 0; + FloatingViewTask *first_floating_view_task = 0; + FloatingViewTask *last_floating_view_task = 0; + RD_Font(RD_FontSlot_Code) + UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main)) + { + //- rjf: try to add hover eval first + if(ws->hover_eval_string.size != 0) { - query_expression = str8(vs->query_buffer, vs->query_string_size); + B32 build_hover_eval = (hover_eval_is_open && (!rd_drag_is_active() || rd_state->drag_drop_regs_slot == RD_RegSlot_View)); + + // rjf: disable hover eval if hovered view is actively scrolling + if(hover_eval_is_open) + { + for(RD_PanelNode *panel = panel_tree.root; + panel != &rd_nil_panel_node; + panel = rd_panel_node_rec__depth_first_pre(panel_tree.root, panel).next) + { + if(panel->first != &rd_nil_panel_node) { continue; } + RD_Cfg *tab = panel->selected_tab; + if(tab != &rd_nil_cfg) + { + RD_ViewState *vs = rd_view_state_from_cfg(tab); + Rng2F32 panel_rect = rd_target_rect_from_panel_node(content_rect, panel_tree.root, panel); + if(contains_2f32(panel_rect, ui_mouse()) && + (abs_f32(vs->scroll_pos.x.off) > 0.01f || + abs_f32(vs->scroll_pos.y.off) > 0.01f)) + { + build_hover_eval = 0; + ws->hover_eval_firstt_us = rd_state->time_in_us; + } + } + } + } + + // rjf: choose hover evaluation expression + String8 hover_eval_expr = push_str8f(scratch.arena, "%S%s%S", ws->hover_eval_string, ws->hover_eval_view_rules.size != 0 ? " => " : "", ws->hover_eval_view_rules); + + // rjf: evaluate hover evaluation expression, & determine if it evaluates + // such that we want to build a hover eval. + E_Eval hover_eval = e_eval_from_string(scratch.arena, hover_eval_expr); + { + if(hover_eval.msgs.max_kind > E_MsgKind_Null) + { + build_hover_eval = 0; + } + else if(hover_eval.space.kind == RD_EvalSpaceKind_MetaCfg && + rd_cfg_from_eval_space(hover_eval.space) == &rd_nil_cfg) + { + build_hover_eval = 0; + } + else if((hover_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity || + hover_eval.space.kind == RD_EvalSpaceKind_CtrlEntity) && + rd_ctrl_entity_from_eval_space(hover_eval.space) == &ctrl_entity_nil) + { + build_hover_eval = 0; + } + } + + // rjf: determine if we have a top-level visualizer + EV_ExpandRuleTagPair expand_rule_tag = ev_expand_rule_tag_pair_from_expr_irtree(hover_eval.exprs.last, &hover_eval.irtree); + RD_ViewUIRule *view_ui_rule = rd_view_ui_rule_from_string(expand_rule_tag.rule->string); + + // rjf: determine view name + String8 view_name = str8_lit("watch"); + if(view_ui_rule != &rd_nil_view_ui_rule) + { + view_name = view_ui_rule->name; + } + + // rjf: build view + RD_Cfg *root = rd_immediate_cfg_from_keyf("hover_eval_view"); + RD_Cfg *view = rd_cfg_child_from_string_or_alloc(root, view_name); RD_Cfg *explicit_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root")); rd_cfg_new(explicit_root, str8_lit("1")); - } - else - { - U64 input_insertion_pos = str8_find_needle(query_expression, 0, str8_lit("$input"), 0); - if(input_insertion_pos < query_expression.size) + + // rjf: request frames if we're waiting to open + if(ws->hover_eval_string.size != 0 && + !hover_eval_is_open && + ws->hover_eval_lastt_us < ws->hover_eval_firstt_us+hover_eval_open_delay_us && + rd_state->time_in_us - ws->hover_eval_lastt_us < hover_eval_open_delay_us*2) { - String8 pre_insertion = str8_prefix(query_expression, input_insertion_pos); - String8 post_insertion = str8_skip(query_expression, input_insertion_pos + 6); - query_expression = push_str8f(scratch.arena, "%S%S%S", pre_insertion, str8(vs->query_buffer, vs->query_string_size), post_insertion); + rd_request_frame(); + } + + // rjf: reset focus state if hover eval is not being built + if(!build_hover_eval || ws->hover_eval_string.size == 0 || !hover_eval_is_open) + { + ws->hover_eval_focused = 0; + } + + // rjf: determine size of hover evaluation container + EV_BlockTree predicted_block_tree = {0}; + RD_RegsScope(.view = view->id) + { + predicted_block_tree = ev_block_tree_from_exprs(scratch.arena, rd_view_eval_view(), str8_zero(), hover_eval.exprs); + } + F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); + U64 max_row_count = (U64)floor_f32(ui_top_font_size()*10.f / row_height_px); + if(ws->hover_eval_focused) + { + max_row_count *= 3; + } + U64 needed_row_count = Min(max_row_count, predicted_block_tree.total_row_count); + F32 num_rows_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "hover_eval_num_rows_t"), (F32)needed_row_count); + F32 width_px = 60.f*ui_top_font_size(); + F32 height_px = num_rows_t*row_height_px; + + // rjf: if arbitrary visualizer, pick catchall size + if(view_ui_rule != &rd_nil_view_ui_rule) + { + height_px = 40.f*ui_top_font_size(); + } + + // rjf: determine hover eval top-level rect + Rng2F32 rect = r2f32p(ws->hover_eval_spawn_pos.x, + ws->hover_eval_spawn_pos.y, + ws->hover_eval_spawn_pos.x + width_px, + ws->hover_eval_spawn_pos.y + height_px); + + // rjf: push hover eval task + if(build_hover_eval) + { + FloatingViewTask *t = push_array(scratch.arena, FloatingViewTask, 1); + SLLQueuePush(first_floating_view_task, last_floating_view_task, t); + hover_eval_floating_view_task = t; + t->view = view; + t->row_height_px = row_height_px; + t->rect = rect; + t->view_name = view_name; + t->expr = hover_eval_expr; + t->is_focused = ws->hover_eval_focused; } - rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("explicit_root"))); - } - rd_cfg_new_replace(expr, query_expression); - E_Eval query_eval = e_eval_from_string(scratch.arena, query_expression); - F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); - - //- rjf: cancel - if(ui_slot_press(UI_EventActionSlot_Cancel)) - { - rd_cmd(RD_CmdKind_CancelQuery); } - //- rjf: build - RD_RegsScope(.view = view->id) + //- rjf: try to add opened query + if(query_is_open) { - Vec2F32 content_rect_center = center_2f32(content_rect); - Vec2F32 content_rect_dim = dim_2f32(content_rect); - EV_BlockTree predicted_block_tree = ev_block_tree_from_exprs(scratch.arena, rd_view_eval_view(), rd_view_query_input(), query_eval.exprs); - F32 query_open_t = ui_anim(ui_key_from_string(ui_key_zero(), str8_lit("query_open_t")), 1.f); - F32 query_width_px = floor_f32(dim_2f32(content_rect).x * 0.35f); - F32 max_query_height_px = content_rect_dim.y*0.8f; - F32 query_height_px = max_query_height_px; - if(size_query_by_expr_eval) + if(ui_slot_press(UI_EventActionSlot_Cancel)) { - query_height_px = row_height_px*predicted_block_tree.total_row_count; - query_height_px = Min(query_height_px, max_query_height_px); + rd_cmd(RD_CmdKind_CancelQuery); } - Rng2F32 query_rect = r2f32p(content_rect_center.x - query_width_px/2, - content_rect_center.y - max_query_height_px/2.f, - content_rect_center.x + query_width_px/2, - content_rect_center.y - max_query_height_px/2.f + query_height_px*query_open_t); - if(!ui_key_match(ui_key_zero(), ws->query_regs->ui_key)) + + // rjf: unpack query info + String8 cmd_name = ws->query_cmd_name; + RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name); + B32 size_query_by_expr_eval = (cmd_kind_info->query.expr.size == 0); + B32 query_is_anchored = (!ui_box_is_nil(ui_box_from_key(ws->query_regs->ui_key))); + F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); + + // rjf: build view for query + RD_Cfg *root = rd_immediate_cfg_from_keyf("window_query_%p", window); + RD_Cfg *view = rd_cfg_child_from_string_or_alloc(root, str8_lit("watch")); + RD_Cfg *query = rd_cfg_child_from_string_or_alloc(view, str8_lit("query")); + RD_Cfg *cmd = rd_cfg_child_from_string_or_alloc(query, str8_lit("cmd")); + rd_cfg_new_replace(cmd, cmd_name); + rd_cfg_child_from_string_or_alloc(view, str8_lit("lister")); + RD_ViewState *vs = rd_view_state_from_cfg(view); + vs->query_is_selected = 1; + + // rjf: compute query expression + String8 query_expression = cmd_kind_info->query.expr; + if(query_expression.size == 0) { - UI_Box *anchor_box = ui_box_from_key(ws->query_regs->ui_key); - if(anchor_box != &ui_nil_box) + query_expression = str8(vs->query_buffer, vs->query_string_size); + } + else + { + U64 input_insertion_pos = str8_find_needle(query_expression, 0, str8_lit("$input"), 0); + if(input_insertion_pos < query_expression.size) { - query_rect.x0 = anchor_box->rect.x0; - query_rect.y0 = anchor_box->rect.y1; - query_rect.x1 = query_rect.x0 + ui_top_font_size()*40.f; - query_rect.y1 = query_rect.y0 + query_height_px; + String8 pre_insertion = str8_prefix(query_expression, input_insertion_pos); + String8 post_insertion = str8_skip(query_expression, input_insertion_pos + 6); + query_expression = push_str8f(scratch.arena, "%S%S%S", pre_insertion, str8(vs->query_buffer, vs->query_string_size), post_insertion); } } - RD_Font(RD_FontSlot_Code) - UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main)) - UI_TagF("floating") - UI_Focus(UI_FocusKind_On) + + // rjf: based on query expression, determine if we have an explicit root + if(query_expression.size == 0) + { + RD_Cfg *explicit_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root")); + rd_cfg_new(explicit_root, str8_lit("1")); + } + else + { + rd_cfg_release(rd_cfg_child_from_string(view, str8_lit("explicit_root"))); + } + + // rjf: evaluate query expression + E_Eval query_eval = e_eval_from_string(scratch.arena, query_expression); + + // rjf: compute query view's top-level rectangle + Rng2F32 rect = {0}; + RD_RegsScope(.view = view->id) + { + Vec2F32 content_rect_center = center_2f32(content_rect); + Vec2F32 content_rect_dim = dim_2f32(content_rect); + EV_BlockTree predicted_block_tree = ev_block_tree_from_exprs(scratch.arena, rd_view_eval_view(), rd_view_query_input(), query_eval.exprs); + F32 query_width_px = floor_f32(content_rect_dim.x * 0.35f); + F32 max_query_height_px = content_rect_dim.y*0.8f; + F32 query_height_px = max_query_height_px; + if(size_query_by_expr_eval) + { + query_height_px = row_height_px*predicted_block_tree.total_row_count; + query_height_px = Min(query_height_px, max_query_height_px); + } + rect = r2f32p(content_rect_center.x - query_width_px/2, + content_rect_center.y - max_query_height_px/2.f, + content_rect_center.x + query_width_px/2, + content_rect_center.y - max_query_height_px/2.f + query_height_px); + } + + // rjf: push query task + { + FloatingViewTask *t = push_array(scratch.arena, FloatingViewTask, 1); + SLLQueuePush(first_floating_view_task, last_floating_view_task, t); + query_floating_view_task = t; + t->view = view; + t->row_height_px = row_height_px; + t->rect = rect; + t->view_name = str8_lit("watch"); + t->expr = query_expression; + t->is_focused = 1; + } + } + } + + //////////////////////////// + //- rjf: @window_ui_part build all floating views + // + ProfScope("build all floating views") + RD_Font(RD_FontSlot_Code) + UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main)) + UI_TagF("floating") + { + for(FloatingViewTask *t = first_floating_view_task; t != 0; t = t->next) + { + // rjf: unpack + RD_Cfg *view = t->view; + F32 row_height_px = t->row_height_px; + Rng2F32 rect = t->rect; + String8 view_name = t->view_name; + String8 expr = t->expr; + B32 is_focused = t->is_focused; + F32 open_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "floating_view_open_%p", view), 1.f); + + // rjf: build cfg tree + RD_Cfg *expr_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression")); + rd_cfg_new(view, str8_lit("selected")); + rd_cfg_new_replace(expr_root, expr); + + // rjf: push view regs + rd_push_regs(.view = view->id); + { + String8 view_expr = rd_expr_from_cfg(view); + String8 view_file_path = rd_file_path_from_eval_string(rd_frame_arena(), view_expr); + // NOTE(rjf): we want to only fill out this view's file path slot if it + // evaluates one - this way, a view can use the slot to know the selected + // file path (if there is one). this is useful when pushing commandas which + // apply to a cursor, for example. + if(view_file_path.size != 0) + { + rd_regs()->file_path = view_file_path; + } + } + + // rjf: build + UI_Focus(is_focused ? UI_FocusKind_On : UI_FocusKind_Off) UI_PrefHeight(ui_px(row_height_px, 1.f)) { - //- rjf: build top-level container + // rjf: build top-level container box UI_Box *container = &ui_nil_box; - UI_Rect(query_rect) - UI_Squish(0.25f-0.25f*query_open_t) - UI_Transparency(1.f-query_open_t) - UI_ChildLayoutAxis(Axis2_Y) + UI_Rect(rect) UI_ChildLayoutAxis(Axis2_Y) UI_Squish(0.25f-0.25f*open_t) UI_Transparency(1.f-open_t) { - container = ui_build_box_from_string(UI_BoxFlag_Clickable| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_DrawBackground| - UI_BoxFlag_DrawBackgroundBlur| - UI_BoxFlag_DisableFocusOverlay| - UI_BoxFlag_DrawDropShadow, - str8_lit("query_container")); + container = ui_build_box_from_stringf(UI_BoxFlag_Clickable| + UI_BoxFlag_DrawBorder| + UI_BoxFlag_DrawBackground| + UI_BoxFlag_DrawBackgroundBlur| + UI_BoxFlag_DisableFocusOverlay| + UI_BoxFlag_DrawDropShadow, + "floating_view_container_%p", view); } - //- rjf: fill container - UI_Parent(container) UI_Focus(UI_FocusKind_Null) + // rjf: peek press events -> focus hover eval if we have a press + if(!ws->hover_eval_focused) + { + for(UI_Event *evt = 0; ui_next_event(&evt);) + { + if(evt->kind == UI_EventKind_Press && + evt->key == OS_Key_LeftMouseButton && + contains_2f32(container->rect, evt->pos)) + { + ws->hover_eval_focused = 1; + break; + } + } + } + + // rjf: build overlay container for loading animation + UI_Box *loading_overlay_container = &ui_nil_box; + UI_Parent(container) UI_WidthFill UI_HeightFill + { + loading_overlay_container = ui_build_box_from_key(UI_BoxFlag_Floating, ui_key_zero()); + } + + // rjf: build contents + UI_Parent(container) UI_Focus(is_focused ? UI_FocusKind_Null : UI_FocusKind_Off) { ui_set_next_pref_width(ui_pct(1, 0)); ui_set_next_pref_height(ui_pct(1, 0)); @@ -7588,35 +7779,95 @@ rd_window_frame(void) UI_Box *view_contents_container = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clip, "###view_contents_container"); UI_Parent(view_contents_container) UI_WidthFill { - rd_view_ui(view_contents_container->rect); + rd_view_ui(rect); } } - //- rjf: fallthrough interactions on container + // rjf: build loading overlay + { + RD_ViewState *vs = rd_view_state_from_cfg(view); + F32 loading_t = vs->loading_t; + if(loading_t > 0.01f) UI_Parent(loading_overlay_container) + { + rd_loading_overlay(rect, loading_t, vs->loading_progress_v, vs->loading_progress_v_target); + } + } + + // rjf: interact with container UI_Signal sig = ui_signal_from_box(container); + t->signal = sig; } - } - - //- rjf: any queries which take a file path mutate the debugger's "current path" - if(cmd_kind_info->query.slot == RD_RegSlot_FilePath) - { - RD_Cfg *input = rd_cfg_child_from_string(query, str8_lit("input")); - if(input != &rd_nil_cfg) + + // rjf: pop interaction registers; commit if this is focused + RD_Regs *view_regs = rd_pop_regs(); + if(is_focused) { - String8 path_chopped = str8_chop_last_slash(input->first->string); - rd_cmd(RD_CmdKind_SetCurrentPath, .file_path = path_chopped); + MemoryCopyStruct(rd_regs(), view_regs); } } - - //- rjf: build darkening rectangle over rest of screen - if(!query_is_anchored) UI_Rect(window_rect) UI_TagF("inactive") - { - ui_build_box_from_key(UI_BoxFlag_DrawBackground, ui_key_zero()); - } } //////////////////////////// - //- rjf: top bar + //- rjf: @window_ui_part do special handling of floating view interactions + // + { + //- rjf: hover eval focus rules + if(hover_eval_floating_view_task) + { + UI_Signal sig = hover_eval_floating_view_task->signal; + if(ui_pressed(sig)) + { + ws->hover_eval_focused = 1; + } + if(ui_mouse_over(sig) || ws->hover_eval_focused) + { + ws->hover_eval_lastt_us = rd_state->time_in_us; + } + else if(ws->hover_eval_lastt_us+1000000 < rd_state->time_in_us) + { + rd_request_frame(); + } + if(ws->hover_eval_focused) + { + for(UI_Event *evt = 0; ui_next_event(&evt);) + { + if(evt->kind == UI_EventKind_Press && + evt->key == OS_Key_LeftMouseButton && + !contains_2f32(hover_eval_floating_view_task->rect, evt->pos)) + { + ws->hover_eval_focused = 0; + MemoryZeroStruct(&ws->hover_eval_string); + arena_clear(ws->hover_eval_arena); + rd_request_frame(); + break; + } + } + } + } + + //- rjf: query interactions + if(query_floating_view_task) + { + String8 cmd_name = ws->query_cmd_name; + RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name); + + // rjf: any queries which take a file path mutate the debugger's "current path" + if(cmd_kind_info->query.slot == RD_RegSlot_FilePath) + { + RD_Cfg *view = query_floating_view_task->view; + RD_Cfg *query = rd_cfg_child_from_string(view, str8_lit("query")); + RD_Cfg *input = rd_cfg_child_from_string(query, str8_lit("input")); + if(input != &rd_nil_cfg) + { + String8 path_chopped = str8_chop_last_slash(input->first->string); + rd_cmd(RD_CmdKind_SetCurrentPath, .file_path = path_chopped); + } + } + } + } + + //////////////////////////// + //- rjf: @window_ui_part top bar // ProfScope("build top bar") { @@ -8382,238 +8633,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: build hover eval - // - ProfScope("build hover eval") - { - B32 build_hover_eval = hover_eval_is_open && (!rd_drag_is_active() || rd_state->drag_drop_regs_slot == RD_RegSlot_View); - - // rjf: disable hover eval if hovered view is actively scrolling - if(hover_eval_is_open) - { - for(RD_PanelNode *panel = panel_tree.root; - panel != &rd_nil_panel_node; - panel = rd_panel_node_rec__depth_first_pre(panel_tree.root, panel).next) - { - if(panel->first != &rd_nil_panel_node) { continue; } - RD_Cfg *tab = panel->selected_tab; - if(tab != &rd_nil_cfg) - { - RD_ViewState *vs = rd_view_state_from_cfg(tab); - Rng2F32 panel_rect = rd_target_rect_from_panel_node(content_rect, panel_tree.root, panel); - if(contains_2f32(panel_rect, ui_mouse()) && - (abs_f32(vs->scroll_pos.x.off) > 0.01f || - abs_f32(vs->scroll_pos.y.off) > 0.01f)) - { - build_hover_eval = 0; - ws->hover_eval_first_frame_idx = rd_state->frame_index; - } - } - } - } - - // rjf: evaluate hover-evaluation expression - if it doesn't evaluate, then don't build anything - String8 hover_eval_expr = push_str8f(scratch.arena, "%S%s%S", ws->hover_eval_string, ws->hover_eval_view_rules.size != 0 ? " => " : "", ws->hover_eval_view_rules); - E_Eval hover_eval = e_eval_from_string(scratch.arena, hover_eval_expr); - if(hover_eval.msgs.max_kind > E_MsgKind_Null) - { - build_hover_eval = 0; - } - else if(hover_eval.space.kind == RD_EvalSpaceKind_MetaCfg && - rd_cfg_from_eval_space(hover_eval.space) == &rd_nil_cfg) - { - build_hover_eval = 0; - } - else if((hover_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity || - hover_eval.space.kind == RD_EvalSpaceKind_CtrlEntity) && - rd_ctrl_entity_from_eval_space(hover_eval.space) == &ctrl_entity_nil) - { - build_hover_eval = 0; - } - - // rjf: determine if we have a top-level visualizer - EV_ExpandRuleTagPair expand_rule_tag = ev_expand_rule_tag_pair_from_expr_irtree(hover_eval.exprs.last, &hover_eval.irtree); - RD_ViewUIRule *view_ui_rule = rd_view_ui_rule_from_string(expand_rule_tag.rule->string); - - // rjf: request frames if we're waiting to open - if(ws->hover_eval_string.size != 0 && !hover_eval_is_open && ws->hover_eval_last_frame_idx < ws->hover_eval_first_frame_idx+20 && rd_state->frame_index-ws->hover_eval_last_frame_idx < 50) - { - rd_request_frame(); - } - - // rjf: reset focus state if hover eval is not being built - if(!build_hover_eval || ws->hover_eval_string.size == 0 || !hover_eval_is_open) - { - ws->hover_eval_focused = 0; - } - - // rjf: build hover eval - if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open) - RD_Font(RD_FontSlot_Code) - UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main)) - UI_TagF("floating") - { - // rjf: build cfg tree for temporary view - String8 view_name = str8_lit("watch"); - if(view_ui_rule != &rd_nil_view_ui_rule) - { - view_name = view_ui_rule->name; - } - F32 hover_eval_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "hover_eval_open_t"), 1.f); - RD_Cfg *root = rd_immediate_cfg_from_keyf("hover_eval_%p", ws); - RD_Cfg *view = rd_cfg_child_from_string_or_alloc(root, view_name); - RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(view, str8_lit("expression")); - RD_Cfg *explicit_root = rd_cfg_child_from_string_or_alloc(view, str8_lit("explicit_root")); - rd_cfg_new(view, str8_lit("selected")); - rd_cfg_new(explicit_root, str8_lit("1")); - rd_cfg_new_replace(expr, hover_eval_expr); - - // rjf: push view regs - rd_push_regs(.view = view->id); - { - String8 view_expr = rd_expr_from_cfg(view); - String8 view_file_path = rd_file_path_from_eval_string(rd_frame_arena(), view_expr); - // NOTE(rjf): we want to only fill out this view's file path slot if it - // evaluates one - this way, a view can use the slot to know the selected - // file path (if there is one). this is useful when pushing commandas which - // apply to a cursor, for example. - if(view_file_path.size != 0) - { - rd_regs()->file_path = view_file_path; - } - } - - // rjf: determine size of hover evaluation container - EV_BlockTree predicted_block_tree = ev_block_tree_from_exprs(scratch.arena, rd_view_eval_view(), str8_zero(), hover_eval.exprs); - F32 row_height_px = floor_f32(ui_top_font_size()*2.5f); - U64 max_row_count = (U64)floor_f32(ui_top_font_size()*10.f / row_height_px); - if(ws->hover_eval_focused) - { - max_row_count *= 3; - } - U64 needed_row_count = Min(max_row_count, predicted_block_tree.total_row_count); - F32 num_rows_t = ui_anim(ui_key_from_stringf(ui_key_zero(), "hover_eval_num_rows_t"), (F32)needed_row_count); - F32 width_px = 60.f*ui_top_font_size(); - F32 height_px = num_rows_t*row_height_px; - - // rjf: if arbitrary visualizer, pick catchall size - if(view_ui_rule != &rd_nil_view_ui_rule) - { - height_px = 40.f*ui_top_font_size(); - } - - // rjf: build container - UI_Focus(ws->hover_eval_focused ? UI_FocusKind_On : UI_FocusKind_Off) - UI_PrefHeight(ui_px(row_height_px, 1.f)) - { - // rjf: build top-level container box - Rng2F32 rect = r2f32p(ws->hover_eval_spawn_pos.x, - ws->hover_eval_spawn_pos.y, - ws->hover_eval_spawn_pos.x + width_px, - ws->hover_eval_spawn_pos.y + height_px); - ui_set_next_fixed_x(rect.x0); - ui_set_next_fixed_y(rect.y0); - ui_set_next_pref_width(ui_px(rect.x1-rect.x0, 1.f)); - ui_set_next_pref_height(ui_px(rect.y1-rect.y0, 1.f)); - ui_set_next_child_layout_axis(Axis2_Y); - ui_set_next_squish(0.25f-0.25f*hover_eval_t); - ui_set_next_transparency(1.f-hover_eval_t); - UI_Box *container = ui_build_box_from_string(UI_BoxFlag_Clickable| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_DrawBackground| - UI_BoxFlag_DrawBackgroundBlur| - UI_BoxFlag_DisableFocusOverlay| - UI_BoxFlag_DrawDropShadow, - str8_lit("hover_eval_container")); - - // rjf: peek press events -> focus hover eval if we have a press - if(!ws->hover_eval_focused) - { - for(UI_Event *evt = 0; ui_next_event(&evt);) - { - if(evt->kind == UI_EventKind_Press && - evt->key == OS_Key_LeftMouseButton && - contains_2f32(container->rect, evt->pos)) - { - ws->hover_eval_focused = 1; - break; - } - } - } - - // rjf: build overlay container for loading animation - UI_Box *loading_overlay_container = &ui_nil_box; - UI_Parent(container) UI_WidthFill UI_HeightFill - { - loading_overlay_container = ui_build_box_from_key(UI_BoxFlag_Floating, ui_key_zero()); - } - - // rjf: build contents - UI_Parent(container) UI_Focus(ws->hover_eval_focused ? UI_FocusKind_Null : UI_FocusKind_Off) - { - ui_set_next_pref_width(ui_pct(1, 0)); - ui_set_next_pref_height(ui_pct(1, 0)); - ui_set_next_child_layout_axis(Axis2_Y); - UI_Box *view_contents_container = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder|UI_BoxFlag_DrawBackground|UI_BoxFlag_Clip, "###view_contents_container"); - UI_Parent(view_contents_container) UI_WidthFill - { - rd_view_ui(rect); - } - } - - // rjf: build loading overlay - { - RD_ViewState *vs = rd_view_state_from_cfg(view); - F32 loading_t = vs->loading_t; - if(loading_t > 0.01f) UI_Parent(loading_overlay_container) - { - rd_loading_overlay(rect, loading_t, vs->loading_progress_v, vs->loading_progress_v_target); - } - } - - // rjf: interact with container - UI_Signal sig = ui_signal_from_box(container); - if(ui_pressed(sig)) - { - ws->hover_eval_focused = 1; - } - if(ui_mouse_over(sig) || ws->hover_eval_focused) - { - ws->hover_eval_last_frame_idx = rd_state->frame_index; - } - else if(ws->hover_eval_last_frame_idx+2 < rd_state->frame_index) - { - rd_request_frame(); - } - if(ws->hover_eval_focused) - { - for(UI_Event *evt = 0; ui_next_event(&evt);) - { - if(evt->kind == UI_EventKind_Press && - evt->key == OS_Key_LeftMouseButton && - !contains_2f32(container->rect, evt->pos)) - { - ws->hover_eval_focused = 0; - MemoryZeroStruct(&ws->hover_eval_string); - arena_clear(ws->hover_eval_arena); - rd_request_frame(); - break; - } - } - } - } - - // rjf: pop interaction registers; commit if this is the selected view - RD_Regs *view_regs = rd_pop_regs(); - if(ws->hover_eval_focused) - { - MemoryCopyStruct(rd_regs(), view_regs); - } - } - } - - //////////////////////////// - //- rjf: bottom bar + //- rjf: @window_ui_part bottom bar // ProfScope("build bottom bar") { @@ -8710,7 +8730,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: panel non-leaf UI (drag boundaries, drag/drop sites) + //- rjf: @window_ui_part panel non-leaf UI (drag boundaries, drag/drop sites) // B32 is_changing_panel_boundaries = 0; ProfScope("non-leaf panel UI") @@ -9010,7 +9030,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: animate panels + //- rjf: @window_ui_part animate panels // { Vec2F32 content_rect_dim = dim_2f32(content_rect); @@ -9036,7 +9056,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: panel leaf UI + //- rjf: @window_ui_part panel leaf UI // if(content_rect.x1 > content_rect.x0 && content_rect.y1 > content_rect.y0) { @@ -9794,7 +9814,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: drag/drop cancelling + //- rjf: @window_ui_part drag/drop cancelling // if(rd_drag_is_active() && ui_slot_press(UI_EventActionSlot_Cancel)) { @@ -9803,7 +9823,7 @@ rd_window_frame(void) } //////////////////////////// - //- rjf: font size changing + //- rjf: @window_ui_part top-level font size changing // for(UI_Event *evt = 0; ui_next_event(&evt);) { @@ -9825,47 +9845,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: attach lister boxes to root, or hide if it has not been renewed - // - for(ListerTask *task = first_lister_task; task != 0; task = task->next) - { - RD_Lister *lister = task->lister; - RD_Regs *regs = lister->regs; - UI_Box *lister_box = ui_box_from_key(task->root_key); - if(!ui_box_is_nil(lister_box) && (lister != ws->autocomp_lister || ws->autocomp_lister_last_frame_idx+1 >= rd_state->frame_index+1)) - { - UI_Box *anchor_box = ui_box_from_key(lister->regs->ui_key); - if(!ui_box_is_nil(anchor_box)) - { - Vec2F32 size = lister_box->fixed_size; - lister_box->fixed_position = v2f32(anchor_box->rect.x0 + lister->regs->off_px.x, - anchor_box->rect.y0 + lister->regs->off_px.y); - lister_box->rect = r2f32(lister_box->fixed_position, add_2f32(lister_box->fixed_position, size)); - for(Axis2 axis = (Axis2)0; axis < Axis2_COUNT; axis = (Axis2)(axis + 1)) - { - ui_calc_sizes_standalone__in_place_rec(lister_box, axis); - ui_calc_sizes_upwards_dependent__in_place_rec(lister_box, axis); - ui_calc_sizes_downwards_dependent__in_place_rec(lister_box, axis); - ui_layout_enforce_constraints__in_place_rec(lister_box, axis); - ui_layout_position__in_place_rec(lister_box, axis); - } - } - } - else if(!ui_box_is_nil(lister_box) && lister == ws->autocomp_lister && ws->autocomp_lister_last_frame_idx+1 < rd_state->frame_index+1) - { - UI_Box *anchor_box = ui_box_from_key(lister->regs->ui_key); - if(!ui_box_is_nil(anchor_box)) - { - Vec2F32 size = lister_box->fixed_size; - Rng2F32 window_rect = os_client_rect_from_window(ws->os); - lister_box->fixed_position = v2f32(window_rect.x1, window_rect.y1); - lister_box->rect = r2f32(lister_box->fixed_position, add_2f32(lister_box->fixed_position, size)); - } - } - } - - ////////////////////////////// - //- rjf: hover eval cancelling + //- rjf: @window_frame_part hover eval cancelling // if(ws->hover_eval_string.size != 0 && ui_slot_press(UI_EventActionSlot_Cancel)) { @@ -9875,7 +9855,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: animate + //- rjf: @window_frame_part animate // if(ui_animating_from_state(ws->ui)) { @@ -9883,7 +9863,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: draw UI + //- rjf: @window_frame_part draw UI // ws->draw_bucket = dr_bucket_make(); DR_BucketScope(ws->draw_bucket) @@ -10332,7 +10312,7 @@ rd_window_frame(void) } ////////////////////////////// - //- rjf: increment per-window frame counter + //- rjf: @window_frame_part increment per-window frame counter // ws->frames_alive += 1; @@ -10823,11 +10803,11 @@ rd_value_string_from_eval(Arena *arena, String8 filter, EV_StringFlags flags, U3 //~ rjf: Hover Eval internal void -rd_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string, String8 view_rules) +rd_set_hover_eval(Vec2F32 pos, String8 string, String8 view_rules) { RD_Cfg *window_cfg = rd_cfg_from_id(rd_regs()->window); RD_WindowState *ws = rd_window_state_from_cfg(window_cfg); - if(ws->hover_eval_last_frame_idx+1 < rd_state->frame_index && + if(ws->hover_eval_lastt_us < rd_state->time_in_us && ui_key_match(ui_active_key(UI_MouseButtonKind_Left), ui_key_zero()) && ui_key_match(ui_active_key(UI_MouseButtonKind_Middle), ui_key_zero()) && ui_key_match(ui_active_key(UI_MouseButtonKind_Right), ui_key_zero())) @@ -10836,14 +10816,14 @@ rd_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 s !str8_match(ws->hover_eval_view_rules, view_rules, 0)); if(is_new_string) { - ws->hover_eval_first_frame_idx = ws->hover_eval_last_frame_idx = rd_state->frame_index; + ws->hover_eval_firstt_us = ws->hover_eval_lastt_us = rd_state->time_in_us; arena_clear(ws->hover_eval_arena); ws->hover_eval_string = push_str8_copy(ws->hover_eval_arena, string); ws->hover_eval_view_rules = push_str8_copy(ws->hover_eval_arena, view_rules); ws->hover_eval_focused = 0; } ws->hover_eval_spawn_pos = pos; - ws->hover_eval_last_frame_idx = rd_state->frame_index; + ws->hover_eval_lastt_us = rd_state->time_in_us; } } @@ -17712,6 +17692,7 @@ Z(getting_started) // rd_state->frame_index += 1; rd_state->time_in_seconds += rd_state->frame_dt; + rd_state->time_in_us += frame_time_us; ////////////////////////////// //- rjf: bump command batch ring buffer generation diff --git a/src/raddbg/raddbg_core.h b/src/raddbg/raddbg_core.h index 0d25ce8c..aad81239 100644 --- a/src/raddbg/raddbg_core.h +++ b/src/raddbg/raddbg_core.h @@ -571,8 +571,8 @@ struct RD_WindowState Vec2F32 hover_eval_spawn_pos; String8 hover_eval_string; String8 hover_eval_view_rules; - U64 hover_eval_first_frame_idx; - U64 hover_eval_last_frame_idx; + U64 hover_eval_firstt_us; + U64 hover_eval_lastt_us; // rjf: error state U8 error_buffer[512]; @@ -708,6 +708,7 @@ struct RD_State U64 frame_time_us_history[64]; U64 num_frames_requested; F64 time_in_seconds; + U64 time_in_us; // rjf: frame parameters F32 frame_dt; @@ -1084,7 +1085,7 @@ internal String8 rd_value_string_from_eval(Arena *arena, String8 filter, EV_Stri //////////////////////////////// //~ rjf: Hover Eval -internal void rd_set_hover_eval(Vec2F32 pos, String8 file_path, TxtPt pt, U64 vaddr, String8 string, String8 view_rules); +internal void rd_set_hover_eval(Vec2F32 pos, String8 string, String8 view_rules); //////////////////////////////// //~ rjf: Lister Functions diff --git a/src/raddbg/raddbg_widgets.c b/src/raddbg/raddbg_widgets.c index b39dbc6f..347e15b3 100644 --- a/src/raddbg/raddbg_widgets.c +++ b/src/raddbg/raddbg_widgets.c @@ -1388,7 +1388,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe // rjf: interactions if(ui_hovering(thread_sig) && !rd_drag_is_active()) { - rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero()); + rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero()); RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity); } if(ui_right_clicked(thread_sig)) @@ -1540,7 +1540,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe // rjf: interactions if(ui_hovering(thread_sig) && !rd_drag_is_active()) { - rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero()); + rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero()); RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity); } if(ui_right_clicked(thread_sig)) @@ -1619,7 +1619,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe // rjf: bp hovering if(ui_hovering(bp_sig) && !rd_drag_is_active()) { - rd_set_hover_eval(v2f32(bp_box->rect.x0, bp_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, push_str8f(scratch.arena, "$%I64u", bp->id), str8_zero()); + rd_set_hover_eval(v2f32(bp_box->rect.x0, bp_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64u", bp->id), str8_zero()); RD_RegsScope(.cfg = bp->id) rd_set_hover_regs(RD_RegSlot_Cfg); } @@ -1681,7 +1681,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe // rjf: watch hovering if(ui_hovering(pin_sig) && !rd_drag_is_active()) { - rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(0, 0), 0, push_str8f(scratch.arena, "$%I64u", pin->id), str8_zero()); + rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64u", pin->id), str8_zero()); RD_RegsScope(.cfg = pin->id) rd_set_hover_regs(RD_RegSlot_Cfg); } @@ -1939,7 +1939,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe UI_Signal pin_sig = ui_signal_from_box(pin_box); if(ui_key_match(pin_box_key, ui_hot_key())) { - rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), str8_zero(), txt_pt(1, 1), 0, pin_expr, pin_view_rule); + rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), pin_expr, pin_view_rule); } } } @@ -2262,7 +2262,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe U64 line_idx = mouse_pt.line-params->line_num_range.min; line_vaddr = params->line_vaddrs[line_idx]; } - rd_set_hover_eval(mouse_expr_baseline_pos, rd_regs()->file_path, mouse_pt, line_vaddr, mouse_expr, str8_zero()); + rd_set_hover_eval(mouse_expr_baseline_pos, mouse_expr, str8_zero()); } }