diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index d22aceca..001433e1 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -3658,9 +3658,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_view(ws, view); String8 display_name = df_display_string_from_view(scratch.arena, ctrl_ctx, view); DF_IconKind icon_kind = df_icon_kind_from_view(view); - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(2.5f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -3688,9 +3687,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 display_name = df_display_string_from_entity(scratch.arena, entity); DF_IconKind icon_kind = df_g_entity_kind_icon_kind_table[entity->kind]; - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon_kind]); ui_label(display_name); @@ -3703,7 +3701,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //////////////////////////// //- rjf: developer menu // - if(ws->dev_menu_is_open) UI_Font(df_font_from_slot(DF_FontSlot_Code)) + if(ws->dev_menu_is_open) DF_Font(ws, DF_FontSlot_Code) { ui_set_next_flags(UI_BoxFlag_ViewScrollY|UI_BoxFlag_AllowOverflowY|UI_BoxFlag_ViewClamp); UI_PaneF(r2f32p(30, 30, 30+ui_top_font_size()*100, ui_top_font_size()*150), "###dev_ctx_menu") @@ -3711,7 +3709,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: toggles for(U64 idx = 0; idx < ArrayCount(DEV_toggle_table); idx += 1) { - if(ui_clicked(df_icon_button(*DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) + if(ui_clicked(df_icon_button(ws, *DEV_toggle_table[idx].value_ptr ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, DEV_toggle_table[idx].name))) { *DEV_toggle_table[idx].value_ptr ^= 1; } @@ -3843,7 +3841,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CtrlCtx ctrl_ctx = df_ctrl_ctx_from_window(ws); TxtRng range = ws->code_ctx_menu_range; DF_LineList lines = ws->code_ctx_menu_lines; - if(!txt_pt_match(range.min, range.max) && ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Copy)))) + if(!txt_pt_match(range.min, range.max) && ui_clicked(df_cmd_spec_button(ws, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Copy)))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3852,7 +3850,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) os_set_clipboard_text(copy_data); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "Set Next Statement"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_RightArrow, 0, "Set Next Statement"))) { DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); U64 new_rip_vaddr = ws->code_ctx_menu_vaddr; @@ -3875,7 +3873,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_SetThreadIP)); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Run To Line"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Run To Line"))) { if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file))) { @@ -3892,7 +3890,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Null, 0, "Go To Name"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Null, 0, "Go To Name"))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3912,7 +3910,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_GoToName)); ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_CircleFilled, 0, "Toggle Breakpoint"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CircleFilled, 0, "Toggle Breakpoint"))) { if(ws->code_ctx_menu_vaddr != 0) { @@ -3929,7 +3927,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } ui_ctx_menu_close(); } - if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_Binoculars, 0, "Toggle Watch Expression"))) + if(range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Binoculars, 0, "Toggle Watch Expression"))) { U128 hash = {0}; TXT_TextInfo info = txt_text_info_from_key_lang(txt_scope, ws->code_ctx_menu_text_key, ws->code_ctx_menu_lang_kind, &hash); @@ -3949,7 +3947,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ToggleWatchExpression)); ui_ctx_menu_close(); } - if(df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Source"))) + if(df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Source"))) { if(lines.first != 0) { @@ -3962,7 +3960,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } ui_ctx_menu_close(); } - if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Disassembly"))) + if(!df_entity_is_nil(df_entity_from_handle(ws->code_ctx_menu_file)) && range.min.line == range.max.line && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Disassembly"))) { DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); U64 vaddr = 0; @@ -4003,9 +4001,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Row { ui_spacer(ui_em(1.f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) @@ -4022,7 +4019,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } UI_Palette(palette) UI_PrefWidth(ui_text_dim(10, 1)) - UI_Font((kind_flags & DF_EntityKindFlag_NameIsCode) ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) + DF_Font(ws, (kind_flags & DF_EntityKindFlag_NameIsCode) ? DF_FontSlot_Code : DF_FontSlot_Main) ui_label(display_name); } } @@ -4032,7 +4029,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: name editor if(op_flags & DF_EntityOpFlag_Rename) UI_TextPadding(ui_top_font_size()*1.5f) { - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, entity->name, "%S###entity_name_edit_%p", df_g_entity_kind_name_label_table[entity->kind], entity); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, entity->name, "%S###entity_name_edit_%p", df_g_entity_kind_name_label_table[entity->kind], entity); if(ui_committed(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4045,10 +4042,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: condition editor - if(op_flags & DF_EntityOpFlag_Condition) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_TextPadding(ui_top_font_size()*1.5f) + if(op_flags & DF_EntityOpFlag_Condition) + DF_Font(ws, DF_FontSlot_Code) + UI_TextPadding(ui_top_font_size()*1.5f) { DF_Entity *condition = df_entity_child_from_kind(entity, DF_EntityKind_Condition); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, condition->name, "Condition###entity_cond_edit_%p", entity); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border|DF_LineEditFlag_CodeContents, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, condition->name, "Condition###entity_cond_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4077,7 +4076,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->kind == DF_EntityKind_Target) UI_TextPadding(ui_top_font_size()*1.5f) { DF_Entity *exe = df_entity_child_from_kind(entity, DF_EntityKind_Executable); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, exe->name, "Executable###entity_exe_edit_%p", entity); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, exe->name, "Executable###entity_exe_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4106,7 +4105,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->kind == DF_EntityKind_Target) UI_TextPadding(ui_top_font_size()*1.5f) { DF_Entity *args = df_entity_child_from_kind(entity, DF_EntityKind_Arguments); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, args->name, "Arguments###entity_args_edit_%p", entity); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &ws->entity_ctx_menu_input_cursor, &ws->entity_ctx_menu_input_mark, ws->entity_ctx_menu_input_buffer, sizeof(ws->entity_ctx_menu_input_buffer), &ws->entity_ctx_menu_input_size, 0, args->name, "Arguments###entity_args_edit_%p", entity); if(ui_committed(sig)) { String8 new_string = str8(ws->entity_ctx_menu_input_buffer, ws->entity_ctx_menu_input_size); @@ -4132,20 +4131,20 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: copy name - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Name"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Name"))) { os_set_clipboard_text(display_name); ui_ctx_menu_close(); } // rjf: is command line only? -> make permanent - if(entity->cfg_src == DF_CfgSrc_CommandLine && ui_clicked(df_icon_buttonf(DF_IconKind_Save, 0, "Save To Project"))) + if(entity->cfg_src == DF_CfgSrc_CommandLine && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Save, 0, "Save To Project"))) { df_entity_equip_cfg_src(entity, DF_CfgSrc_Project); } // rjf: duplicate - if(op_flags & DF_EntityOpFlag_Duplicate && ui_clicked(df_icon_buttonf(DF_IconKind_XSplit, 0, "Duplicate"))) + if(op_flags & DF_EntityOpFlag_Duplicate && ui_clicked(df_icon_buttonf(ws, DF_IconKind_XSplit, 0, "Duplicate"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4155,7 +4154,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: edit - if(op_flags & DF_EntityOpFlag_Edit && ui_clicked(df_icon_buttonf(DF_IconKind_Pencil, 0, "Edit"))) + if(op_flags & DF_EntityOpFlag_Edit && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Pencil, 0, "Edit"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4165,7 +4164,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: deletion - if(op_flags & DF_EntityOpFlag_Delete && ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "Delete"))) + if(op_flags & DF_EntityOpFlag_Delete && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "Delete"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4178,14 +4177,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(op_flags & DF_EntityOpFlag_Enable) { B32 is_enabled = entity->b32; - if(!is_enabled && ui_clicked(df_icon_buttonf(DF_IconKind_CheckHollow, 0, "Enable###enabler"))) + if(!is_enabled && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CheckHollow, 0, "Enable###enabler"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_EnableEntity)); } - if(is_enabled && ui_clicked(df_icon_buttonf(DF_IconKind_CheckFilled, 0, "Disable###enabler"))) + if(is_enabled && ui_clicked(df_icon_buttonf(ws, DF_IconKind_CheckFilled, 0, "Disable###enabler"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4199,14 +4198,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { B32 is_frozen = df_entity_is_frozen(entity); ui_set_next_palette(df_palette_from_code(ws, is_frozen ? DF_PaletteCode_NegativePopButton : DF_PaletteCode_PositivePopButton)); - if(is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) + if(is_frozen && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Locked, 0, "Thaw###freeze_thaw"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); df_cmd_params_mark_slot(¶ms, DF_CmdParamSlot_Entity); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ThawEntity)); } - if(!is_frozen && ui_clicked(df_icon_buttonf(DF_IconKind_Unlocked, 0, "Freeze###freeze_thaw"))) + if(!is_frozen && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Unlocked, 0, "Freeze###freeze_thaw"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4219,7 +4218,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->flags & DF_EntityFlag_HasTextPoint) { DF_Entity *file_ancestor = df_entity_ancestor_from_kind(entity, DF_EntityKind_File); - if(!df_entity_is_nil(file_ancestor) && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Location"))) + if(!df_entity_is_nil(file_ancestor) && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Location"))) { Temp scratch = scratch_begin(&arena, 1); DF_CmdParams params = df_cmd_params_from_window(ws); @@ -4238,7 +4237,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { DF_CtrlCtx ctrl_ctx = df_ctrl_ctx(); DF_Entity *thread = df_entity_from_handle(ctrl_ctx.thread); - if(entity->vaddr != 0 && !df_entity_is_nil(thread) && ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To Location"))) + if(entity->vaddr != 0 && !df_entity_is_nil(thread) && ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To Location"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(df_entity_ancestor_from_kind(thread, DF_EntityKind_Process)); @@ -4260,7 +4259,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) case DF_EntityKind_File: { if(entity->flags & DF_EntityFlag_IsFolder && - ui_clicked(df_icon_buttonf(DF_IconKind_FolderOpenOutline, 0, "Open File In Folder"))) + ui_clicked(df_icon_buttonf(ws, DF_IconKind_FolderOpenOutline, 0, "Open File In Folder"))) { String8 path = df_full_path_from_entity(scratch.arena, entity); String8 path_w_slash = push_str8f(scratch.arena, "%S/", path); @@ -4280,7 +4279,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } if(!(entity->flags & DF_EntityFlag_IsFolder) && !(entity->flags & DF_EntityFlag_IsMissing) && - ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Go To File"))) + ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Go To File"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.file_path = df_full_path_from_entity(scratch.arena, entity); @@ -4301,9 +4300,9 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) B32 is_selected = df_handle_match(ctrl_ctx.thread, df_handle_from_entity(entity)); if(is_selected) { - df_icon_buttonf(DF_IconKind_Thread, 0, "[Selected]###select_entity"); + df_icon_buttonf(ws, DF_IconKind_Thread, 0, "[Selected]###select_entity"); } - else if(ui_clicked(df_icon_buttonf(DF_IconKind_Thread, 0, "Select###select_entity"))) + else if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Thread, 0, "Select###select_entity"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4313,7 +4312,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy ID"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy ID"))) { U32 ctrl_id = entity->ctrl_id; String8 string = push_str8f(scratch.arena, "%i", (int)ctrl_id); @@ -4323,7 +4322,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->kind == DF_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Instruction Pointer Address"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Instruction Pointer Address"))) { U64 rip = df_query_cached_rip_from_thread(entity); String8 string = push_str8f(scratch.arena, "0x%I64x", rip); @@ -4334,7 +4333,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->kind == DF_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Call Stack"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Call Stack"))) { DI_Scope *di_scope = di_scope_open(); DF_Entity *process = df_entity_ancestor_from_kind(entity, DF_EntityKind_Process); @@ -4380,7 +4379,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(entity->kind == DF_EntityKind_Thread) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_FileOutline, 0, "Find"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_FileOutline, 0, "Find"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4393,7 +4392,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) case DF_EntityKind_Module: { - UI_Signal copy_full_path_sig = df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Full Path"); + UI_Signal copy_full_path_sig = df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Full Path"); if(ui_clicked(copy_full_path_sig)) { String8 string = entity->name; @@ -4405,14 +4404,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) String8 string = entity->name; ui_label(string); } - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Base Address"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Base Address"))) { Rng1U64 vaddr_rng = entity->vaddr_rng; String8 string = push_str8f(scratch.arena, "0x%I64x", vaddr_rng.min); os_set_clipboard_text(string); ui_ctx_menu_close(); } - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Address Range Size"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Address Range Size"))) { Rng1U64 vaddr_rng = entity->vaddr_rng; String8 string = push_str8f(scratch.arena, "0x%I64x", dim_1u64(vaddr_rng)); @@ -4423,7 +4422,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) case DF_EntityKind_Target: { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch And Run"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Launch And Run"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4431,7 +4430,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_LaunchAndRun)); ui_ctx_menu_close(); } - if(ui_clicked(df_icon_buttonf(DF_IconKind_PlayStepForward, 0, "Launch And Initialize"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_PlayStepForward, 0, "Launch And Initialize"))) { DF_CmdParams params = df_cmd_params_from_window(ws); params.entity = df_handle_from_entity(entity); @@ -4505,7 +4504,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Row UI_Padding(ui_pct(1, 0)) UI_PrefWidth(ui_em(16.f, 1.f)) UI_CornerRadius(8.f) UI_TextAlignment(UI_TextAlign_Center) DF_Palette(ws, DF_PaletteCode_Floating) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "Remove Color###color_toggle"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "Remove Color###color_toggle"))) { entity->flags &= ~DF_EntityFlag_HasColor; } @@ -4513,7 +4512,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_spacer(ui_em(1.5f, 1.f)); } - if(!entity_has_color && ui_clicked(df_icon_buttonf(DF_IconKind_Palette, 0, "Apply Color###color_toggle"))) + if(!entity_has_color && ui_clicked(df_icon_buttonf(ws, DF_IconKind_Palette, 0, "Apply Color###color_toggle"))) { df_entity_equip_color_rgba(entity, v4f32(1, 1, 1, 1)); } @@ -4545,9 +4544,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Row { ui_spacer(ui_em(1.f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) @@ -4559,7 +4557,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_Palette(ws, DF_PaletteCode_Floating) ui_divider(ui_em(1.f, 1.f)); // rjf: copy name - if(ui_clicked(df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Name"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Name"))) { os_set_clipboard_text(display_name); ui_ctx_menu_close(); @@ -4568,7 +4566,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: copy full path if(entity->kind == DF_EntityKind_File) { - UI_Signal copy_full_path_sig = df_icon_buttonf(DF_IconKind_Clipboard, 0, "Copy Full Path"); + UI_Signal copy_full_path_sig = df_icon_buttonf(ws, DF_IconKind_Clipboard, 0, "Copy Full Path"); String8 full_path = df_full_path_from_entity(scratch.arena, entity); if(ui_clicked(copy_full_path_sig)) { @@ -4584,7 +4582,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: show in explorer if(entity->kind == DF_EntityKind_File) { - UI_Signal sig = df_icon_buttonf(DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); + UI_Signal sig = df_icon_buttonf(ws, DF_IconKind_FolderClosedFilled, 0, "Show In Explorer"); if(ui_clicked(sig)) { String8 full_path = df_full_path_from_entity(scratch.arena, entity); @@ -4596,7 +4594,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: filter controls if(view->spec->info.flags & DF_ViewSpecFlag_CanFilter) { - if(ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter)))) + if(ui_clicked(df_cmd_spec_button(ws, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter)))) { DF_CmdParams params = df_cmd_params_from_window(ws); { @@ -4606,7 +4604,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_Filter)); ui_ctx_menu_close(); } - if(ui_clicked(df_cmd_spec_button(df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ClearFilter)))) + if(ui_clicked(df_cmd_spec_button(ws, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ClearFilter)))) { DF_CmdParams params = df_cmd_params_from_window(ws); { @@ -4619,7 +4617,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } // rjf: close tab - if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Tab"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "Close Tab"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_CloseTab)); @@ -4661,7 +4659,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_ctx_menu_close(); UI_WidthFill UI_PrefHeight(ui_children_sum(1.f)) UI_Column UI_Padding(ui_pct(1, 0)) { - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_gfx_state->confirm_title); + UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Main)) UI_FontSize(ui_top_font_size()*2.f) UI_PrefHeight(ui_em(3.f, 1.f)) ui_label(df_gfx_state->confirm_title); UI_PrefHeight(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_gfx_state->confirm_msg); ui_spacer(ui_em(1.5f, 1.f)); UI_Row UI_Padding(ui_pct(1.f, 0.f)) UI_WidthFill UI_PrefHeight(ui_em(5.f, 1.f)) @@ -4942,7 +4940,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Parent(autocomp_box) UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) UI_HoverCursor(OS_Cursor_HandPoint) UI_Focus(UI_FocusKind_Null) DF_Palette(ws, DF_PaletteCode_ImplicitButton) @@ -4959,7 +4957,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_Box *box = ui_label(item->string).box; ui_box_equip_fuzzy_match_ranges(box, &item->matches); } - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(item->kind_string); @@ -5217,7 +5215,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } String8 target_name = df_display_string_from_entity(scratch.arena, target); UI_Signal sig = {0}; - UI_Palette(palette) sig = df_icon_buttonf(DF_IconKind_Target, 0, "%S##%p", target_name, target); + UI_Palette(palette) sig = df_icon_buttonf(ws, DF_IconKind_Target, 0, "%S##%p", target_name, target); if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -5293,7 +5291,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_CmdSpec *spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand); UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) - df_cmd_binding_buttons(spec); + df_cmd_binding_buttons(ws, spec); } ui_spacer(ui_em(0.25f, 1.f)); UI_Row UI_TextAlignment(UI_TextAlign_Center) ui_label(str8_lit("Submit issues to the GitHub at:")); @@ -5447,9 +5445,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) //- rjf: center column UI_PrefWidth(ui_children_sum(1.f)) UI_Row UI_PrefWidth(ui_em(2.25f, 1)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(ui_top_font_size()*0.85f) - UI_TextRasterFlags(F_RasterFlag_Smooth) { Temp scratch = scratch_begin(&arena, 1); DF_EntityList targets = df_push_active_target_list(scratch.arena); @@ -5472,14 +5469,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_play) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist"); } if(ui_hovering(sig) && can_play) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) { if(can_stop) @@ -5513,7 +5510,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig)) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) { ui_labelf("Restart all running targets:"); @@ -5548,14 +5545,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_pause) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: Already halted"); } if(ui_hovering(sig) && can_pause) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Halt all target processes"); } @@ -5578,14 +5575,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_stop) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_stop) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Kill all target processes"); } @@ -5604,21 +5601,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Step Over"); } @@ -5637,21 +5634,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Step Into"); } @@ -5670,21 +5667,21 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(ui_hovering(sig) && !can_step && can_pause) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: Running"); } if(ui_hovering(sig) && !can_step && !can_stop) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Disabled: No processes are running"); } if(ui_hovering(sig) && can_step) { UI_Tooltip - UI_Font(df_font_from_slot(DF_FontSlot_Main)) + DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) ui_labelf("Step Out"); } @@ -5722,8 +5719,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 user_path = df_cfg_path_from_src(DF_CfgSrc_User); user_path = str8_chop_last_dot(user_path); - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) + UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Icons)) ui_label(df_g_icon_kind_text_table[DF_IconKind_Person]); ui_label(str8_skip_last_slash(user_path)); } @@ -5759,7 +5756,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { String8 prof_path = df_cfg_path_from_src(DF_CfgSrc_Project); prof_path = str8_chop_last_dot(prof_path); - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_Briefcase]); ui_label(str8_skip_last_slash(prof_path)); } @@ -5787,13 +5784,13 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) F32 button_dim = floor_f32(bar_dim.y); UI_PrefWidth(ui_px(button_dim, 1.f)) { - min_sig = df_icon_buttonf(DF_IconKind_Minus, 0, "##minimize"); - max_sig = df_icon_buttonf(DF_IconKind_Window, 0, "##maximize"); + min_sig = df_icon_buttonf(ws, DF_IconKind_Minus, 0, "##minimize"); + max_sig = df_icon_buttonf(ws, DF_IconKind_Window, 0, "##maximize"); } UI_PrefWidth(ui_px(button_dim, 1.f)) DF_Palette(ws, DF_PaletteCode_NegativePopButton) { - cls_sig = df_icon_buttonf(DF_IconKind_X, 0, "##close"); + cls_sig = df_icon_buttonf(ws, DF_IconKind_X, 0, "##close"); } if(ui_clicked(min_sig)) { @@ -5894,9 +5891,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(icon != DF_IconKind_Null) { UI_PrefWidth(ui_em(2.25f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) ui_label(df_g_icon_kind_text_table[icon]); } UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); @@ -5931,9 +5927,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_PrefWidth(ui_text_dim(10, 1)) UI_TextAlignment(UI_TextAlign_Center) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_label(error_string); } @@ -6097,15 +6092,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) DF_IconKind icon_kind = ws->query_cmd_spec->info.canonical_icon_kind; if(icon_kind != DF_IconKind_Null) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) UI_TextRasterFlags(F_RasterFlag_Smooth) - ui_label(df_g_icon_kind_text_table[icon_kind]); + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[icon_kind]); } ui_labelf("%S", ws->query_cmd_spec->info.display_name); } - UI_Font((query->flags & DF_CmdQueryFlag_CodeInput) ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) + DF_Font(ws, (query->flags & DF_CmdQueryFlag_CodeInput) ? DF_FontSlot_Code : DF_FontSlot_Main) UI_TextPadding(ui_top_font_size()*0.5f) { - UI_Signal sig = df_line_edit(DF_LineEditFlag_Border| + UI_Signal sig = df_line_edit(ws, DF_LineEditFlag_Border| (DF_LineEditFlag_CodeContents * !!(query->flags & DF_CmdQueryFlag_CodeInput)), 0, 0, @@ -6124,14 +6118,14 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } UI_PrefWidth(ui_em(5.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(ws, DF_PaletteCode_PositivePopButton) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_RightArrow, 0, "##complete_query"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_RightArrow, 0, "##complete_query"))) { query_completed = 1; } } UI_PrefWidth(ui_em(3.f, 1.f)) UI_Focus(UI_FocusKind_Off) DF_Palette(ws, DF_PaletteCode_PlainButton) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "##cancel_query"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "##cancel_query"))) { query_cancelled = 1; } @@ -6238,7 +6232,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) // rjf: build hover eval if(build_hover_eval && ws->hover_eval_string.size != 0 && hover_eval_is_open) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) DF_Palette(ws, DF_PaletteCode_Floating) { @@ -6388,11 +6382,10 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_PrefWidth(ui_em(1.5f, 1)) UI_Flags(UI_BoxFlag_DrawSideLeft*(row->depth>0) | UI_BoxFlag_DrawTextWeak) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } - UI_WidthFill + UI_WidthFill UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) { UI_PrefWidth(ui_px(expr_column_width_px, 1.f)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_expr); ui_spacer(ui_em(1.5f, 1.f)); @@ -6403,7 +6396,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) Vec4F32 rgba = df_rgba_from_theme_color(DF_ThemeColor_HighlightOverlay); ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = rgba)); } - UI_Signal sig = df_line_editf(DF_LineEditFlag_CodeContents| + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_CodeContents| DF_LineEditFlag_DisplayStringIsCode| DF_LineEditFlag_PreferDisplayString| DF_LineEditFlag_Border, @@ -6445,8 +6438,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius10(0) UI_CornerRadius11(0) { - UI_Signal watch_sig = df_icon_buttonf(DF_IconKind_List, 0, "###watch_hover_eval"); - if(ui_hovering(watch_sig)) UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + UI_Signal watch_sig = df_icon_buttonf(ws, DF_IconKind_List, 0, "###watch_hover_eval"); + if(ui_hovering(watch_sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) { ui_labelf("Add the hovered expression to an opened watch view."); } @@ -6463,8 +6456,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius10(corner_radius) UI_CornerRadius11(corner_radius) { - UI_Signal pin_sig = df_icon_buttonf(DF_IconKind_Pin, 0, "###pin_hover_eval"); - if(ui_hovering(pin_sig)) UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) + UI_Signal pin_sig = df_icon_buttonf(ws, DF_IconKind_Pin, 0, "###pin_hover_eval"); + if(ui_hovering(pin_sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Main) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Main)) UI_CornerRadius00(0) UI_CornerRadius01(0) UI_CornerRadius10(0) @@ -7098,8 +7091,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) { UI_PrefWidth(ui_em(3.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[DF_IconKind_Find]); UI_PrefWidth(ui_text_dim(10, 1)) @@ -7107,10 +7099,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) ui_label(str8_lit("Filter")); } ui_spacer(ui_em(0.5f, 1.f)); - UI_Font(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? df_font_from_slot(DF_FontSlot_Code) : df_font_from_slot(DF_FontSlot_Main)) UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off) + DF_Font(ws, view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) + UI_Focus(view->is_filtering ? UI_FocusKind_On : UI_FocusKind_Off) UI_TextPadding(ui_top_font_size()*0.5f) { - UI_Signal sig = df_line_edit(DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), + UI_Signal sig = df_line_edit(ws, + DF_LineEditFlag_CodeContents*!!(view->spec->info.flags & DF_ViewSpecFlag_FilterIsCode), 0, 0, &view->query_cursor, @@ -7474,9 +7468,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) if(icon_kind != DF_IconKind_Null) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_em(1.75f, 1.f)) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -7528,9 +7520,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) } } UI_PrefWidth(ui_em(2.35f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)*0.75f) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_Flags(UI_BoxFlag_DrawTextWeak) UI_CornerRadius00(0) UI_CornerRadius01(0) @@ -7613,9 +7604,8 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds) UI_CornerRadius10(panel->tab_side == Side_Min ? corner_radius : 0) UI_CornerRadius01(panel->tab_side == Side_Max ? corner_radius : 0) UI_CornerRadius11(panel->tab_side == Side_Max ? corner_radius : 0) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(ui_top_font_size()) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HoverCursor(OS_Cursor_HandPoint) DF_Palette(ws, DF_PaletteCode_ImplicitButton) @@ -9738,6 +9728,20 @@ df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot) return result; } +internal F_RasterFlags +df_raster_flags_from_slot(DF_Window *ws, DF_FontSlot slot) +{ + F_RasterFlags flags = F_RasterFlag_Smooth|F_RasterFlag_Hinted; + switch(slot) + { + default:{}break; + case DF_FontSlot_Icons:{flags = F_RasterFlag_Smooth;}break; + case DF_FontSlot_Main: {flags = (!!df_setting_val_from_code(ws, DF_SettingCode_SmoothUIText).s32*F_RasterFlag_Smooth)|(!!df_setting_val_from_code(ws, DF_SettingCode_HintUIText).s32*F_RasterFlag_Hinted);}break; + case DF_FontSlot_Code: {flags = (!!df_setting_val_from_code(ws, DF_SettingCode_SmoothCodeText).s32*F_RasterFlag_Smooth)|(!!df_setting_val_from_code(ws, DF_SettingCode_HintCodeText).s32*F_RasterFlag_Hinted);}break; + } + return flags; +} + //- rjf: settings internal DF_SettingVal @@ -10224,7 +10228,7 @@ df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, CTRL_Event *event, //~ rjf: UI Widgets: Fancy Buttons internal void -df_cmd_binding_buttons(DF_CmdSpec *spec) +df_cmd_binding_buttons(DF_Window *ws, DF_CmdSpec *spec) { Temp scratch = scratch_begin(0, 0); DF_BindingList bindings = df_bindings_from_spec(scratch.arena, spec); @@ -10348,7 +10352,7 @@ df_cmd_binding_buttons(DF_CmdSpec *spec) .text = df_rgba_from_theme_color(DF_ThemeColor_Text))) { ui_set_next_group_key(ui_key_zero()); - UI_Signal sig = df_icon_button(DF_IconKind_X, 0, str8_lit("###delete_binding")); + UI_Signal sig = df_icon_button(ws, DF_IconKind_X, 0, str8_lit("###delete_binding")); if(ui_clicked(sig)) { df_unbind_spec(spec, binding); @@ -10361,7 +10365,7 @@ df_cmd_binding_buttons(DF_CmdSpec *spec) } //- rjf: build "add new binding" button - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) { UI_Palette *palette = ui_top_palette(); B32 adding_new_binding = (df_gfx_state->bind_change_active && @@ -10406,110 +10410,6 @@ df_cmd_binding_buttons(DF_CmdSpec *spec) scratch_end(scratch); } -internal void -df_cmd_binding_button(DF_CmdSpec *spec) -{ - Temp scratch = scratch_begin(0, 0); - DF_BindingList bindings = df_bindings_from_spec(scratch.arena, spec); - DF_Binding binding = zero_struct; - if(bindings.first != 0) - { - binding = bindings.first->binding; - } - - //- rjf: grab all conflicts - DF_CmdSpecList specs_with_binding = df_cmd_spec_list_from_binding(scratch.arena, binding); - B32 has_conflicts = 0; - for(DF_CmdSpecNode *n = specs_with_binding.first; n != 0; n = n->next) - { - if(n->spec != spec) - { - has_conflicts = 1; - break; - } - } - - //- rjf: form binding string - String8 keybinding_str = {0}; - { - if(binding.key != OS_Key_Null) - { - String8List mods = os_string_list_from_event_flags(scratch.arena, binding.flags); - String8 key = os_g_key_display_string_table[binding.key]; - str8_list_push(scratch.arena, &mods, key); - StringJoin join = {0}; - join.sep = str8_lit(" + "); - keybinding_str = str8_list_join(scratch.arena, &mods, &join); - } - else - { - keybinding_str = str8_lit("- no binding -"); - } - } - - //- rjf: form color palette - UI_Palette *palette = ui_top_palette(); - if(has_conflicts || (df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec)) - { - palette = push_array(ui_build_arena(), UI_Palette, 1); - MemoryCopyStruct(palette, ui_top_palette()); - if(has_conflicts) - { - palette->colors[UI_ColorCode_Text] = df_rgba_from_theme_color(DF_ThemeColor_TextNegative); - } - if(df_gfx_state->bind_change_active && df_gfx_state->bind_change_cmd_spec == spec) - { - palette->colors[UI_ColorCode_Border] = df_rgba_from_theme_color(DF_ThemeColor_Hover); - palette->colors[UI_ColorCode_Background] = df_rgba_from_theme_color(DF_ThemeColor_Hover); - palette->colors[UI_ColorCode_Background].w *= 0.25f; - } - } - - //- rjf: build box - ui_set_next_hover_cursor(OS_Cursor_HandPoint); - ui_set_next_text_alignment(UI_TextAlign_Center); - ui_set_next_palette(palette); - ui_set_next_group_key(ui_key_zero()); - UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText| - UI_BoxFlag_Clickable| - UI_BoxFlag_DrawActiveEffects| - UI_BoxFlag_DrawHotEffects| - UI_BoxFlag_DrawBorder| - UI_BoxFlag_DrawBackground, - "%S###bind_btn_%p", keybinding_str, spec); - - //- rjf: interaction - UI_Signal sig = ui_signal_from_box(box); - { - // rjf: click => toggle activity - if(!df_gfx_state->bind_change_active && ui_clicked(sig)) - { - df_gfx_state->bind_change_active = 1; - df_gfx_state->bind_change_cmd_spec = spec; - df_gfx_state->bind_change_binding = binding; - } - else if(df_gfx_state->bind_change_active && ui_clicked(sig)) - { - df_gfx_state->bind_change_active = 0; - } - - // rjf: hover w/ conflicts => show conflicts - if(ui_hovering(sig) && has_conflicts) UI_Tooltip - { - ui_labelf("This binding conflicts with others:"); - for(DF_CmdSpecNode *n = specs_with_binding.first; n != 0; n = n->next) - { - if(n->spec != spec) - { - ui_labelf("%S", n->spec->info.display_name); - } - } - } - } - - scratch_end(scratch); -} - internal UI_Signal df_menu_bar_button(String8 string) { @@ -10520,7 +10420,7 @@ df_menu_bar_button(String8 string) } internal UI_Signal -df_cmd_spec_button(DF_CmdSpec *spec) +df_cmd_spec_button(DF_Window *ws, DF_CmdSpec *spec) { ui_set_next_hover_cursor(OS_Cursor_HandPoint); ui_set_next_child_layout_axis(Axis2_X); @@ -10535,8 +10435,7 @@ df_cmd_spec_button(DF_CmdSpec *spec) DF_IconKind canonical_icon = spec->info.canonical_icon_kind; if(canonical_icon != DF_IconKind_Null) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_PrefWidth(ui_em(2.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) @@ -10557,7 +10456,7 @@ df_cmd_spec_button(DF_CmdSpec *spec) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_FastpathCodepoint(0) { - df_cmd_binding_buttons(spec); + df_cmd_binding_buttons(ws, spec); } } } @@ -10573,7 +10472,7 @@ df_cmd_list_menu_buttons(DF_Window *ws, U64 count, DF_CoreCmdKind *cmds, U32 *fa { DF_CmdSpec *spec = df_cmd_spec_from_core_cmd_kind(cmds[idx]); ui_set_next_fastpath_codepoint(fastpath_codepoints[idx]); - UI_Signal sig = df_cmd_spec_button(spec); + UI_Signal sig = df_cmd_spec_button(ws, spec); if(ui_clicked(sig)) { DF_CmdParams params = df_cmd_params_from_window(ws); @@ -10588,7 +10487,7 @@ df_cmd_list_menu_buttons(DF_Window *ws, U64 count, DF_CoreCmdKind *cmds, U32 *fa } internal UI_Signal -df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) +df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) { String8 display_string = ui_display_part_from_key_string(string); ui_set_next_hover_cursor(OS_Cursor_HandPoint); @@ -10610,8 +10509,7 @@ df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) ui_spacer(ui_em(1.f, 1.f)); } UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_PrefWidth(ui_em(2.f, 1.f)) UI_PrefHeight(ui_pct(1, 0)) UI_FlagsAdd(UI_BoxFlag_DisableTextTrunc|UI_BoxFlag_DrawTextWeak) @@ -10641,14 +10539,14 @@ df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string) } internal UI_Signal -df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...) +df_icon_buttonf(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); va_end(args); - UI_Signal sig = df_icon_button(kind, matches, string); + UI_Signal sig = df_icon_button(ws, kind, matches, string); scratch_end(scratch); return sig; } @@ -10703,8 +10601,7 @@ df_entity_tooltips(DF_Window *ws, DF_Entity *entity) UI_PrefWidth(ui_children_sum(1)) UI_Row UI_Palette(palette) { UI_PrefWidth(ui_em(1.5f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[icon_kind]); UI_PrefWidth(ui_text_dim(10, 1)) ui_label(explanation); } @@ -10749,21 +10646,21 @@ df_entity_tooltips(DF_Window *ws, DF_Entity *entity) } UI_PrefWidth(ui_children_sum(1)) UI_Row { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); + DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_em(18.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x", rip_vaddr); if(info.size != 0) { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(info); + DF_Font(ws, DF_FontSlot_Code)UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(info); } if(name.size != 0) { - UI_Font(df_font_from_slot(DF_FontSlot_Code))UI_PrefWidth(ui_text_dim(10, 1)) + DF_Font(ws, DF_FontSlot_Code) UI_PrefWidth(ui_text_dim(10, 1)) { df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); } } else { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); + DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_labelf("[??? in %S]", module_name); } } } @@ -10786,18 +10683,18 @@ df_entity_tooltips(DF_Window *ws, DF_Entity *entity) stop_condition = str8_lit("true"); } UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Stop Condition: "); - UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), stop_condition); + UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), stop_condition); } UI_PrefWidth(ui_children_sum(1)) UI_Row { U64 hit_count = entity->u64; String8 hit_count_text = str8_from_u64(scratch.arena, hit_count, 10, 0, 0); UI_PrefWidth(ui_em(12.f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Hit Count: "); - UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_text); + UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_text); } }break; case DF_EntityKind_WatchPin: - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) UI_Tooltip UI_PrefWidth(ui_text_dim(10, 1)) { if(entity->flags & DF_EntityFlag_HasColor) @@ -10868,9 +10765,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam entity_color_weak.w *= 0.5f; } UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(1.875f, 1.f)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[icon]); @@ -10880,9 +10776,8 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam UI_PrefWidth(ui_em(1.875f, 1.f)) { UI_Box *info_box = &ui_g_nil_box; - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) { info_box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_DrawTextWeak|UI_BoxFlag_Clickable, "%S###%p_temp_info", df_g_icon_kind_text_table[DF_IconKind_Info], entity); } @@ -10895,7 +10790,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } String8 label = df_display_string_from_entity(scratch.arena, entity); UI_Palette(ui_build_palette(ui_top_palette(), .text = entity_color)) - UI_Font(kind_flags&DF_EntityKindFlag_NameIsCode ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) + DF_Font(ws, kind_flags&DF_EntityKindFlag_NameIsCode ? DF_FontSlot_Code : DF_FontSlot_Main) UI_Flags((entity->kind == DF_EntityKind_Thread || entity->kind == DF_EntityKind_Breakpoint || entity->kind == DF_EntityKind_WatchPin) @@ -10919,7 +10814,7 @@ df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *nam } if(entity->kind == DF_EntityKind_Thread) UI_FontSize(ui_top_font_size()*0.75f) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) UI_Flags(UI_BoxFlag_DisableTruncatedHover) { @@ -11024,9 +10919,8 @@ df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point) DF_IconKind icon = df_g_entity_kind_icon_kind_table[entity->kind]; UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) ui_label(df_g_icon_kind_text_table[icon]); ui_labelf("%S:%I64d:%I64d", filename, point.line, point.column); } @@ -11766,10 +11660,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ ui_set_next_flags(UI_BoxFlag_DrawSideLeft|UI_BoxFlag_DrawSideRight); UI_Column UI_PrefHeight(ui_px(params->line_height_px, 1.f)) - UI_Font(params->font) + DF_Font(ws, DF_FontSlot_Code) UI_FontSize(params->font_size) - UI_TextRasterFlags((!!df_setting_val_from_code(ws, DF_SettingCode_SmoothCodeText).s32 * F_RasterFlag_Smooth)| - (!!df_setting_val_from_code(ws, DF_SettingCode_HintCodeText).s32 * F_RasterFlag_Hinted)) UI_CornerRadius(0) { U64 line_idx = 0; @@ -11894,9 +11786,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBorder, "###exception_info"); UI_Parent(box) UI_PrefWidth(ui_text_dim(10, 1)) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) - ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_label(explanation); } } @@ -11918,10 +11808,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ { DF_EntityList pins = params->line_pins[line_idx]; if(pins.count != 0) UI_Parent(line_extras_boxes[line_idx]) - UI_Font(params->font) + DF_Font(ws, DF_FontSlot_Code) UI_FontSize(params->font_size) - UI_TextRasterFlags((!!df_setting_val_from_code(ws, DF_SettingCode_SmoothCodeText).s32 * F_RasterFlag_Smooth)| - (!!df_setting_val_from_code(ws, DF_SettingCode_HintCodeText).s32 * F_RasterFlag_Hinted)) UI_PrefHeight(ui_px(params->line_height_px, 1.f)) { for(DF_EntityNode *n = pins.first; n != 0; n = n->next) @@ -11951,8 +11839,7 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ pin_color = df_rgba_from_entity(pin); } UI_PrefWidth(ui_em(1.5f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_Palette(ui_build_palette(ui_top_palette(), .text = pin_color)) UI_TextAlignment(UI_TextAlign_Center) UI_Flags(UI_BoxFlag_DisableTextTrunc) @@ -12352,10 +12239,8 @@ df_code_slice(DF_Window *ws, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, DF_ UI_WidthFill UI_Column UI_PrefHeight(ui_px(params->line_height_px, 1.f)) - UI_Font(params->font) + DF_Font(ws, DF_FontSlot_Code) UI_FontSize(params->font_size) - UI_TextRasterFlags((!!df_setting_val_from_code(ws, DF_SettingCode_SmoothCodeText).s32 * F_RasterFlag_Smooth)| - (!!df_setting_val_from_code(ws, DF_SettingCode_HintCodeText).s32 * F_RasterFlag_Hinted)) UI_CornerRadius(0) { U64 line_idx = 0; @@ -13061,7 +12946,7 @@ df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 base_color, String //~ rjf: UI Widgets: Line Edit internal UI_Signal -df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string) +df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string) { //- rjf: unpack visual metrics F32 expander_size_px = ui_top_font_size()*1.5f; @@ -13116,8 +13001,7 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_Flags(UI_BoxFlag_DrawSideLeft) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[DF_IconKind_Dot]); } @@ -13477,14 +13361,14 @@ df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, Tx } internal UI_Signal -df_line_editf(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...) +df_line_editf(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...) { Temp scratch = scratch_begin(0, 0); va_list args; va_start(args, fmt); String8 string = push_str8fv(scratch.arena, fmt, args); va_end(args); - UI_Signal sig = df_line_edit(flags, depth, matches, cursor, mark, edit_buffer, edit_buffer_size, edit_string_size_out, expanded_out, pre_edit_value, string); + UI_Signal sig = df_line_edit(ws, flags, depth, matches, cursor, mark, edit_buffer, edit_buffer_size, edit_string_size_out, expanded_out, pre_edit_value, string); scratch_end(scratch); return sig; } diff --git a/src/df/gfx/df_gfx.h b/src/df/gfx/df_gfx.h index 23395a94..ba249932 100644 --- a/src/df/gfx/df_gfx.h +++ b/src/df/gfx/df_gfx.h @@ -324,7 +324,7 @@ enum #define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name) df_gfx_view_rule_line_stringize__##name #define DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_DEF(name) internal DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_SIG(DF_GFX_VIEW_RULE_LINE_STRINGIZE_FUNCTION_NAME(name)) -#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(DF_ExpandKey key, DF_Eval eval, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg) +#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, DI_Scope *scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg) #define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_gfx_view_rule_row_ui__##name #define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name)) @@ -1046,6 +1046,7 @@ internal UI_Palette *df_palette_from_code(DF_Window *ws, DF_PaletteCode code); //- rjf: fonts/sizes internal F_Tag df_font_from_slot(DF_FontSlot slot); internal F32 df_font_size_from_slot(DF_Window *ws, DF_FontSlot slot); +internal F_RasterFlags df_raster_flags_from_slot(DF_Window *ws, DF_FontSlot slot); //- rjf: settings internal DF_SettingVal df_setting_val_from_code(DF_Window *optional_window, DF_SettingCode code); @@ -1064,17 +1065,17 @@ internal String8 df_stop_explanation_string_icon_from_ctrl_event(Arena *arena, C //~ rjf: UI Building Helpers #define DF_Palette(ws, code) UI_Palette(df_palette_from_code((ws), (code))) +#define DF_Font(ws, slot) UI_Font(df_font_from_slot(slot)) UI_TextRasterFlags(df_raster_flags_from_slot((ws), (slot))) //////////////////////////////// //~ rjf: UI Widgets: Fancy Buttons -internal void df_cmd_binding_buttons(DF_CmdSpec *spec); -internal void df_cmd_binding_button(DF_CmdSpec *spec); +internal void df_cmd_binding_buttons(DF_Window *ws, DF_CmdSpec *spec); internal UI_Signal df_menu_bar_button(String8 string); -internal UI_Signal df_cmd_spec_button(DF_CmdSpec *spec); +internal UI_Signal df_cmd_spec_button(DF_Window *ws, DF_CmdSpec *spec); internal void df_cmd_list_menu_buttons(DF_Window *ws, U64 count, DF_CoreCmdKind *cmds, U32 *fastpath_codepoints); -internal UI_Signal df_icon_button(DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string); -internal UI_Signal df_icon_buttonf(DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...); +internal UI_Signal df_icon_button(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, String8 string); +internal UI_Signal df_icon_buttonf(DF_Window *ws, DF_IconKind kind, FuzzyMatchRangeList *matches, char *fmt, ...); internal void df_entity_tooltips(DF_Window *ws, DF_Entity *entity); internal UI_Signal df_entity_desc_button(DF_Window *ws, DF_Entity *entity, FuzzyMatchRangeList *name_matches, String8 fuzzy_query, B32 is_implicit); internal void df_entity_src_loc_button(DF_Window *ws, DF_Entity *entity, TxtPt point); @@ -1100,8 +1101,8 @@ internal UI_Box *df_code_label(F32 alpha, B32 indirection_size_change, Vec4F32 b //////////////////////////////// //~ rjf: UI Widgets: Line Edit -internal UI_Signal df_line_edit(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string); -internal UI_Signal df_line_editf(DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...); +internal UI_Signal df_line_edit(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, String8 string); +internal UI_Signal df_line_editf(DF_Window *ws, DF_LineEditFlags flags, S32 depth, FuzzyMatchRangeList *matches, TxtPt *cursor, TxtPt *mark, U8 *edit_buffer, U64 edit_buffer_size, U64 *edit_string_size_out, B32 *expanded_out, String8 pre_edit_value, char *fmt, ...); //////////////////////////////// //~ rjf: Continuous Frame Requests diff --git a/src/df/gfx/df_view_rules.c b/src/df/gfx/df_view_rules.c index 849f79c6..d8fb7cfc 100644 --- a/src/df/gfx/df_view_rules.c +++ b/src/df/gfx/df_view_rules.c @@ -343,7 +343,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(rgba) //- rjf: build text box UI_Box *text_box = &ui_g_nil_box; - UI_WidthFill UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_WidthFill DF_Font(ws, DF_FontSlot_Code) { text_box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero()); D_FancyStringList fancy_strings = {0}; @@ -433,7 +433,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba) UI_Signal h_sig = ui_hue_pickerf(&hsva.x, hsva.y, hsva.z, "hue_picker"); commit = commit || ui_released(h_sig); } - UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { ui_labelf("Hex"); ui_labelf("R"); @@ -444,7 +444,7 @@ DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(rgba) ui_labelf("V"); ui_labelf("A"); } - UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_PrefWidth(ui_children_sum(1)) UI_Column UI_PrefWidth(ui_text_dim(10, 1)) DF_Font(ws, DF_FontSlot_Code) { String8 hex_string = hex_string_from_rgba_4f32(scratch.arena, rgba); ui_label(hex_string); @@ -930,7 +930,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(bitmap) U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset; DF_BitmapTopologyInfo topology = df_vr_bitmap_topology_info_from_cfg(scope, ctrl_ctx, parse_ctx, macro_map, cfg); U64 expected_size = topology.width*topology.height*r_tex2d_format_bytes_per_pixel_table[topology.fmt]; - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x -> Bitmap (%I64u x %I64u)", base_vaddr, topology.width, topology.height); } @@ -1335,7 +1335,7 @@ DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(geo) { DF_Eval value_eval = df_value_mode_eval_from_eval(parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, eval); U64 base_vaddr = value_eval.imm_u64 ? value_eval.imm_u64 : value_eval.offset; - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("0x%I64x -> Geometry", base_vaddr); } diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index 65ae9069..f14a1d7e 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -2396,31 +2396,31 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS F32 max_width = ui_top_font_size()*35; ui_label_multiline(max_width, str8_lit("View rules are used to tweak the way evaluated expressions are visualized. Multiple rules can be specified on each row. They are specified in a key:(value) form. Some examples follow:")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("array:(N)"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("array:(N)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that a pointer points to N elements, rather than only 1.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("omit:(member_1 ... member_n)"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("omit:(member_1 ... member_n)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Omits a list of member names from appearing in struct, union, or class evaluations.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("only:(member_1 ... member_n)"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("only:(member_1 ... member_n)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that only the specified members should appear in struct, union, or class evaluations.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("list:(next_link_member_name)"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("list:(next_link_member_name)"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that some struct, union, or class forms the top of a linked list, with next_link_member_name being the member which points at the next element in the list.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("dec"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("dec"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-10 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("hex"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("hex"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-16 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("oct"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("oct"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-8 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("bin"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("bin"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Specifies that all integral evaluations should appear in base-2 form.")); ui_spacer(ui_em(1.5f, 1)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) ui_labelf("no_addr"); + DF_Font(ws, DF_FontSlot_Code) ui_labelf("no_addr"); UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label_multiline(max_width, str8_lit("Displays only what pointers point to, if possible, without the pointer's address value.")); ui_spacer(ui_em(1.5f, 1)); } @@ -2618,14 +2618,15 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS { B32 expr_editing_active = ui_is_focus_active(); B32 is_inherited = (row->inherited_type_key_chain.count != 0); - UI_Font(code_font) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) + DF_Font(ws, DF_FontSlot_Code) UI_FlagsAdd(row->depth > 0 ? UI_BoxFlag_DrawTextWeak : 0) { FuzzyMatchRangeList matches = {0}; if(filter.size != 0) { matches = fuzzy_match_find(scratch.arena, filter, row->display_expr); } - sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))| + sig = df_line_editf(ws, + (DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))| DF_LineEditFlag_NoBackground*(!is_inherited)| DF_LineEditFlag_DisableEdit*(!can_edit_expr)| DF_LineEditFlag_Expander*!!(row->flags & DF_EvalVizRowFlag_CanExpand)| @@ -2653,10 +2654,10 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS UI_Row { ui_labelf("Inherited from "); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1.f, df_rgba_from_theme_color(DF_ThemeColor_CodeType), inheritance_type); + DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1.f, df_rgba_from_theme_color(DF_ThemeColor_CodeType), inheritance_type); } } - if(DEV_eval_watch_key_tooltips && ui_hovering(sig)) UI_Tooltip UI_Font(df_font_from_slot(DF_FontSlot_Code)) + if(DEV_eval_watch_key_tooltips && ui_hovering(sig)) UI_Tooltip DF_Font(ws, DF_FontSlot_Code) { ui_labelf("Parent Key: %I64x, %I64x", row->parent_key.parent_hash, row->parent_key.child_num); ui_labelf("Hover Key: %I64x, %I64x", row->key.parent_hash, row->key.child_num); @@ -2764,12 +2765,12 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS // rjf: build UI_Signal sig = {0}; ui_set_next_flags(cell_flags); - UI_Palette(palette) UI_TableCell UI_Font(code_font) + UI_Palette(palette) UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { // rjf: errors? -> show errors - if(value_is_error) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + if(value_is_error) DF_Font(ws, DF_FontSlot_Main) { String8List strings = {0}; for(EVAL_Error *error = row->eval.errors.first; error != 0; error = error->next) @@ -2782,12 +2783,12 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS } // rjf: hook -> call hook - if(value_is_hook) UI_Font(df_font_from_slot(DF_FontSlot_Main)) + if(value_is_hook) DF_Font(ws, DF_FontSlot_Main) { UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clip|UI_BoxFlag_Clickable, "###val_%I64x", row_hash); UI_Parent(box) { - row->value_ui_rule_spec->info.row_ui(row->key, row->eval, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->value_ui_rule_node); + row->value_ui_rule_spec->info.row_ui(ws, row->key, row->eval, di_scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->value_ui_rule_node); } sig = ui_signal_from_box(box); } @@ -2804,9 +2805,9 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS } // rjf: simple values (editable) - if(value_is_simple) + if(value_is_simple) UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) { - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, row->display_value, "%S###val_%I64x", row->display_value, row_hash); + sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, row->display_value, "%S###val_%I64x", row->display_value, row_hash); } } @@ -2861,7 +2862,7 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS DF_WatchViewPoint pt = {DF_WatchViewColumnKind_Type, row->parent_key, row->key}; DF_WatchViewTextEditState *edit_state = df_watch_view_text_edit_state_from_pt(ewv, pt); B32 cell_selected = (row_selected && selection_tbl.min.x <= pt.column_kind && pt.column_kind <= selection_tbl.max.x); - UI_TableCell UI_Font(code_font) + UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { @@ -2895,12 +2896,13 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS // rjf: build UI_Signal sig = {0}; B32 rule_editing_active = 0; - UI_TableCell UI_Font(code_font) + UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((cell_selected && ewv->text_editing) ? UI_FocusKind_On : UI_FocusKind_Off) + UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) { rule_editing_active = ui_is_focus_active(); - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, view_rule, "###view_rule_%I64x", row_hash); + sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground, 0, 0, &edit_state->cursor, &edit_state->mark, edit_state->input_buffer, sizeof(edit_state->input_buffer), &edit_state->input_size, 0, view_rule, "###view_rule_%I64x", row_hash); } // rjf: press -> commit if not selected, select this cell @@ -2980,7 +2982,7 @@ DF_VIEW_UI_FUNCTION_DEF(Empty) UI_CornerRadius(ui_top_font_size()/2.f) DF_Palette(ws, DF_PaletteCode_NegativePopButton) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "Close Panel"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "Close Panel"))) { DF_CmdParams p = df_cmd_params_from_panel(ws, panel); df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_ClosePanel)); @@ -3053,7 +3055,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_PrefWidth(ui_em(22.f, 1.f)) UI_CornerRadius(ui_top_font_size()/2.f) DF_Palette(ws, DF_PaletteCode_NeutralPopButton) - if(ui_clicked(df_icon_buttonf(DF_IconKind_Add, 0, "Add Target"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Add, 0, "Add Target"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); params.cmd_spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_AddTarget); @@ -3076,7 +3078,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) UI_CornerRadius(ui_top_font_size()/2.f) DF_Palette(ws, DF_PaletteCode_PositivePopButton) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Launch %S", target_name))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Launch %S", target_name))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); params.entity = df_handle_from_entity(target); @@ -3084,7 +3086,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) df_push_cmd__root(¶ms, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_LaunchAndRun)); } ui_spacer(ui_em(1.5f, 1)); - if(ui_clicked(df_icon_buttonf(DF_IconKind_Play, 0, "Step Into %S", target_name))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Play, 0, "Step Into %S", target_name))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); params.entity = df_handle_from_entity(target); @@ -3121,7 +3123,7 @@ DF_VIEW_UI_FUNCTION_DEF(GettingStarted) { ui_labelf("use"); DF_CmdSpec *spec = df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_RunCommand); - UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_buttons(spec); + UI_Flags(UI_BoxFlag_DrawBorder) UI_TextAlignment(UI_TextAlign_Center) df_cmd_binding_buttons(ws, spec); ui_labelf("to open command menu"); } } @@ -3227,9 +3229,8 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) UI_PrefWidth(ui_em(3.f, 1.f)) UI_HeightFill UI_Column - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_HeightFill UI_TextAlignment(UI_TextAlign_Center) @@ -3268,7 +3269,7 @@ DF_VIEW_UI_FUNCTION_DEF(Commands) ui_set_next_flags(UI_BoxFlag_Clickable); UI_NamedRow(str8_lit("binding_row")) UI_Padding(ui_em(1.f, 1.f)) { - df_cmd_binding_buttons(item->cmd_spec); + df_cmd_binding_buttons(ws, item->cmd_spec); } } } @@ -3626,9 +3627,8 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) UI_Parent(sig.box) { // rjf: icons - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -3675,9 +3675,8 @@ DF_VIEW_UI_FUNCTION_DEF(FileSystem) UI_PrefWidth(ui_pct(fs->col_pcts[0], 1)) UI_Row { // rjf: icon to signify directory - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -3864,9 +3863,8 @@ DF_VIEW_UI_FUNCTION_DEF(SystemProcesses) UI_Parent(sig.box) { // rjf: icon - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_PrefWidth(ui_em(3.f, 1.f)) UI_TextAlignment(UI_TextAlign_Center) { @@ -4038,9 +4036,8 @@ DF_VIEW_UI_FUNCTION_DEF(EntityLister) if(icon_kind != DF_IconKind_Null) { UI_TextAlignment(UI_TextAlign_Center) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_text_dim(10, 1)) ui_label(df_g_icon_kind_text_table[icon_kind]); @@ -4185,7 +4182,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) &visible_row_range, &scroll_list_sig) UI_Focus(UI_FocusKind_Null) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_TextRasterFlags(df_raster_flags_from_slot(ws, DF_FontSlot_Code)) { //- rjf: build rows for(U64 idx = visible_row_range.min; @@ -4256,7 +4253,7 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) if(ui_hovering(sig)) UI_Tooltip { df_code_label(1.f, 0, df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol), name); - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("Procedure #%I64u", item->idx); U64 binary_voff = df_voff_from_dbgi_key_symbol_name(&dbgi_key, name); DF_LineList lines = df_lines_from_dbgi_key_voff(scratch.arena, &dbgi_key, binary_voff); @@ -4264,12 +4261,12 @@ DF_VIEW_UI_FUNCTION_DEF(SymbolLister) { String8 file_path = df_full_path_from_entity(scratch.arena, df_entity_from_handle(lines.first->v.file)); S64 line_num = lines.first->v.pt.line; - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_labelf("%S:%I64d", file_path, line_num); } else { - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(str8_lit("(No source code location found)")); } } @@ -4463,7 +4460,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) { ui_label_multiline(ui_top_font_size()*30.f, str8_lit("By default, the debugger attempts to find a target's entry point with a set of default names, such as:")); ui_spacer(ui_em(1.5f, 1.f)); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) + DF_Font(ws, DF_FontSlot_Code) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_CodeSymbol))) { ui_label(str8_lit("WinMain")); ui_label(str8_lit("wWinMain")); @@ -4486,7 +4483,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) UI_TableCell { // rjf: value editor - UI_WidthFill UI_Font(kv_info[idx].use_code_font ? df_font_from_slot(DF_FontSlot_Code) : df_font_from_slot(DF_FontSlot_Main)) + UI_WidthFill DF_Font(ws, kv_info[idx].use_code_font ? DF_FontSlot_Code : DF_FontSlot_Main) { // rjf: * => focus B32 value_selected = row_selected && (next_cursor.x == 0 || !has_browse); @@ -4506,7 +4503,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && tv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &tv->input_cursor, &tv->input_mark, tv->input_buffer, sizeof(tv->input_buffer), &tv->input_size, 0, kv_info[idx].current_text, "###kv_editor_%i", (S32)idx); + sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &tv->input_cursor, &tv->input_mark, tv->input_buffer, sizeof(tv->input_buffer), &tv->input_size, 0, kv_info[idx].current_text, "###kv_editor_%i", (S32)idx); edit_commit = edit_commit || ui_committed(sig); } @@ -4692,7 +4689,7 @@ DF_VIEW_UI_FUNCTION_DEF(Targets) { UI_Signal add_sig = {0}; UI_FocusHot(cursor.y == 1 ? UI_FocusKind_On : UI_FocusKind_Off) - add_sig = df_icon_buttonf(DF_IconKind_Add, 0, "Add New Target"); + add_sig = df_icon_buttonf(ws, DF_IconKind_Add, 0, "Add New Target"); if(ui_clicked(add_sig)) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); @@ -4715,7 +4712,7 @@ DF_VIEW_UI_FUNCTION_DEF(Targets) UI_PrefWidth(ui_em(2.25f, 1)) UI_FocusHot((row_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_Signal sig = df_icon_buttonf(target->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); + UI_Signal sig = df_icon_buttonf(ws, target->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", target); if(ui_clicked(sig)) { DF_CmdParams p = df_cmd_params_from_view(ws, panel, view); @@ -4751,7 +4748,7 @@ DF_VIEW_UI_FUNCTION_DEF(Targets) UI_Signal sig = {0}; UI_FocusHot((row_selected && cursor.x == 2+ctrl_idx) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_icon_buttonf(ctrls[ctrl_idx].icon, 0, "###%p_ctrl_%i", target, (int)ctrl_idx); + sig = df_icon_buttonf(ws, ctrls[ctrl_idx].icon, 0, "###%p_ctrl_%i", target, (int)ctrl_idx); } if(ui_hovering(sig)) UI_Tooltip { @@ -4964,7 +4961,7 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && fpms->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_src_path, "###src_editor_%p", map); + sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_src_path, "###src_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5038,7 +5035,7 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap) UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && fpms->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) { - sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_dst_path, "###dst_editor_%p", map); + sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &fpms->input_cursor, &fpms->input_mark, fpms->input_buffer, sizeof(fpms->input_buffer), &fpms->input_size, 0, map_dst_path, "###dst_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5284,9 +5281,9 @@ DF_VIEW_UI_FUNCTION_DEF(AutoViewRules) UI_Signal sig = {0}; UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) { - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, type, "###src_editor_%p", map); + sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, type, "###src_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5346,9 +5343,9 @@ DF_VIEW_UI_FUNCTION_DEF(AutoViewRules) UI_Signal sig = {0}; UI_FocusHot(value_selected ? UI_FocusKind_On : UI_FocusKind_Off) UI_FocusActive((value_selected && avrs->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) { - sig = df_line_editf(DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, view_rule, "###dst_editor_%p", map); + sig = df_line_editf(ws, DF_LineEditFlag_CodeContents|DF_LineEditFlag_NoBackground|DF_LineEditFlag_DisplayStringIsCode, 0, 0, &avrs->input_cursor, &avrs->input_mark, avrs->input_buffer, sizeof(avrs->input_buffer), &avrs->input_size, 0, view_rule, "###dst_editor_%p", map); edit_commit = edit_commit || ui_committed(sig); } @@ -5570,7 +5567,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) palette = df_palette_from_code(ws, DF_PaletteCode_PositivePopButton); } UI_Signal sig = {0}; - UI_Palette(palette) sig = df_icon_buttonf(frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); + UI_Palette(palette) sig = df_icon_buttonf(ws, frozen ? DF_IconKind_Locked : DF_IconKind_Unlocked, 0, "###lock_%p", entity); if(ui_clicked(sig)) { DF_CoreCmdKind cmd_kind = frozen ? DF_CoreCmdKind_ThawEntity : DF_CoreCmdKind_FreezeEntity; @@ -5610,7 +5607,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) } UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 3) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Redo, 0, "###retry"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Redo, 0, "###retry"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); df_handle_list_push(scratch.arena, ¶ms.entity_list, df_handle_from_entity(entity)); @@ -5621,7 +5618,7 @@ DF_VIEW_UI_FUNCTION_DEF(Scheduler) UI_TableCellSized(ui_em(2.25f, 1.f)) UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { DF_Palette(ws, DF_PaletteCode_NegativePopButton) - if(ui_clicked(df_icon_buttonf(DF_IconKind_X, 0, "###kill"))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_X, 0, "###kill"))) { DF_CmdParams params = df_cmd_params_from_view(ws, panel, view); df_handle_list_push(scratch.arena, ¶ms.entity_list, df_handle_from_entity(entity)); @@ -5793,9 +5790,8 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) { // rjf: build cell for selection UI_TableCell - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) + DF_Font(ws, DF_FontSlot_Icons) UI_FontSize(df_font_size_from_slot(ws, DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) UI_WidthFill UI_TextAlignment(UI_TextAlign_Center) UI_FocusHot((row_selected && cs->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) @@ -5828,7 +5824,7 @@ DF_VIEW_UI_FUNCTION_DEF(CallStack) } // rjf: build cell for function header - UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot((row_selected && cs->cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { ui_set_next_child_layout_axis(Axis2_X); @@ -6156,7 +6152,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) { df_entity_desc_button(ws, entity, &items.v[idx].matches, query, 1); } - UI_TableCell UI_Font(df_font_from_slot(DF_FontSlot_Code)) UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) + UI_TableCell DF_Font(ws, DF_FontSlot_Code) UI_FocusHot((row_is_selected && cursor.x == 1) ? UI_FocusKind_On : UI_FocusKind_Off) { UI_Box *range_box = ui_build_box_from_stringf(UI_BoxFlag_Clickable|UI_BoxFlag_DrawText, "[0x%I64x, 0x%I64x)###vaddr_range_%p", entity->vaddr_rng.min, entity->vaddr_rng.max, entity); UI_Signal sig = ui_signal_from_box(range_box); @@ -6195,7 +6191,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) UI_WidthFill { UI_Palette(dbgi_is_valid ? ui_top_palette() : ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - sig = df_line_editf(DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); + sig = df_line_editf(ws, DF_LineEditFlag_NoBackground, 0, 0, &mv->txt_cursor, &mv->txt_mark, mv->txt_buffer, sizeof(mv->txt_buffer), &mv->txt_size, 0, dbgi_path, "###dbg_path_%p", entity); edit_commit = (edit_commit || ui_committed(sig)); } @@ -6519,9 +6515,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) UI_PrefWidth(ui_text_dim(10, 1)) UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) { - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) - ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); + DF_Font(ws, DF_FontSlot_Icons) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]); ui_labelf("Could not find \"%S\".", full_path); } UI_PrefHeight(ui_em(3, 1)) @@ -6609,8 +6603,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) { UI_Box *box = &ui_g_nil_box; UI_Palette(ui_build_palette(ui_top_palette(), .text = df_rgba_from_theme_color(DF_ThemeColor_TextNegative))) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) { box = ui_build_box_from_stringf(UI_BoxFlag_DrawText|UI_BoxFlag_Clickable, "%S###file_ood_warning", df_g_icon_kind_text_table[DF_IconKind_WarningBig]); } @@ -6625,7 +6618,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code) } } } - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) { ui_label(path); ui_spacer(ui_em(1.5f, 1)); @@ -6858,7 +6851,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) - UI_Font(df_font_from_slot(DF_FontSlot_Code)) + DF_Font(ws, DF_FontSlot_Code) { DF_Entity *module = df_module_from_process_vaddr(process, dasm_vaddr_range.min); U64 cursor_vaddr = (1 <= view->cursor.line && view->cursor.line <= dasm_info.insts.count) ? (dasm_vaddr_range.min+dasm_info.insts.v[view->cursor.line-1].code_off) : 0; @@ -7126,15 +7119,13 @@ DF_VIEW_UI_FUNCTION_DEF(Output) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) + DF_Font(ws, DF_FontSlot_Code) { - UI_Font(df_font_from_slot(DF_FontSlot_Code)) - { - ui_labelf("(Debug String Output)"); - ui_spacer(ui_em(1.5f, 1)); - ui_labelf("Line: %I64d, Column: %I64d", view->cursor.line, view->cursor.column); - ui_spacer(ui_pct(1, 0)); - ui_labelf("(read only)"); - } + ui_labelf("(Debug String Output)"); + ui_spacer(ui_em(1.5f, 1)); + ui_labelf("Line: %I64d, Column: %I64d", view->cursor.line, view->cursor.column); + ui_spacer(ui_pct(1, 0)); + ui_labelf("(read only)"); } } @@ -7619,7 +7610,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) UI_WidthFill UI_PrefHeight(ui_px(row_height_px, 1.f)) UI_Row header_box = ui_build_box_from_stringf(UI_BoxFlag_DrawSideBottom, "table_header"); UI_Parent(header_box) - UI_Font(font) + DF_Font(ws, DF_FontSlot_Code) UI_FontSize(font_size) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) { @@ -7780,7 +7771,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ////////////////////////////// //- rjf: build rows // - UI_Parent(row_container_box) UI_Font(font) UI_FontSize(font_size) + UI_Parent(row_container_box) DF_Font(ws, DF_FontSlot_Code) UI_FontSize(font_size) { Rng1U64 selection = r1u64(mv->cursor, mv->mark); U8 *row_ascii_buffer = push_array(scratch.arena, U8, mv->num_columns); @@ -7872,8 +7863,8 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) { UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(10, 1)) { - UI_Font(font) ui_label(a->name_string); - UI_Font(df_font_from_slot(DF_FontSlot_Main)) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(a->kind_string); + DF_Font(ws, DF_FontSlot_Code) ui_label(a->name_string); + DF_Font(ws, DF_FontSlot_Main) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) ui_label(a->kind_string); } if(a->type_string.size != 0) { @@ -7951,7 +7942,7 @@ DF_VIEW_UI_FUNCTION_DEF(Memory) ui_set_next_fixed_width(dim_2f32(footer_rect).x); ui_set_next_fixed_height(dim_2f32(footer_rect).y); footer_box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawDropShadow, "footer"); - UI_Parent(footer_box) UI_Font(font) UI_FontSize(font_size) + UI_Parent(footer_box) DF_Font(ws, DF_FontSlot_Code) UI_FontSize(font_size) { UI_PrefWidth(ui_em(7.5f, 1.f)) UI_HeightFill UI_Column UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefHeight(ui_px(row_height_px, 0.f)) @@ -8095,7 +8086,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) { UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(entity->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", entity))) + if(ui_clicked(df_icon_buttonf(ws, entity->b32 ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, 0, "###ebl_%p", entity))) { df_entity_equip_b32(entity, !entity->b32); } @@ -8127,10 +8118,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_Clickable, "loc_%p", entity); UI_Parent(box) { - UI_Font(loc_is_code ? df_font_from_slot(DF_FontSlot_Code) : ui_top_font()) - { - ui_label(loc_string); - } + DF_Font(ws, loc_is_code ? DF_FontSlot_Code : DF_FontSlot_Main) ui_label(loc_string); } UI_Signal sig = ui_signal_from_box(box); if(ui_double_clicked(sig) || sig.f&UI_SignalFlag_KeyboardPressed) @@ -8155,7 +8143,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) UI_Parent(box) { String8 hit_count_string = str8_from_u64(scratch.arena, entity->u64, 10, 0, 0); - UI_Font(df_font_from_slot(DF_FontSlot_Code)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_string); + DF_Font(ws, DF_FontSlot_Code) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), hit_count_string); } UI_Signal sig = ui_signal_from_box(box); if(ui_pressed(sig)) @@ -8167,7 +8155,7 @@ DF_VIEW_UI_FUNCTION_DEF(Breakpoints) } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 4) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "###del_%p", entity))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "###del_%p", entity))) { df_entity_mark_for_deletion(entity); } @@ -8302,7 +8290,7 @@ DF_VIEW_UI_FUNCTION_DEF(WatchPins) } UI_TableCell UI_FocusHot((row_is_selected && cursor.x == 2) ? UI_FocusKind_On : UI_FocusKind_Off) { - if(ui_clicked(df_icon_buttonf(DF_IconKind_Trash, 0, "###del_%p", entity))) + if(ui_clicked(df_icon_buttonf(ws, DF_IconKind_Trash, 0, "###del_%p", entity))) { df_entity_mark_for_deletion(entity); } @@ -8435,7 +8423,7 @@ DF_VIEW_UI_FUNCTION_DEF(ExceptionFilters) UI_FocusHot(sv->cursor.y == row+1 ? UI_FocusKind_On : UI_FocusKind_Off) { DF_ExceptionFiltersOption *opt = &opts.v[row]; - UI_Signal sig = df_icon_buttonf(opt->is_enabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, &opt->matches, "%S", opt->name); + UI_Signal sig = df_icon_buttonf(ws, opt->is_enabled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow, &opt->matches, "%S", opt->name); if(ui_clicked(sig)) { if(opt->exception_code_kind != CTRL_ExceptionCodeKind_Null) @@ -8820,10 +8808,10 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) String8 s_string = push_str8f(scratch.arena, "%.2f", hsva.y); String8 v_string = push_str8f(scratch.arena, "%.2f", hsva.z); String8 a_string = push_str8f(scratch.arena, "%.2f", rgba.w); - UI_Row UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_Row DF_Font(ws, DF_FontSlot_Code) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8836,7 +8824,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("R"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, r_string, "###r_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8848,7 +8836,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("G"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, g_string, "###g_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8860,7 +8848,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("B"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, b_string, "###b_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8873,7 +8861,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("H"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, h_string, "###h_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8884,7 +8872,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("S"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, s_string, "###s_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8895,7 +8883,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("V"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, v_string, "###v_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -8907,7 +8895,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) UI_Row { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("A"); - UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); + UI_Signal sig = df_line_editf(ws, DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, a_string, "###a_edit"); if(ui_committed(sig)) { String8 string = str8(sv->txt_buffer, sv->txt_size); @@ -9031,8 +9019,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) if(item->icon_kind != DF_IconKind_Null) { UI_PrefWidth(ui_em(3.f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_Palette(ui_build_palette(ui_top_palette(), .text = rgba)) UI_TextAlignment(UI_TextAlign_Center) ui_label(df_g_icon_kind_text_table[item->icon_kind]); @@ -9059,8 +9046,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) { ui_spacer(ui_pct(1, 0)); UI_PrefWidth(ui_em(2.5f, 1.f)) - UI_Font(df_font_from_slot(DF_FontSlot_Icons)) - UI_TextRasterFlags(F_RasterFlag_Smooth) + DF_Font(ws, DF_FontSlot_Icons) UI_Flags(UI_BoxFlag_DrawTextWeak) ui_label(df_g_icon_kind_text_table[is_toggled ? DF_IconKind_CheckFilled : DF_IconKind_CheckHollow]); } @@ -9256,7 +9242,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) String8 s_string = push_str8f(scratch.arena, "%.2f", hsva.y); String8 v_string = push_str8f(scratch.arena, "%.2f", hsva.z); String8 a_string = push_str8f(scratch.arena, "%.2f", rgba.w); - UI_Row UI_Font(df_font_from_slot(DF_FontSlot_Code)) + UI_Row DF_Font(ws, DF_FontSlot_Code) { UI_FlagsAdd(UI_BoxFlag_DrawTextWeak) UI_PrefWidth(ui_em(4.5f, 1.f)) ui_labelf("Hex"); UI_Signal sig = df_line_editf(DF_LineEditFlag_Border, 0, 0, &sv->txt_cursor, &sv->txt_mark, sv->txt_buffer, sizeof(sv->txt_buffer), &sv->txt_size, 0, hex_string, "###hex_edit"); @@ -9368,7 +9354,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings) // rjf: preset selector UI_FocusHot((sv->cursor.y == 1 && sv->cursor.x == 0) ? UI_FocusKind_On : UI_FocusKind_Off) { - UI_Signal preset_sig = df_icon_buttonf(DF_IconKind_Palette, 0, "Apply Preset"); + UI_Signal preset_sig = df_icon_buttonf(ws, DF_IconKind_Palette, 0, "Apply Preset"); if(ui_clicked(preset_sig)) { ui_ctx_menu_open(preset_ctx_menu_key, preset_sig.box->key, v2f32(0, dim_2f32(preset_sig.box->rect).y)); diff --git a/src/raddbg/raddbg.h b/src/raddbg/raddbg.h index 8410b1da..091a52fc 100644 --- a/src/raddbg/raddbg.h +++ b/src/raddbg/raddbg.h @@ -218,6 +218,11 @@ // [ ] @cleanup naming pass over eval visualization part of the frontend, // "blocks" vs. "canvas" vs. "expansion" - etc. // [ ] @cleanup central worker thread pool - eliminate per-layer thread pools +// [ ] @cleanup in the frontend, we are starting to have to pass down "DF_Window" +// everywhere, because of per-window parameters (e.g. font rendering settings). +// this is really better solved by implicit thread-local parameters, similar to +// interaction registers, so that one window can "pick" all of the implicit +// parameters, and then 99% of the UI code does not have to care. //////////////////////////////// //~ rjf: Cold, Unsorted Notes (Deferred Until Existing Lists Mostly Exhausted)