diff --git a/src/foldhaus_app.h b/src/foldhaus_app.h index c64769b..4abf7b4 100644 --- a/src/foldhaus_app.h +++ b/src/foldhaus_app.h @@ -251,6 +251,7 @@ struct panel_definition #include "panels/foldhaus_panel_animation_timeline.h" #include "panels/foldhaus_panel_hierarchy.h" #include "panels/foldhaus_panel_node_graph.h" +#include "panels/foldhaus_panel_file_view.h" #include "generated/foldhaus_panels_generated.h" diff --git a/src/generated/foldhaus_panels_generated.h b/src/generated/foldhaus_panels_generated.h index 5d20fe0..b4fcb6c 100644 --- a/src/generated/foldhaus_panels_generated.h +++ b/src/generated/foldhaus_panels_generated.h @@ -1,5 +1,6 @@ -global_variable s32 GlobalPanelDefsCount = 6; +global_variable s32 GlobalPanelDefsCount = 7; global_variable panel_definition GlobalPanelDefs[] = { +{ "File View", 9, FileView_Init, FileView_Cleanup, FileView_Render, FileView_Commands, FileView_CommandsCount }, { "Sculpture View", 14, SculptureView_Init, SculptureView_Cleanup, SculptureView_Render, SculptureView_Commands, SculptureView_CommandsCount }, { "Animation Timeline", 18, AnimationTimeline_Init, AnimationTimeline_Cleanup, AnimationTimeline_Render, AnimationTimeline_Commands, AnimationTimeline_CommandsCount }, { "Dmx View", 8, DMXView_Init, DMXView_Cleanup, DMXView_Render, DMXView_Commands, DMXView_CommandsCount }, diff --git a/src/generated/gs_meta_generated_typeinfo.h b/src/generated/gs_meta_generated_typeinfo.h index 200686f..e5cc3e0 100644 --- a/src/generated/gs_meta_generated_typeinfo.h +++ b/src/generated/gs_meta_generated_typeinfo.h @@ -1,5 +1,6 @@ enum gsm_meta_tag_type { +MetaTag_panel_type_file_view, MetaTag_panel_type_node_graph, MetaTag_node_output, MetaTag_node_struct, @@ -16,6 +17,7 @@ MetaTag_panel_render, MetaTag_panel_type_dmx_view, }; gsm_meta_tag MetaTagStrings[] = { +{ "panel_type_file_view", 20 }, { "panel_type_node_graph", 21 }, { "node_output", 11 }, { "node_struct", 11 }, diff --git a/src/panels/foldhaus_panel_file_view.h b/src/panels/foldhaus_panel_file_view.h new file mode 100644 index 0000000..060fa6c --- /dev/null +++ b/src/panels/foldhaus_panel_file_view.h @@ -0,0 +1,56 @@ +// +// File: foldhaus_panel_file_view.h +// Author: Peter Slattery +// Creation Date: 2020-03-08 +// +#ifndef FOLDHAUS_PANEL_FILE_VIEW_H + +struct file_view_state +{ + string WorkingDirectory; +}; + +input_command* FileView_Commands = 0; +s32 FileView_CommandsCount = 0; + +GSMetaTag(panel_init); +GSMetaTag(panel_type_file_view); +internal void +FileView_Init(panel* Panel, app_state* State) +{ + // TODO: :FreePanelMemory + file_view_state* FileViewState = PushStruct(&State->Permanent, file_view_state); + FileViewState->WorkingDirectory = MakeString(PushArray(&State->Permanent, char, 256), 256); + PrintF(&FileViewState->WorkingDirectory, "C:\\"); + Panel->PanelStateMemory = (u8*)FileViewState; +} + +GSMetaTag(panel_cleanup); +GSMetaTag(panel_type_file_view); +internal void +FileView_Cleanup(panel* Panel, app_state* State) +{ + +} + +GSMetaTag(panel_render); +GSMetaTag(panel_type_file_view); +internal void +FileView_Render(panel Panel, rect PanelBounds, render_command_buffer* RenderBuffer, app_state* State, context Context, mouse_state Mouse) +{ + rect HeaderBounds = {0}; + HeaderBounds.Min = {PanelBounds.Min.x, PanelBounds.Max.y - 32}; + HeaderBounds.Max = PanelBounds.Max; + + rect ListBounds = {0}; + ListBounds.Min = PanelBounds.Min; + ListBounds.Max = BottomRight(HeaderBounds); + + PushRenderQuad2D(RenderBuffer, RectExpand(HeaderBounds), PinkV4); + PushRenderQuad2D(RenderBuffer, RectExpand(ListBounds), RedV4); +} + + + +#define FOLDHAUS_PANEL_FILE_VIEW_H +#endif // FOLDHAUS_PANEL_FILE_VIEW_H \ No newline at end of file