new method of tracking previous file locations

This commit is contained in:
Allen Webster 2016-07-02 18:59:16 -04:00
parent c245b63130
commit 67306d87bd
10 changed files with 984 additions and 570 deletions

View File

@ -92,6 +92,7 @@ Coming Soon</i><div>
<li><a href='#Buffer_Setting_ID_doc'>Buffer_Setting_ID</a></li>
<li><a href='#View_Setting_ID_doc'>View_Setting_ID</a></li>
<li><a href='#Mouse_Cursor_Show_Type_doc'>Mouse_Cursor_Show_Type</a></li>
<li><a href='#Buffer_Seek_Type_doc'>Buffer_Seek_Type</a></li>
<li><a href='#Key_Modifier_Flag_doc'>Key_Modifier_Flag</a></li>
<li><a href='#Buffer_Create_Flag_doc'>Buffer_Create_Flag</a></li>
<li><a href='#Buffer_Kill_Flag_doc'>Buffer_Kill_Flag</a></li>
@ -108,6 +109,9 @@ Coming Soon</i><div>
<li><a href='#File_Info_doc'>File_Info</a></li>
<li><a href='#File_List_doc'>File_List</a></li>
<li><a href='#Buffer_Identifier_doc'>Buffer_Identifier</a></li>
<li><a href='#GUI_Scroll_Vars_doc'>GUI_Scroll_Vars</a></li>
<li><a href='#Full_Cursor_doc'>Full_Cursor</a></li>
<li><a href='#Buffer_Seek_doc'>Buffer_Seek</a></li>
<li><a href='#Buffer_Summary_doc'>Buffer_Summary</a></li>
<li><a href='#View_Summary_doc'>View_Summary</a></li>
<li><a href='#User_Input_doc'>User_Input</a></li>
@ -1228,8 +1232,28 @@ the range [1,16].</div></div><hr>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>The MouseCursorShow_Never mode always shows the cursor.</div></div>
</div>
</div><hr>
<div id='Buffer_Seek_Type_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.13: Buffer_Seek_Type</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Buffer_Seek_Type;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Values</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_seek_pos</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_seek_wrapped_xy</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_seek_unwrapped_xy</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_seek_line_char</span></span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
</div><hr>
<div id='Key_Modifier_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.13: Key_Modifier_Flag</h4>
<h4>&sect;3.4.14: Key_Modifier_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Key_Modifier_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Key_Modifier_Flag field is used to specify a specific state of modifiers.
Flags can be combined with bit or to specify a state with multiple modifiers.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
@ -1250,7 +1274,7 @@ Flags can be combined with bit or to specify a state with multiple modifiers.</d
</div>
</div><hr>
<div id='Buffer_Create_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.14: Buffer_Create_Flag</h4>
<h4>&sect;3.4.15: Buffer_Create_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Buffer_Create_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Buffer_Create_Flag field specifies how a buffer should be created.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>BufferCreate_Background</span> = 0x1</span></div>
@ -1263,7 +1287,7 @@ Flags can be combined with bit or to specify a state with multiple modifiers.</d
</div>
</div><hr>
<div id='Buffer_Kill_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.15: Buffer_Kill_Flag</h4>
<h4>&sect;3.4.16: Buffer_Kill_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Buffer_Kill_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Buffer_Kill_Flag field specifies how a buffer should be killed.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>BufferKill_Background</span> = 0x1</span></div>
@ -1276,7 +1300,7 @@ Flags can be combined with bit or to specify a state with multiple modifiers.</d
</div>
</div><hr>
<div id='Access_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.16: Access_Flag</h4>
<h4>&sect;3.4.17: Access_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Access_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>An Access_Flag field specifies what sort of permission you grant to an
access call. An access call is usually one the returns a summary struct. If a
@ -1306,7 +1330,7 @@ that protection flag, the object is still returned from the access call.</div><d
</div>
</div><hr>
<div id='Seek_Boundary_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.17: Seek_Boundary_Flag</h4>
<h4>&sect;3.4.18: Seek_Boundary_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Seek_Boundary_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the
beginning or end of different types of words.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
@ -1327,7 +1351,7 @@ beginning or end of different types of words.</div><div style='margin-top: 3mm;
</div>
</div><hr>
<div id='Command_Line_Input_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.18: Command_Line_Input_Flag</h4>
<h4>&sect;3.4.19: Command_Line_Input_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Command_Line_Input_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Command_Line_Input_Flag field specifies the behavior of a call to a command line interface.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>CLI_OverlapWithConflict</span> = 0x1</span></div>
@ -1348,7 +1372,7 @@ beginning or end of different types of words.</div><div style='margin-top: 3mm;
</div>
</div><hr>
<div id='Auto_Indent_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.19: Auto_Indent_Flag</h4>
<h4>&sect;3.4.20: Auto_Indent_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Auto_Indent_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>An Auto_Indent_Flag field specifies the behavior of an auto indentation operation.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>AutoIndent_ClearLine</span> = 0x1</span></div>
@ -1364,7 +1388,7 @@ beginning or end of different types of words.</div><div style='margin-top: 3mm;
</div>
</div><hr>
<div id='Set_Buffer_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.20: Set_Buffer_Flag</h4>
<h4>&sect;3.4.21: Set_Buffer_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Set_Buffer_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Set_Buffer_Flag field specifies the behavior of an operation that sets the buffer of a view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>SetBuffer_KeepOriginalGUI</span> = 0x1</span></div>
@ -1374,7 +1398,7 @@ beginning or end of different types of words.</div><div style='margin-top: 3mm;
</div>
</div><hr>
<div id='Input_Type_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.21: Input_Type_Flag</h4>
<h4>&sect;3.4.22: Input_Type_Flag</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>enum Input_Type_Flag;</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>A Input_Type_Flag field specifies a set of input event types.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Flags</i></b></div><div>
<div><span style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>EventOnAnyKey</span> = 0x1</span></div>
@ -1414,7 +1438,7 @@ beginning or end of different types of words.</div><div style='margin-top: 3mm;
</div>
</div><hr>
<div id='Generic_Command_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.22: Generic_Command</h4>
<h4>&sect;3.4.23: Generic_Command</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>union Generic_Command {<br>
<div style='margin-left: 8mm;'>
Command_ID cmdid;<br>
@ -1435,7 +1459,7 @@ internal command or a custom command.</div><div style='margin-top: 3mm; margin-b
</div>
</div><hr>
<div id='Key_Event_Data_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.23: Key_Event_Data</h4>
<h4>&sect;3.4.24: Key_Event_Data</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Key_Event_Data {<br>
<div style='margin-left: 8mm;'>
Key_Code keycode;<br>
@ -1469,7 +1493,7 @@ at the time of the event.</div><div style='margin-top: 3mm; margin-bottom: 3mm;
</div>
</div><hr>
<div id='Mouse_State_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.24: Mouse_State</h4>
<h4>&sect;3.4.25: Mouse_State</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Mouse_State {<br>
<div style='margin-left: 8mm;'>
char l;<br>
@ -1529,7 +1553,7 @@ mouse if in the window.</div><div style='margin-top: 3mm; margin-bottom: 3mm; co
</div>
</div><hr>
<div id='Range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.25: Range</h4>
<h4>&sect;3.4.26: Range</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>union Range {<br>
<div style='margin-left: 8mm;'>
struct {<br>
@ -1569,7 +1593,7 @@ Throughout the API ranges are thought of in the form [min,max</div><div style='m
</div>
</div><hr>
<div id='File_Info_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.26: File_Info</h4>
<h4>&sect;3.4.27: File_Info</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct File_Info {<br>
<div style='margin-left: 8mm;'>
char * filename;<br>
@ -1592,7 +1616,7 @@ int folder;<br>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#File_List_doc'>File_List</a></div></div><hr>
<div id='File_List_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.27: File_List</h4>
<h4>&sect;3.4.28: File_List</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct File_List {<br>
<div style='margin-left: 8mm;'>
void * block;<br>
@ -1620,7 +1644,7 @@ int block_size;<br>
</div>
</div><hr>
<div id='Buffer_Identifier_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.28: Buffer_Identifier</h4>
<h4>&sect;3.4.29: Buffer_Identifier</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Buffer_Identifier {<br>
<div style='margin-left: 8mm;'>
char * name;<br>
@ -1644,8 +1668,153 @@ can either be a name or an id. If the</div><div style='margin-top: 3mm; margin-
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>This field is the id of the buffer. If name is specified this should be 0.</div></div>
</div>
</div><hr>
<div id='GUI_Scroll_Vars_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.30: GUI_Scroll_Vars</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct GUI_Scroll_Vars {<br>
<div style='margin-left: 8mm;'>
float scroll_y;<br>
int32_t target_y;<br>
int32_t prev_target_y;<br>
int32_t max_y;<br>
float scroll_x;<br>
int32_t target_x;<br>
int32_t prev_target_x;<br>
</div>
};<br>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>This struct is a part of an incomplete feature.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Fields</i></b></div><div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>scroll_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>target_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>prev_target_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>max_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>scroll_x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>target_x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>prev_target_x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>TODO</div></div>
</div>
</div><hr>
<div id='Full_Cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.31: Full_Cursor</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Full_Cursor {<br>
<div style='margin-left: 8mm;'>
int32_t pos;<br>
int32_t line;<br>
int32_t character;<br>
float unwrapped_x;<br>
float unwrapped_y;<br>
float wrapped_x;<br>
float wrapped_y;<br>
</div>
};<br>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Fields</i></b></div><div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>pos</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>line</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>character</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>unwrapped_x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>unwrapped_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>wrapped_x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>wrapped_y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
</div><hr>
<div id='Buffer_Seek_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.32: Buffer_Seek</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Buffer_Seek {<br>
<div style='margin-left: 8mm;'>
Buffer_Seek_Type type;<br>
union {<br>
<div style='margin-left: 8mm;'>
struct {<br>
<div style='margin-left: 8mm;'>
int32_t pos;<br>
</div>
};<br>
struct {<br>
<div style='margin-left: 8mm;'>
bool32 round_down;<br>
float x;<br>
float y;<br>
</div>
};<br>
struct {<br>
<div style='margin-left: 8mm;'>
int32_t line;<br>
int32_t character;<br>
</div>
};<br>
</div>
};<br>
</div>
};<br>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div><div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Fields</i></b></div><div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>type</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>pos</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>round_down</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>x</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>y</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>line</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
<div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>character</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>UNDOCUMENTED.</div></div>
</div>
</div><hr>
<div id='Buffer_Summary_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.29: Buffer_Summary</h4>
<h4>&sect;3.4.33: Buffer_Summary</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Buffer_Summary {<br>
<div style='margin-left: 8mm;'>
bool32 exists;<br>
@ -1710,7 +1879,7 @@ int32_t map_id;<br>
</div>
</div><hr>
<div id='View_Summary_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.30: View_Summary</h4>
<h4>&sect;3.4.34: View_Summary</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct View_Summary {<br>
<div style='margin-left: 8mm;'>
bool32 exists;<br>
@ -1780,7 +1949,7 @@ GUI_Scroll_Vars scroll_vars;<br>
</div>
</div><hr>
<div id='User_Input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.31: User_Input</h4>
<h4>&sect;3.4.35: User_Input</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct User_Input {<br>
<div style='margin-left: 8mm;'>
User_Input_Type_ID type;<br>
@ -1817,7 +1986,7 @@ Generic_Command command;<br>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>See Also</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#User_Input_Type_ID_doc'>User_Input_Type_ID</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#Generic_Command_doc'>Generic_Command</a></div></div><hr>
<div id='Query_Bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.32: Query_Bar</h4>
<h4>&sect;3.4.36: Query_Bar</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Query_Bar {<br>
<div style='margin-left: 8mm;'>
String prompt;<br>
@ -1836,7 +2005,7 @@ that will be displayed as a drop down bar durring an interactive command.</div><
</div>
</div><hr>
<div id='Event_Message_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.33: Event_Message</h4>
<h4>&sect;3.4.37: Event_Message</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Event_Message {<br>
<div style='margin-left: 8mm;'>
int type;<br>
@ -1849,7 +2018,7 @@ int type;<br>
</div>
</div><hr>
<div id='Theme_Color_doc' style='margin-bottom: 1cm;'>
<h4>&sect;3.4.34: Theme_Color</h4>
<h4>&sect;3.4.38: Theme_Color</h4>
<div style='font-family: "Courier New", Courier, monospace; text-align: left; margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; background: #DFDFDF; padding: 0.25em;'>struct Theme_Color {<br>
<div style='margin-left: 8mm;'>
Style_Tag tag;<br>

View File

@ -12,29 +12,6 @@
#ifndef FRED_BUFFER_TYPES_H
#define FRED_BUFFER_TYPES_H
typedef struct Full_Cursor{
int pos;
int line, character;
float unwrapped_x, unwrapped_y;
float wrapped_x, wrapped_y;
} Full_Cursor;
typedef enum Buffer_Seek_Type{
buffer_seek_pos,
buffer_seek_wrapped_xy,
buffer_seek_unwrapped_xy,
buffer_seek_line_char
} Buffer_Seek_Type;
typedef struct Buffer_Seek{
Buffer_Seek_Type type;
union{
struct { int pos; };
struct { int round_down; float x, y; };
struct { int line, character; };
};
} Buffer_Seek;
static Buffer_Seek
seek_pos(int pos){
Buffer_Seek result;

View File

@ -9,8 +9,6 @@
#include "4coder_style.h"
#include "4coder_rect.h"
#include "4coder_mem.h"
#include "4coder_buffer_types.h"
#include "4coder_gui.h"
#ifndef FRED_STRING_STRUCT
#define FRED_STRING_STRUCT
@ -51,6 +49,8 @@ enum Special_Hook_ID{
typedef CUSTOM_COMMAND_SIG(Custom_Command_Function);
#include "4coder_types.h"
#include "4coder_buffer_types.h"
#include "4coder_gui.h"
#define COMMAND_CALLER_HOOK(name) int name(struct Application_Links *app, Generic_Command cmd)
typedef COMMAND_CALLER_HOOK(Command_Caller_Hook_Function);

View File

@ -13,17 +13,6 @@ gui_id_zero(){
return(id);
}
struct GUI_Scroll_Vars{
float scroll_y;
int target_y;
int prev_target_y;
int max_y;
float scroll_x;
int target_x;
int prev_target_x;
};
typedef struct GUI GUI;
#define GUI_BEGIN_SIG(n) void n(GUI *gui)
@ -40,19 +29,17 @@ typedef struct GUI GUI;
#define GUI_FILE_SIG(n) void n(GUI *gui, int buffer_id)
extern "C"{
typedef GUI_BEGIN_SIG(GUI_Begin_Function);
typedef GUI_END_SIG(GUI_End_Function);
typedef GUI_TOP_BAR_SIG(GUI_Top_Bar_Function);
typedef GUI_GET_SCROLL_VARS_SIG(GUI_Get_Scroll_Vars_Function);
typedef GUI_BEGIN_SCROLLABLE_SIG(GUI_Begin_Scrollable_Function);
typedef GUI_END_SCROLLABLE_SIG(GUI_End_Scrollable_Function);
typedef GUI_FILE_SIG(GUI_File_Function);
}
typedef GUI_BEGIN_SIG(GUI_Begin_Function);
typedef GUI_END_SIG(GUI_End_Function);
typedef GUI_TOP_BAR_SIG(GUI_Top_Bar_Function);
typedef GUI_GET_SCROLL_VARS_SIG(GUI_Get_Scroll_Vars_Function);
typedef GUI_BEGIN_SCROLLABLE_SIG(GUI_Begin_Scrollable_Function);
typedef GUI_END_SCROLLABLE_SIG(GUI_End_Scrollable_Function);
typedef GUI_FILE_SIG(GUI_File_Function);
struct GUI_Functions{
GUI_Begin_Function *begin;

View File

@ -286,6 +286,18 @@ ENUM(int32_t, Mouse_Cursor_Show_Type){
// MouseCursorShow_WhenActive,// TODO(allen): coming soon
};
/* DOC(UNDOCUMENTED.) */
ENUM(int32_t, Buffer_Seek_Type){
/* DOC(UNDOCUMENTED.) */
buffer_seek_pos,
/* DOC(UNDOCUMENTED.) */
buffer_seek_wrapped_xy,
/* DOC(UNDOCUMENTED.) */
buffer_seek_unwrapped_xy,
/* DOC(UNDOCUMENTED.) */
buffer_seek_line_char
};
/* DOC(
Generic_Command acts as a name for a command, and can name an
internal command or a custom command.
@ -426,6 +438,69 @@ struct Buffer_Identifier{
int id;
};
/* DOC(This struct is a part of an incomplete feature.) */
struct GUI_Scroll_Vars{
/* DOC(TODO) */
float scroll_y;
/* DOC(TODO) */
int32_t target_y;
/* DOC(TODO) */
int32_t prev_target_y;
/* DOC(TODO) */
int32_t max_y;
/* DOC(TODO) */
float scroll_x;
/* DOC(TODO) */
int32_t target_x;
/* DOC(TODO) */
int32_t prev_target_x;
};
/* DOC(UNDOCUMENTED.) */
struct Full_Cursor{
/* DOC(UNDOCUMENTED.) */
int32_t pos;
/* DOC(UNDOCUMENTED.) */
int32_t line;
/* DOC(UNDOCUMENTED.) */
int32_t character;
/* DOC(UNDOCUMENTED.) */
float unwrapped_x;
/* DOC(UNDOCUMENTED.) */
float unwrapped_y;
/* DOC(UNDOCUMENTED.) */
float wrapped_x;
/* DOC(UNDOCUMENTED.) */
float wrapped_y;
};
/* DOC(UNDOCUMENTED.) */
struct Buffer_Seek{
/* DOC(UNDOCUMENTED.) */
Buffer_Seek_Type type;
union{
struct {
/* DOC(UNDOCUMENTED.) */
int32_t pos;
};
struct {
/* DOC(UNDOCUMENTED.) */
bool32 round_down;
/* DOC(UNDOCUMENTED.) */
float x;
/* DOC(UNDOCUMENTED.) */
float y;
};
struct {
/* DOC(UNDOCUMENTED.) */
int32_t line;
/* DOC(UNDOCUMENTED.) */
int32_t character;
};
};
};
/* DOC(
Buffer_Summary acts as a handle to a buffer and describes the state of the buffer.
) */
@ -467,9 +542,7 @@ struct Buffer_Summary{
int32_t map_id;
};
/* DOC(
View_Summary acts as a handle to a view and describes the state of the view.
) */
/* DOC(View_Summary acts as a handle to a view and describes the state of the view.) */
struct View_Summary{
/* DOC(
This field indicates whether the View_Summary describes a view that is open in 4coder.
@ -563,4 +636,3 @@ struct Theme_Color{
int_color color;
};

91
4ed.cpp
View File

@ -318,34 +318,31 @@ COMMAND_DECL(center_view){
REQ_READABLE_VIEW(view);
REQ_FILE(file, view);
f32 y = 0, h = 0;
Assert(view->edit_pos);
f32 h = view_file_height(view);
f32 y = view->edit_pos->cursor.wrapped_y;
if (view->file_data.unwrapped_lines){
y = view->edit_poss.cursor.unwrapped_y;
}
else{
y = view->edit_poss.cursor.wrapped_y;
y = view->edit_pos->cursor.unwrapped_y;
}
h = view_file_height(view);
y = clamp_bottom(0.f, y - h*.5f);
view->edit_poss.scroll.target_y = ROUND32(y);
view->edit_pos->scroll.target_y = ROUND32(y);
}
COMMAND_DECL(left_adjust_view){
REQ_READABLE_VIEW(view);
REQ_FILE(file, view);
f32 x = 0;
Assert(view->edit_pos);
f32 x = view->edit_pos->cursor.wrapped_x;
if (view->file_data.unwrapped_lines){
x = view->edit_poss.cursor.unwrapped_x;
}
else{
x = view->edit_poss.cursor.wrapped_x;
x = view->edit_pos->cursor.unwrapped_x;
}
x = clamp_bottom(0.f, x - 30.f);
view->edit_poss.scroll.target_x = ROUND32(x);
view->edit_pos->scroll.target_x = ROUND32(x);
}
COMMAND_DECL(word_complete){
@ -354,6 +351,8 @@ COMMAND_DECL(word_complete){
REQ_OPEN_VIEW(view);
REQ_FILE(file, view);
Assert(view->edit_pos);
Partition *part = &models->mem.part;
General_Memory *general = &models->mem.general;
Working_Set *working_set = &models->working_set;
@ -381,7 +380,7 @@ COMMAND_DECL(word_complete){
}
if (do_init){
word_end = view->edit_poss.cursor.pos;
word_end = view->edit_pos->cursor.pos;
word_start = word_end;
cursor_pos = word_end - 1;
@ -642,18 +641,20 @@ COMMAND_DECL(toggle_line_wrap){
REQ_READABLE_VIEW(view);
REQ_FILE(file, view);
Assert(view->edit_pos);
// TODO(allen): WHAT TO DO HERE???
Relative_Scrolling scrolling = view_get_relative_scrolling(view);
if (view->file_data.unwrapped_lines){
view->file_data.unwrapped_lines = 0;
file->settings.unwrapped_lines = 0;
view->edit_poss.scroll.target_x = 0;
view_cursor_move(view, view->edit_poss.cursor.pos);
view->edit_pos->scroll.target_x = 0;
view_cursor_move(view, view->edit_pos->cursor.pos);
}
else{
view->file_data.unwrapped_lines = 1;
file->settings.unwrapped_lines = 1;
view_cursor_move(view, view->edit_poss.cursor.pos);
view_cursor_move(view, view->edit_pos->cursor.pos);
}
view_set_relative_scrolling(view, scrolling);
}
@ -683,7 +684,7 @@ case_change_range(System_Functions *system,
Mem_Options *mem, View *view, Editing_File *file,
u8 a, u8 z, u8 char_delta){
#if BUFFER_EXPERIMENT_SCALPEL <= 0
Range range = make_range(view->edit_poss.cursor.pos, view->edit_poss.mark);
Range range = make_range(view->edit_pos->cursor.pos, view->edit_pos->mark);
if (range.start < range.end){
Edit_Step step = {};
step.type = ED_NORMAL;
@ -893,25 +894,27 @@ COMMAND_DECL(close_panel){
COMMAND_DECL(page_down){
REQ_READABLE_VIEW(view);
Assert(view->edit_pos);
i32 height = CEIL32(view_file_height(view));
f32 y = view_get_cursor_y(view);
f32 x = view->edit_poss.preferred_x;
f32 x = view->edit_pos->preferred_x;
Full_Cursor cursor =
view_compute_cursor_from_xy(view, x, y+height);
edit_pos_set_cursor(&view->edit_poss, cursor, false, view->file_data.unwrapped_lines);
Full_Cursor cursor = view_compute_cursor_from_xy(view, x, y+height);
view_set_cursor(view, cursor, false, view->file_data.unwrapped_lines);
}
COMMAND_DECL(page_up){
REQ_READABLE_VIEW(view);
Assert(view->edit_pos);
i32 height = CEIL32(view_file_height(view));
f32 y = view_get_cursor_y(view);
f32 x = view->edit_poss.preferred_x;
f32 x = view->edit_pos->preferred_x;
Full_Cursor cursor =
view_compute_cursor_from_xy(view, x, y-height);
edit_pos_set_cursor(&view->edit_poss, cursor, false, view->file_data.unwrapped_lines);
Full_Cursor cursor = view_compute_cursor_from_xy(view, x, y-height);
view_set_cursor(view, cursor, false, view->file_data.unwrapped_lines);
}
COMMAND_DECL(open_color_tweaker){
@ -1124,7 +1127,7 @@ app_hardcode_styles(Models *models){
file_info_style.bar_color = 0xFF888888;
file_info_style.bar_active_color = 0xFF666666;
file_info_style.base_color = 0xFF000000;
file_info_style.pop1_color = 0xFF1050F0;
file_info_style.pop1_color = 0xFF3C57DC;
file_info_style.pop2_color = 0xFFFF0000;
style->main.file_info_style = file_info_style;
++style;
@ -2533,9 +2536,17 @@ App_Step_Sig(app_step){
summary.mouse = mouse_state;
}
GUI_Scroll_Vars *scroll_vars = &view->edit_poss.scroll;
if (view->showing_ui != VUI_None){
scroll_vars = &view->gui_scroll;
b32 file_scroll = false;
GUI_Scroll_Vars scroll_zero = {0};
GUI_Scroll_Vars *scroll_vars = &view->gui_scroll;
if (view->showing_ui == VUI_None){
if (view->file_data.file){
scroll_vars = &view->edit_pos->scroll;
file_scroll = true;
}
else{
scroll_vars = &scroll_zero;
}
}
Input_Process_Result ip_result =
@ -2554,8 +2565,8 @@ App_Step_Sig(app_step){
}
if (!gui_scroll_eq(scroll_vars, &ip_result.vars)){
if (scroll_vars == &view->edit_poss.scroll){
edit_pos_set_scroll(&view->edit_poss, ip_result.vars);
if (file_scroll){
view_set_scroll(view, ip_result.vars);
}
else{
*scroll_vars = ip_result.vars;
@ -2927,9 +2938,17 @@ App_Step_Sig(app_step){
draw_push_clip(target, panel->inner);
GUI_Scroll_Vars *scroll_vars = &view->edit_poss.scroll;
if (view->showing_ui != VUI_None){
scroll_vars = &view->gui_scroll;
b32 file_scroll = false;
GUI_Scroll_Vars scroll_zero = {0};
GUI_Scroll_Vars *scroll_vars = &view->gui_scroll;
if (view->showing_ui == VUI_None){
if (view->file_data.file){
scroll_vars = &view->edit_pos->scroll;
file_scroll = true;
}
else{
scroll_vars = &scroll_zero;
}
}
do_render_file_view(system, view, scroll_vars, cmd->view,

View File

@ -66,12 +66,12 @@ fill_view_summary(View_Summary *view, View *vptr, Live_Views *live_set, Working_
view->buffer_id = buffer_id;
view->mark = view_compute_cursor_from_pos(vptr, vptr->edit_poss.mark);
view->cursor = vptr->edit_poss.cursor;
view->preferred_x = vptr->edit_poss.preferred_x;
view->mark = view_compute_cursor_from_pos(vptr, vptr->edit_pos->mark);
view->cursor = vptr->edit_pos->cursor;
view->preferred_x = vptr->edit_pos->preferred_x;
view->file_region = vptr->file_region;
view->scroll_vars = vptr->edit_poss.scroll;
view->scroll_vars = vptr->edit_pos->scroll;
}
}
}
@ -1236,8 +1236,8 @@ DOC_SEE(Buffer_Seek)
seek.character = 1;
}
Full_Cursor cursor = view_compute_cursor(vptr, seek);
edit_pos_set_cursor(&vptr->edit_poss, cursor,
set_preferred_x, vptr->file_data.unwrapped_lines);
view_set_cursor(vptr, cursor,
set_preferred_x, vptr->file_data.unwrapped_lines);
fill_view_summary(view, vptr, cmd);
}
}
@ -1255,19 +1255,23 @@ DOC_SEE(Buffer_Seek)
*/{
Command_Data *cmd = (Command_Data*)app->cmd_context;
View *vptr = imp_get_view(cmd, view);
Editing_File *file = 0;
Full_Cursor cursor = {0};
bool32 result = false;
if (vptr){
result = true;
if (seek.type != buffer_seek_pos){
cursor = view_compute_cursor(vptr, seek);
vptr->edit_poss.mark = cursor.pos;
file = vptr->file_data.file;
if (file && !file->is_loading){
result = true;
if (seek.type != buffer_seek_pos){
cursor = view_compute_cursor(vptr, seek);
vptr->edit_pos->mark = cursor.pos;
}
else{
vptr->edit_pos->mark = seek.pos;
}
fill_view_summary(view, vptr, cmd);
}
else{
vptr->edit_poss.mark = seek.pos;
}
fill_view_summary(view, vptr, cmd);
}
return(result);

View File

@ -27,6 +27,26 @@
#include "buffer/4coder_buffer_abstract.cpp"
enum Edit_Pos_Set_Type{
EditPos_None,
EditPos_CursorSet,
EditPos_ScrollSet
};
struct File_Edit_Positions{
GUI_Scroll_Vars scroll;
Full_Cursor cursor;
i32 mark;
f32 preferred_x;
i32 scroll_i;
i32 last_set_type;
b32 in_view;
};
inline File_Edit_Positions
file_edit_positions_zero(){
File_Edit_Positions data = {0};
return(data);
}
enum Edit_Type{
ED_NORMAL,
ED_REVERSE_NORMAL,
@ -126,6 +146,10 @@ struct Editing_File_State{
u64 last_4ed_write_time;
u64 last_4ed_edit_time;
u64 last_sys_write_time;
File_Edit_Positions edit_pos_space[16];
File_Edit_Positions *edit_poss[16];
i32 edit_poss_count;
};
struct Editing_File_Name{
@ -230,6 +254,133 @@ tbl_file_compare(void *a, void *b, void *arg){
return(result);
}
//
// File_Edit_Positions stuff
//
internal void
edit_pos_set_cursor_(File_Edit_Positions *edit_pos,
Full_Cursor cursor,
b32 set_preferred_x,
b32 unwrapped_lines){
edit_pos->cursor = cursor;
if (set_preferred_x){
edit_pos->preferred_x = cursor.wrapped_x;
if (unwrapped_lines){
edit_pos->preferred_x = cursor.unwrapped_x;
}
}
edit_pos->last_set_type = EditPos_CursorSet;
}
internal void
edit_pos_set_scroll_(File_Edit_Positions *edit_pos, GUI_Scroll_Vars scroll){
edit_pos->scroll = scroll;
edit_pos->last_set_type = EditPos_ScrollSet;
}
internal i32
edit_pos_get_index(Editing_File *file, File_Edit_Positions *edit_pos){
i32 edit_pos_index = -1;
i32 count = file->state.edit_poss_count;
File_Edit_Positions **edit_poss = file->state.edit_poss;
for (i32 i = 0; i < count; ++i){
if (edit_poss[i] == edit_pos){
edit_pos_index = i;
break;
}
}
return(edit_pos_index);
}
internal b32
edit_pos_move_to_front(Editing_File *file, File_Edit_Positions *edit_pos){
b32 result = false;
if (file && edit_pos){
i32 edit_pos_index = edit_pos_get_index(file, edit_pos);
Assert(edit_pos_index != -1);
File_Edit_Positions **edit_poss = file->state.edit_poss;
memmove(edit_poss + 1, edit_poss, edit_pos_index*sizeof(*edit_poss));
edit_poss[0] = edit_pos;
result = true;
}
return(result);
}
internal b32
edit_pos_unset(Editing_File *file, File_Edit_Positions *edit_pos){
b32 result = false;
if (file && edit_pos){
i32 edit_pos_index = edit_pos_get_index(file, edit_pos);
Assert(edit_pos_index != -1);
i32 count = file->state.edit_poss_count;
File_Edit_Positions **edit_poss = file->state.edit_poss;
memmove(edit_poss + edit_pos_index,
edit_poss + edit_pos_index + 1,
(count - edit_pos_index - 1)*sizeof(*edit_poss));
edit_pos->in_view = false;
if (file->state.edit_poss_count > 1){
file->state.edit_poss_count -= 1;
}
result = true;
}
return(result);
}
internal File_Edit_Positions*
edit_pos_get_new(Editing_File *file, i32 index){
File_Edit_Positions *result = 0;
if (file && 0 <= index && index < 16){
result = file->state.edit_pos_space + index;
i32 edit_pos_index = edit_pos_get_index(file, result);
if (edit_pos_index == -1){
File_Edit_Positions **edit_poss = file->state.edit_poss;
i32 count = file->state.edit_poss_count;
if (count > 0){
if (edit_poss[0]->in_view){
memcpy(result, edit_poss[0], sizeof(*result));
memmove(edit_poss+1, edit_poss, sizeof(*edit_poss)*count);
file->state.edit_poss_count = count + 1;
}
else{
Assert(count == 1);
memcpy(result, edit_poss[0], sizeof(*result));
}
}
else{
memset(result, 0, sizeof(*result));
file->state.edit_poss_count = 1;
}
edit_poss[0] = result;
}
result->in_view = true;
}
return(result);
}
//
// Working_Set stuff
//
internal void
working_set_extend_memory(Working_Set *working_set, Editing_File *new_space, i16 number_of_files){
Buffer_Slot_ID id;
@ -625,5 +776,7 @@ file_set_to_loading(Editing_File *file){
file->is_loading = 1;
}
// BOTTOM

File diff suppressed because it is too large Load Diff

View File

@ -653,6 +653,7 @@ gui_scroll_eq(GUI_Scroll_Vars *a, GUI_Scroll_Vars *b){
return(result);
}
#if 0
// TODO(allen): Rethink this a little, seems like there are two separate things we want to do here:
// Getting the updated scroll vars, and telling the user when scrolling actions occur.
internal b32
@ -668,6 +669,21 @@ gui_get_scroll_vars(GUI_Target *target, GUI_id scroll_context_id, i32_Rect *regi
}
return(result);
}
#endif
internal b32
gui_scroll_was_activated(GUI_Target *target, GUI_id scroll_context_id){
b32 result = false;
if (gui_id_eq(scroll_context_id, target->scroll_id)){
if (gui_id_eq(target->active, gui_id_scrollbar())){
result = true;
target->animating = true;
}
}
return(result);
}
internal void
gui_post_scroll_vars(GUI_Target *target, GUI_Scroll_Vars *vars_in, i32_Rect region_in){