Skip to content

Commit c5de847

Browse files
committed
ctrl entity rich hovering
1 parent 35ba41f commit c5de847

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

src/raddbg/generated/raddbg.meta.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//- GENERATED CODE
55

66
C_LINKAGE_BEGIN
7-
RD_VocabInfo rd_vocab_info_table[277] =
7+
RD_VocabInfo rd_vocab_info_table[282] =
88
{
99
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
1010
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -17,6 +17,11 @@ RD_VocabInfo rd_vocab_info_table[277] =
1717
{str8_lit_comp("target"), str8_lit_comp("targets"), str8_lit_comp("Target"), str8_lit_comp("Targets"), RD_IconKind_Target},
1818
{str8_lit_comp("executable"), str8_lit_comp("executables"), str8_lit_comp("Executable"), str8_lit_comp("Executables"), RD_IconKind_Module},
1919
{str8_lit_comp("arguments"), str8_lit_comp("arguments"), str8_lit_comp("Arguments"), str8_lit_comp("Arguments"), RD_IconKind_Null},
20+
{str8_lit_comp("exe"), str8_lit_comp("exes"), str8_lit_comp("Executable"), str8_lit_comp("Executables"), RD_IconKind_Module},
21+
{str8_lit_comp("dbg"), str8_lit_comp("dbgs"), str8_lit_comp("Debug Info Path"), str8_lit_comp("Debug Info Paths"), RD_IconKind_Module},
22+
{str8_lit_comp("vaddr_range"), str8_lit_comp("vaddr_ranges"), str8_lit_comp("Virtual Address Range"), str8_lit_comp("Virtual Address Ranges"), RD_IconKind_Null},
23+
{str8_lit_comp("min"), str8_lit_comp("mins"), str8_lit_comp("Minimum"), str8_lit_comp("Minimums"), RD_IconKind_Null},
24+
{str8_lit_comp("max"), str8_lit_comp("maxs"), str8_lit_comp("Maximum"), str8_lit_comp("Maximums"), RD_IconKind_Null},
2025
{str8_lit_comp("working_directory"), str8_lit_comp("working_directories"), str8_lit_comp("Working Directory"), str8_lit_comp("Working Directories"), RD_IconKind_FolderClosedFilled},
2126
{str8_lit_comp("entry_point"), str8_lit_comp("entry_points"), str8_lit_comp("Entry Point"), str8_lit_comp("Entry Points"), RD_IconKind_Null},
2227
{str8_lit_comp("stdout_path"), str8_lit_comp("stdout_paths"), str8_lit_comp("Standard Output Path"), str8_lit_comp("Standard Output Paths"), RD_IconKind_Null},

src/raddbg/generated/raddbg.meta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ RD_Query query;
554554
.os_event = rd_regs()->os_event,\
555555

556556
C_LINKAGE_BEGIN
557-
extern RD_VocabInfo rd_vocab_info_table[277];
557+
extern RD_VocabInfo rd_vocab_info_table[282];
558558
extern RD_NameSchemaInfo rd_name_schema_info_table[10];
559559
extern Rng1U64 rd_reg_slot_range_table[38];
560560
extern String8 rd_binding_version_remap_old_name_table[8];

src/raddbg/raddbg.mdesk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ RD_VocabTable:
2929
{target _ "Target" _ Target }
3030
{executable _ "Executable" _ Module }
3131
{arguments arguments "Arguments" "Arguments" Null }
32+
{exe exes "Executable" _ Module }
33+
{dbg dbgs "Debug Info Path" _ Module }
34+
{vaddr_range _ "Virtual Address Range" _ Null }
35+
{min _ "Minimum" _ Null }
36+
{max _ "Maximum" _ Null }
3237
{working_directory working_directories "Working Directory" "Working Directories" FolderClosedFilled }
3338
{entry_point _ "Entry Point" _ Null }
3439
{stdout_path _ "Standard Output Path" _ Null }

src/raddbg/raddbg_views.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,10 +2767,31 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
27672767
{
27682768
rgba = rd_rgba_from_theme_color(RD_ThemeColor_HighlightOverlay);
27692769
}
2770+
else
2771+
{
2772+
rgba.w *= 0.2f;
2773+
}
27702774
rgba.w *= ui_anim(ui_key_from_stringf(ui_key_zero(), "###cfg_hover_t_%p", cfg), 1.f, .rate = entity_hover_t_rate);
27712775
palette = ui_build_palette(ui_top_palette(), .overlay = rgba);
27722776
cell_flags |= UI_BoxFlag_DrawOverlay;
27732777
}
2778+
else if(ctrl_handle_match(cell_info.entity->handle, rd_get_hover_regs()->ctrl_entity) &&
2779+
rd_state->hover_regs_slot == RD_RegSlot_CtrlEntity)
2780+
{
2781+
CTRL_Entity *entity = cell_info.entity;
2782+
Vec4F32 rgba = rd_rgba_from_ctrl_entity(entity);
2783+
if(rgba.w == 0)
2784+
{
2785+
rgba = rd_rgba_from_theme_color(RD_ThemeColor_HighlightOverlay);
2786+
}
2787+
else
2788+
{
2789+
rgba.w *= 0.2f;
2790+
}
2791+
rgba.w *= ui_anim(ui_key_from_stringf(ui_key_zero(), "###entity_hover_t_%p", entity), 1.f, .rate = entity_hover_t_rate);
2792+
palette = ui_build_palette(ui_top_palette(), .overlay = rgba);
2793+
cell_flags |= UI_BoxFlag_DrawOverlay;
2794+
}
27742795
}
27752796
ProfEnd();
27762797

