mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-03 20:38:40 +00:00
begin working on watch window stylization for file system evaluations
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
//- GENERATED CODE
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
RD_VocabInfo rd_vocab_info_table[285] =
|
||||
RD_VocabInfo rd_vocab_info_table[288] =
|
||||
{
|
||||
{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},
|
||||
{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},
|
||||
@@ -79,6 +79,9 @@ RD_VocabInfo rd_vocab_info_table[285] =
|
||||
{str8_lit_comp("environment"), str8_lit_comp("environments"), str8_lit_comp("Environment"), str8_lit_comp("Environments"), RD_IconKind_Null},
|
||||
{str8_lit_comp("frozen"), str8_lit_comp(""), str8_lit_comp("Frozen"), str8_lit_comp(""), RD_IconKind_Null},
|
||||
{str8_lit_comp("id"), str8_lit_comp("ids"), str8_lit_comp("ID"), str8_lit_comp("IDs"), RD_IconKind_Null},
|
||||
{str8_lit_comp("last_modified_time"), str8_lit_comp("last_modified_times"), str8_lit_comp("Last Modified Time"), str8_lit_comp("Last Modified Times"), RD_IconKind_Null},
|
||||
{str8_lit_comp("creation_time"), str8_lit_comp("creation_times"), str8_lit_comp("Creation Time"), str8_lit_comp("Creation Times"), RD_IconKind_Null},
|
||||
{str8_lit_comp("data"), str8_lit_comp("datas"), str8_lit_comp("Data"), str8_lit_comp("Datas"), RD_IconKind_Null},
|
||||
{str8_lit_comp("launch_and_run"), str8_lit_comp(""), str8_lit_comp("Launch and Run"), str8_lit_comp(""), RD_IconKind_Play},
|
||||
{str8_lit_comp("launch_and_init"), str8_lit_comp(""), str8_lit_comp("Launch and Initialize"), str8_lit_comp(""), RD_IconKind_PlayStepForward},
|
||||
{str8_lit_comp("kill"), str8_lit_comp(""), str8_lit_comp("Kill"), str8_lit_comp(""), RD_IconKind_X},
|
||||
|
||||
@@ -555,7 +555,7 @@ RD_Query query;
|
||||
.os_event = rd_regs()->os_event,\
|
||||
|
||||
C_LINKAGE_BEGIN
|
||||
extern RD_VocabInfo rd_vocab_info_table[285];
|
||||
extern RD_VocabInfo rd_vocab_info_table[288];
|
||||
extern RD_NameSchemaInfo rd_name_schema_info_table[10];
|
||||
extern Rng1U64 rd_reg_slot_range_table[38];
|
||||
extern String8 rd_binding_version_remap_old_name_table[8];
|
||||
|
||||
@@ -91,6 +91,9 @@ RD_VocabTable:
|
||||
{environment _ "Environment" _ Null }
|
||||
{frozen "" "Frozen" "" Null }
|
||||
{id _ "ID" _ Null }
|
||||
{last_modified_time _ "Last Modified Time" _ Null }
|
||||
{creation_time _ "Creation Time" _ Null }
|
||||
{data _ "Data" _ Null }
|
||||
}
|
||||
|
||||
@struct RD_VocabInfo:
|
||||
|
||||
@@ -3032,19 +3032,31 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
|
||||
//- rjf: file reads
|
||||
case E_SpaceKind_File:
|
||||
{
|
||||
// rjf: unpack space/path
|
||||
U64 file_path_string_id = space.u64_0;
|
||||
String8 file_path = e_string_from_id(file_path_string_id);
|
||||
U128 key = fs_key_from_path_range(file_path, range);
|
||||
|
||||
// rjf: find containing chunk range
|
||||
U64 chunk_size = KB(4);
|
||||
Rng1U64 containing_range = range;
|
||||
containing_range.min -= containing_range.min%chunk_size;
|
||||
containing_range.max += chunk_size-1;
|
||||
containing_range.max -= containing_range.max%chunk_size;
|
||||
|
||||
// rjf: map to hash
|
||||
U128 key = fs_key_from_path_range(file_path, containing_range);
|
||||
U128 hash = hs_hash_from_key(key, 0);
|
||||
|
||||
// rjf: look up from hash store
|
||||
HS_Scope *scope = hs_scope_open();
|
||||
{
|
||||
String8 data = hs_data_from_hash(scope, hash);
|
||||
Rng1U64 legal_range = r1u64(0, data.size);
|
||||
Rng1U64 legal_range = r1u64(containing_range.min, containing_range.min + data.size);
|
||||
Rng1U64 read_range = intersect_1u64(range, legal_range);
|
||||
if(read_range.min < read_range.max)
|
||||
{
|
||||
result = 1;
|
||||
MemoryCopy(out, data.str + read_range.min, dim_1u64(read_range));
|
||||
MemoryCopy(out, data.str + read_range.min - containing_range.min, dim_1u64(read_range));
|
||||
}
|
||||
}
|
||||
hs_scope_close(scope);
|
||||
@@ -8636,7 +8648,7 @@ rd_window_frame(void)
|
||||
{
|
||||
// rjf: brighten
|
||||
{
|
||||
R_Rect2DInst *inst = dr_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
R_Rect2DInst *inst = dr_rect(pad_2f32(box->rect, 1.f), v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Hover);
|
||||
color.w *= t*0.2f;
|
||||
inst->colors[Corner_00] = color;
|
||||
|
||||
@@ -1101,6 +1101,42 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr, .flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_ActivateWithSingleClick, .pct = 1.f, .fstrs = rd_title_fstrs_from_code_name(arena, cmd_kind_info->string, ui_top_palette()->text_weak, ui_top_font_size()));
|
||||
}
|
||||
|
||||
// rjf: singular button for folders & files
|
||||
else if(info.eval.space.kind == E_SpaceKind_FileSystem)
|
||||
{
|
||||
DR_FStrParams params = {rd_font_from_slot(RD_FontSlot_Main), rd_raster_flags_from_slot(RD_FontSlot_Main), ui_top_palette()->text, ui_top_font_size()};
|
||||
E_Type *type = e_type_from_key__cached(info.eval.type_key);
|
||||
String8 file_path = e_string_from_id(info.eval.value.u64);
|
||||
String8 file_name = str8_skip_last_slash(file_path);
|
||||
if(str8_match(type->name, str8_lit("folder"), 0))
|
||||
{
|
||||
DR_FStrList fstrs = {0};
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, file_name);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr,
|
||||
.flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_IsNonCode,
|
||||
.pct = 1.f,
|
||||
.fstrs = fstrs);
|
||||
}
|
||||
else
|
||||
{
|
||||
info.cell_style_key = str8_lit("expr_and_eval");
|
||||
RD_Cfg *view = rd_cfg_from_id(rd_regs()->view);
|
||||
RD_Cfg *style = rd_cfg_child_from_string(view, info.cell_style_key);
|
||||
RD_Cfg *w_cfg = style->first;
|
||||
F32 next_pct = 0;
|
||||
#define take_pct() (next_pct = (F32)f64_from_str8(w_cfg->string), w_cfg = w_cfg->next, next_pct)
|
||||
DR_FStrList fstrs = {0};
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, file_name);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Expr,
|
||||
.flags = RD_WatchCellFlag_Button|RD_WatchCellFlag_IsNonCode,
|
||||
.default_pct = 0.35f,
|
||||
.pct = take_pct(),
|
||||
.fstrs = fstrs);
|
||||
rd_watch_cell_list_push_new(arena, &info.cells, RD_WatchCellKind_Eval, .default_pct = 0.65f, .pct = take_pct());
|
||||
#undef take_pct
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: singular cell for view ui
|
||||
else if(info.view_ui_rule != &rd_nil_view_ui_rule)
|
||||
{
|
||||
@@ -1243,7 +1279,9 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
||||
B32 is_non_code = 0;
|
||||
String8 string = push_str8f(arena, ".%S", member_name);
|
||||
if(row_eval.space.kind == RD_EvalSpaceKind_MetaCfg ||
|
||||
row_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity)
|
||||
row_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity ||
|
||||
row_eval.space.kind == E_SpaceKind_File ||
|
||||
row_eval.space.kind == E_SpaceKind_FileSystem)
|
||||
{
|
||||
String8 fancy_name = rd_display_from_code_name(member_name);
|
||||
if(fancy_name.size != 0)
|
||||
|
||||
Reference in New Issue
Block a user