@@ -2910,6 +2931,12 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
29102931
RD_RegsScope(.cfg = cell_info.cfg->id) rd_set_hover_regs(RD_RegSlot_Cfg);
29112932
}
29122933

2934+
// rjf: hover -> rich hover entities
2935+
if(ui_hovering(sig) && cell_info.entity != &ctrl_entity_nil)
2936+
{
2937+
RD_RegsScope(.ctrl_entity = cell_info.entity->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
2938+
}
2939+
29132940
// rjf: dragging -> drag/drop
29142941
if(ui_dragging(sig) && !contains_2f32(sig.box->rect, ui_mouse()))
29152942
{

src/raddbg/raddbg_widgets.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,8 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
751751
// rjf: custom draw
752752
{
753753
RD_Regs *hover_regs = rd_get_hover_regs();
754-
B32 is_hovering = (ctrl_handle_match(hover_regs->thread, thread->handle) &&
755-
rd_state->hover_regs_slot == RD_RegSlot_Thread);
754+
B32 is_hovering = (ctrl_handle_match(hover_regs->ctrl_entity, thread->handle) &&
755+
rd_state->hover_regs_slot == RD_RegSlot_CtrlEntity);
756756
RD_ThreadBoxDrawExtData *u = push_array(ui_build_arena(), RD_ThreadBoxDrawExtData, 1);
757757
u->thread_color = color;
758758
u->alive_t = ui_anim(ui_key_from_stringf(top_container_box->key, "###entity_alive_t_%p", thread), 1.f, .rate = entity_alive_t_rate);
@@ -899,8 +899,8 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
899899
// rjf: custom draw
900900
{
901901
RD_Regs *hover_regs = rd_get_hover_regs();
902-
B32 is_hovering = (ctrl_handle_match(hover_regs->thread, thread->handle) &&
903-
rd_state->hover_regs_slot == RD_RegSlot_Thread);
902+
B32 is_hovering = (ctrl_handle_match(hover_regs->ctrl_entity, thread->handle) &&
903+
rd_state->hover_regs_slot == RD_RegSlot_CtrlEntity);
904904
RD_ThreadBoxDrawExtData *u = push_array(ui_build_arena(), RD_ThreadBoxDrawExtData, 1);
905905
u->thread_color = color;
906906
u->alive_t = ui_anim(ui_key_from_stringf(top_container_box->key, "###entity_alive_t_%p", thread), 1.f, .rate = entity_alive_t_rate);
@@ -938,7 +938,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
938938
// rjf: interactions
939939
if(ui_hovering(thread_sig) && !rd_drag_is_active())
940940
{
941-
RD_RegsScope(.thread = thread->handle) rd_set_hover_regs(RD_RegSlot_Thread);
941+
RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
942942
}
943943
if(ui_right_clicked(thread_sig))
944944
{

0 commit comments

Comments
 (0)