switched over to new 4coder_types.h, wrote docs

master
Allen Webster 2016-07-01 01:42:19 -04:00
parent 4023b96560
commit 982ce836af
15 changed files with 1841 additions and 512 deletions

View File

@ -4,6 +4,7 @@
<style>
body { background: #FAFAFA; color: #0D0D0D; }
h1,h2,h3,h4 { color: #309030; margin: 0; }
h3 { margin-top: 5mm; margin-bottom: 5mm; }
h4 { font-size: 1.1em; }
a { color: #309030; text-decoration: none; }
a:visited { color: #A0C050; }
@ -26,151 +27,89 @@ This is the documentation for alpha 4.0.9 super! The documentation has been made
<h2>&sect;2 Types and Functions</h2>
<h3>&sect;2.1 Function List</h3>
<ul>
<li>
<a href='#exec_command_doc'>exec_command</a>
</li>
<li>
<a href='#exec_system_command_doc'>exec_system_command</a>
</li>
<li>
<a href='#clipboard_post_doc'>clipboard_post</a>
</li>
<li>
<a href='#clipboard_count_doc'>clipboard_count</a>
</li>
<li>
<a href='#clipboard_index_doc'>clipboard_index</a>
</li>
<li>
<a href='#get_buffer_first_doc'>get_buffer_first</a>
</li>
<li>
<a href='#get_buffer_next_doc'>get_buffer_next</a>
</li>
<li>
<a href='#get_buffer_doc'>get_buffer</a>
</li>
<li>
<a href='#get_buffer_by_name_doc'>get_buffer_by_name</a>
</li>
<li>
<a href='#buffer_boundary_seek_doc'>buffer_boundary_seek</a>
</li>
<li>
<a href='#buffer_read_range_doc'>buffer_read_range</a>
</li>
<li>
<a href='#buffer_replace_range_doc'>buffer_replace_range</a>
</li>
<li>
<a href='#buffer_set_setting_doc'>buffer_set_setting</a>
</li>
<li>
<a href='#buffer_auto_indent_doc'>buffer_auto_indent</a>
</li>
<li>
<a href='#create_buffer_doc'>create_buffer</a>
</li>
<li>
<a href='#save_buffer_doc'>save_buffer</a>
</li>
<li>
<a href='#kill_buffer_doc'>kill_buffer</a>
</li>
<li>
<a href='#get_view_first_doc'>get_view_first</a>
</li>
<li>
<a href='#get_view_next_doc'>get_view_next</a>
</li>
<li>
<a href='#get_view_doc'>get_view</a>
</li>
<li>
<a href='#get_active_view_doc'>get_active_view</a>
</li>
<li>
<a href='#set_active_view_doc'>set_active_view</a>
</li>
<li>
<a href='#view_set_setting_doc'>view_set_setting</a>
</li>
<li>
<a href='#view_set_split_proportion_doc'>view_set_split_proportion</a>
</li>
<li>
<a href='#view_compute_cursor_doc'>view_compute_cursor</a>
</li>
<li>
<a href='#view_set_cursor_doc'>view_set_cursor</a>
</li>
<li>
<a href='#view_set_mark_doc'>view_set_mark</a>
</li>
<li>
<a href='#view_set_highlight_doc'>view_set_highlight</a>
</li>
<li>
<a href='#view_set_buffer_doc'>view_set_buffer</a>
</li>
<li>
<a href='#view_post_fade_doc'>view_post_fade</a>
</li>
<li>
<a href='#get_user_input_doc'>get_user_input</a>
</li>
<li>
<a href='#get_command_input_doc'>get_command_input</a>
</li>
<li>
<a href='#get_mouse_state_doc'>get_mouse_state</a>
</li>
<li>
<a href='#start_query_bar_doc'>start_query_bar</a>
</li>
<li>
<a href='#end_query_bar_doc'>end_query_bar</a>
</li>
<li>
<a href='#print_message_doc'>print_message</a>
</li>
<li>
<a href='#change_theme_doc'>change_theme</a>
</li>
<li>
<a href='#change_font_doc'>change_font</a>
</li>
<li>
<a href='#set_theme_colors_doc'>set_theme_colors</a>
</li>
<li>
<a href='#get_theme_colors_doc'>get_theme_colors</a>
</li>
<li>
<a href='#directory_get_hot_doc'>directory_get_hot</a>
</li>
<li>
<a href='#get_file_list_doc'>get_file_list</a>
</li>
<li>
<a href='#free_file_list_doc'>free_file_list</a>
</li>
<li>
<a href='#file_exists_doc'>file_exists</a>
</li>
<li>
<a href='#directory_cd_doc'>directory_cd</a>
</li>
<li>
<a href='#get_4ed_path_doc'>get_4ed_path</a>
</li>
<li>
<a href='#show_mouse_cursor_doc'>show_mouse_cursor</a>
</li>
<li><a href='#exec_command_doc'>exec_command</a></li>
<li><a href='#exec_system_command_doc'>exec_system_command</a></li>
<li><a href='#clipboard_post_doc'>clipboard_post</a></li>
<li><a href='#clipboard_count_doc'>clipboard_count</a></li>
<li><a href='#clipboard_index_doc'>clipboard_index</a></li>
<li><a href='#get_buffer_first_doc'>get_buffer_first</a></li>
<li><a href='#get_buffer_next_doc'>get_buffer_next</a></li>
<li><a href='#get_buffer_doc'>get_buffer</a></li>
<li><a href='#get_buffer_by_name_doc'>get_buffer_by_name</a></li>
<li><a href='#buffer_boundary_seek_doc'>buffer_boundary_seek</a></li>
<li><a href='#buffer_read_range_doc'>buffer_read_range</a></li>
<li><a href='#buffer_replace_range_doc'>buffer_replace_range</a></li>
<li><a href='#buffer_set_setting_doc'>buffer_set_setting</a></li>
<li><a href='#buffer_auto_indent_doc'>buffer_auto_indent</a></li>
<li><a href='#create_buffer_doc'>create_buffer</a></li>
<li><a href='#save_buffer_doc'>save_buffer</a></li>
<li><a href='#kill_buffer_doc'>kill_buffer</a></li>
<li><a href='#get_view_first_doc'>get_view_first</a></li>
<li><a href='#get_view_next_doc'>get_view_next</a></li>
<li><a href='#get_view_doc'>get_view</a></li>
<li><a href='#get_active_view_doc'>get_active_view</a></li>
<li><a href='#set_active_view_doc'>set_active_view</a></li>
<li><a href='#view_set_setting_doc'>view_set_setting</a></li>
<li><a href='#view_set_split_proportion_doc'>view_set_split_proportion</a></li>
<li><a href='#view_compute_cursor_doc'>view_compute_cursor</a></li>
<li><a href='#view_set_cursor_doc'>view_set_cursor</a></li>
<li><a href='#view_set_mark_doc'>view_set_mark</a></li>
<li><a href='#view_set_highlight_doc'>view_set_highlight</a></li>
<li><a href='#view_set_buffer_doc'>view_set_buffer</a></li>
<li><a href='#view_post_fade_doc'>view_post_fade</a></li>
<li><a href='#get_user_input_doc'>get_user_input</a></li>
<li><a href='#get_command_input_doc'>get_command_input</a></li>
<li><a href='#get_mouse_state_doc'>get_mouse_state</a></li>
<li><a href='#start_query_bar_doc'>start_query_bar</a></li>
<li><a href='#end_query_bar_doc'>end_query_bar</a></li>
<li><a href='#print_message_doc'>print_message</a></li>
<li><a href='#change_theme_doc'>change_theme</a></li>
<li><a href='#change_font_doc'>change_font</a></li>
<li><a href='#set_theme_colors_doc'>set_theme_colors</a></li>
<li><a href='#get_theme_colors_doc'>get_theme_colors</a></li>
<li><a href='#directory_get_hot_doc'>directory_get_hot</a></li>
<li><a href='#get_file_list_doc'>get_file_list</a></li>
<li><a href='#free_file_list_doc'>free_file_list</a></li>
<li><a href='#file_exists_doc'>file_exists</a></li>
<li><a href='#directory_cd_doc'>directory_cd</a></li>
<li><a href='#get_4ed_path_doc'>get_4ed_path</a></li>
<li><a href='#show_mouse_cursor_doc'>show_mouse_cursor</a></li>
</ul>
<h3 style='margin-top: 5mm; margin-bottom: 5mm;'>&sect;2.2 Descriptions</h3>
<h3>&sect;2.2 Type List</h3>
<ul>
<li><a href='#Key_Code_doc'>Key_Code</a></li>
<li><a href='#Key_Modifier_doc'>Key_Modifier</a></li>
<li><a href='#Command_ID_doc'>Command_ID</a></li>
<li><a href='#User_Input_Type_ID_doc'>User_Input_Type_ID</a></li>
<li><a href='#Event_Message_Type_ID_doc'>Event_Message_Type_ID</a></li>
<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='#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>
<li><a href='#Access_Flag_doc'>Access_Flag</a></li>
<li><a href='#Seek_Boundary_Flag_doc'>Seek_Boundary_Flag</a></li>
<li><a href='#Command_Line_Input_Flag_doc'>Command_Line_Input_Flag</a></li>
<li><a href='#Auto_Indent_Flag_doc'>Auto_Indent_Flag</a></li>
<li><a href='#Set_Buffer_Flag_doc'>Set_Buffer_Flag</a></li>
<li><a href='#Input_Type_Flag_doc'>Input_Type_Flag</a></li>
<li><a href='#Key_Event_Data_doc'>Key_Event_Data</a></li>
<li><a href='#Mouse_State_doc'>Mouse_State</a></li>
<li><a href='#Range_doc'>Range</a></li>
<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='#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>
<li><a href='#Query_Bar_doc'>Query_Bar</a></li>
<li><a href='#Event_Message_doc'>Event_Message</a></li>
<li><a href='#Theme_Color_doc'>Theme_Color</a></li>
</ul>
<h3>&sect;2.3 Function Descriptions</h3>
<div id='exec_command_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.0: exec_command</h4>
<h4>&sect;2.3.1: exec_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;'>void app->exec_command(
<div style='margin-left: 4mm;'>Application_Links *app,<br>uint64_t command_id<br></div>)
</div>
@ -180,7 +119,7 @@ This is the documentation for alpha 4.0.9 super! The documentation has been made
</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;'>Executes the command associated with the command_id passed in</div></div><hr>
<div id='exec_system_command_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.1: exec_system_command</h4>
<h4>&sect;2.3.2: exec_system_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;'>int app->exec_system_command(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Identifier buffer,<br>char *path,<br>int path_len,<br>char *command,<br>int command_len,<br>unsigned int flags<br></div>)
</div>
@ -229,7 +168,7 @@ begin displaying the output buffer, even if another open view already displays t
If CLI_CursorAtEnd is set the cursor in the output buffer will be placed at the end of the buffer instead
of at the beginning.</div></div><hr>
<div id='clipboard_post_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.2: clipboard_post</h4>
<h4>&sect;2.3.3: clipboard_post</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;'>void app->clipboard_post(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *str,<br>int len<br></div>)
</div>
@ -245,13 +184,13 @@ of at the beginning.</div></div><hr>
Also reports the copy to the operating system, so that it may
be pasted into other applications.</div></div><hr>
<div id='clipboard_count_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.3: clipboard_count</h4>
<h4>&sect;2.3.4: clipboard_count</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;'>int app->clipboard_count(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</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;'>returns the number of items in the clipboard</div></div><hr>
<div id='clipboard_index_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.4: clipboard_index</h4>
<h4>&sect;2.3.5: clipboard_index</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;'>int app->clipboard_index(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int index,<br>char *out,<br>int len<br></div>)
</div>
@ -275,7 +214,7 @@ even if the output buffer is NULL. If the output buffer is too small to contain
string, it is filled with the first len character of the clipboard contents. The output
string is not null terminated.</div></div><hr>
<div id='get_buffer_first_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.5: get_buffer_first</h4>
<h4>&sect;2.3.6: get_buffer_first</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;'>Buffer_Summary app->get_buffer_first(
<div style='margin-left: 4mm;'>Application_Links *app,<br>unsigned int access<br></div>)
</div>
@ -288,7 +227,7 @@ string is not null terminated.</div></div><hr>
If the buffer returned does not exist, the loop is finished. Buffers
should not be killed durring a buffer loop.</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='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_buffer_next_doc'>get_buffer_next</a></div></div><hr>
<div id='get_buffer_next_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.6: get_buffer_next</h4>
<h4>&sect;2.3.7: get_buffer_next</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;'>void app->get_buffer_next(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>unsigned int access<br></div>)
</div>
@ -307,7 +246,7 @@ access flags.
If the buffer returned does not exist, the loop is finished. Buffers
should not be killed durring a buffer loop.</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='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_buffer_first_doc'>get_buffer_first</a></div></div><hr>
<div id='get_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.7: get_buffer</h4>
<h4>&sect;2.3.8: get_buffer</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;'>Buffer_Summary app->get_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int buffer_id,<br>unsigned int access<br></div>)
</div>
@ -321,7 +260,7 @@ should not be killed durring a buffer loop.</div><div style='margin-top: 3mm; ma
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns a summary that describes the indicated buffer if it exists and is accessible</div></div><hr>
<div id='get_buffer_by_name_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.8: get_buffer_by_name</h4>
<h4>&sect;2.3.9: get_buffer_by_name</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;'>Buffer_Summary app->get_buffer_by_name(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int len,<br>unsigned int access<br></div>)
</div>
@ -339,7 +278,7 @@ should not be killed durring a buffer loop.</div><div style='margin-top: 3mm; ma
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns a summary that describes the indicated buffer if it exists and is accessible</div></div><hr>
<div id='buffer_boundary_seek_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.9: buffer_boundary_seek</h4>
<h4>&sect;2.3.10: buffer_boundary_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;'>int app->buffer_boundary_seek(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int start_pos,<br>int seek_forward,<br>unsigned int flags<br></div>)
</div>
@ -361,7 +300,7 @@ should not be killed durring a buffer loop.</div><div style='margin-top: 3mm; ma
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns the position where the seek stops</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='#Seek_Boundary_Flag_doc'>Seek_Boundary_Flag</a></div></div><hr>
<div id='buffer_read_range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.10: buffer_read_range</h4>
<h4>&sect;2.3.11: buffer_read_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;'>int app->buffer_read_range(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int start,<br>int end,<br>char *out<br></div>)
</div>
@ -387,7 +326,7 @@ The output is not null terminated.
This call fails if the buffer does not exist, or if the read range
is not within the bounds of the buffer.</div></div><hr>
<div id='buffer_replace_range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.11: buffer_replace_range</h4>
<h4>&sect;2.3.12: buffer_replace_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;'>int app->buffer_replace_range(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int start,<br>int end,<br>char *str,<br>int len<br></div>)
</div>
@ -420,7 +359,7 @@ from start to end.
This call fails if the buffer does not exist, or if the replace
range is not within the bounds of the buffer.</div></div><hr>
<div id='buffer_set_setting_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.12: buffer_set_setting</h4>
<h4>&sect;2.3.13: buffer_set_setting</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;'>int app->buffer_set_setting(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int setting,<br>int value<br></div>)
</div>
@ -438,7 +377,7 @@ range is not within the bounds of the buffer.</div></div><hr>
</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='#Buffer_Setting_ID_doc'>Buffer_Setting_ID</a></div></div><hr>
<div id='buffer_auto_indent_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.13: buffer_auto_indent</h4>
<h4>&sect;2.3.14: buffer_auto_indent</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;'>int app->buffer_auto_indent(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>int start,<br>int end,<br>int tab_width,<br>unsigned int flags<br></div>)
</div>
@ -467,7 +406,7 @@ start to end by inserting spaces or tabs at the beginning of the lines.
If the buffer does not have lexing enabled or the lexing job has not
completed this function will fail.</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='#Auto_Indent_Flag_doc'>Auto_Indent_Flag</a></div></div><hr>
<div id='create_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.14: create_buffer</h4>
<h4>&sect;2.3.15: create_buffer</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;'>Buffer_Summary app->create_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *filename,<br>int filename_len,<br>unsigned int flags<br></div>)
</div>
@ -489,7 +428,7 @@ If the buffer does not exist a new buffer is created and named after the given f
the filename corresponds to a file on the disk that file is loaded and put into buffer, if
the filename does not correspond to a file on disk the buffer is created empty.</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='#Buffer_Create_Flag_doc'>Buffer_Create_Flag</a></div></div><hr>
<div id='save_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.15: save_buffer</h4>
<h4>&sect;2.3.16: save_buffer</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;'>int app->save_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Summary *buffer,<br>char *filename,<br>int filename_len,<br>unsigned int flags<br></div>)
</div>
@ -511,27 +450,27 @@ the filename does not correspond to a file on disk the buffer is created empty.<
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero if the save succeeds</div></div><hr>
<div id='kill_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.16: kill_buffer</h4>
<h4>&sect;2.3.17: kill_buffer</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;'>int app->kill_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Buffer_Identifier buffer,<br>int view_id,<br>unsigned int flags<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Parameters</i></b></div><div>
<div style='font-weight: 600;'>buffer</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>a buffer identifier specifying the buffer to try to kill</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>A buffer identifier specifying the buffer to try to kill.</div></div>
</div>
<div>
<div style='font-weight: 600;'>view_id</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>the id of view that will contain the "are you sure" dialogue</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>The id of view that will contain the "are you sure" dialogue.</div></div>
</div>
<div>
<div style='font-weight: 600;'>flags</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>flags for buffer kill behavior</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>Flags for buffer kill behavior.</div></div>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero if the kill succeeds</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;'>Tries to kill the idenfied buffer. If the buffer is dirty and the "are you sure"
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Returns non-zero if the kill succeeds.</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;'>Tries to kill the idenfied buffer. If the buffer is dirty and the "are you sure"
dialogue needs to be displayed the provided view is used to show the dialogue.
If the view is not open the kill fails.</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='#Buffer_Kill_Flags_doc'>Buffer_Kill_Flags</a></div></div><hr>
<div id='get_view_first_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.17: get_view_first</h4>
<h4>&sect;2.3.18: get_view_first</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;'>View_Summary app->get_view_first(
<div style='margin-left: 4mm;'>Application_Links *app,<br>unsigned int access<br></div>)
</div>
@ -544,7 +483,7 @@ If the view is not open the kill fails.</div><div style='margin-top: 3mm; margin
If the view summary returned is NULL, the loop is finished.
Views should not be closed or opened durring a view loop.</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='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_view_next_doc'>get_view_next</a></div></div><hr>
<div id='get_view_next_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.18: get_view_next</h4>
<h4>&sect;2.3.19: get_view_next</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;'>void app->get_view_next(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>unsigned int access<br></div>)
</div>
@ -563,7 +502,7 @@ access flags.
If the view summary returned is NULL, the loop is finished.
Views should not be closed or opened durring a view loop.</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='#Access_Flag_doc'>Access_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#get_view_first_doc'>get_view_first</a></div></div><hr>
<div id='get_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.19: get_view</h4>
<h4>&sect;2.3.20: get_view</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;'>View_Summary app->get_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int view_id,<br>unsigned int access<br></div>)
</div>
@ -577,7 +516,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns a summary that describes the indicated view if it is open and is accessible</div></div><hr>
<div id='get_active_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.20: get_active_view</h4>
<h4>&sect;2.3.21: get_active_view</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;'>View_Summary app->get_active_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>unsigned int access<br></div>)
</div>
@ -587,7 +526,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns a summary that describes the active view</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='#set_active_view_doc'>set_active_view</a></div></div><hr>
<div id='set_active_view_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.21: set_active_view</h4>
<h4>&sect;2.3.22: set_active_view</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;'>int app->set_active_view(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view<br></div>)
</div>
@ -599,7 +538,7 @@ Views should not be closed or opened durring a view loop.</div><div style='margi
active view, and takes subsequent commands and is returned
from get_active_view.</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='#get_active_view_doc'>get_active_view</a></div></div><hr>
<div id='view_set_setting_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.22: view_set_setting</h4>
<h4>&sect;2.3.23: view_set_setting</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;'>int app->view_set_setting(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>int setting,<br>int value<br></div>)
</div>
@ -617,7 +556,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</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='#View_Setting_ID_doc'>View_Setting_ID</a></div></div><hr>
<div id='view_set_split_proportion_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.23: view_set_split_proportion</h4>
<h4>&sect;2.3.24: view_set_split_proportion</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;'>int app->view_set_split_proportion(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>float t<br></div>)
</div>
@ -631,7 +570,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Returns non-zero on success.</div></div><hr>
<div id='view_compute_cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.24: view_compute_cursor</h4>
<h4>&sect;2.3.25: view_compute_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;'>int app->view_compute_cursor(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek,<br>Full_Cursor *cursor_out<br></div>)
</div>
@ -649,7 +588,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Returns non-zero on success.</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;'>Computes a full cursor for the given seek position.</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='#Buffer_Seek_doc'>Buffer_Seek</a></div></div><hr>
<div id='view_set_cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.25: view_set_cursor</h4>
<h4>&sect;2.3.26: view_set_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;'>int app->view_set_cursor(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek,<br>int set_preferred_x<br></div>)
</div>
@ -668,7 +607,7 @@ from get_active_view.</div><div style='margin-top: 3mm; margin-bottom: 3mm; colo
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero on success</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;'>Sets the the view's cursor position. set_preferred_x should usually be true unless the change in
cursor position is is a vertical motion that tries to keep the cursor in the same column or x position.</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='#Buffer_Seek_doc'>Buffer_Seek</a></div></div><hr>
<div id='view_set_mark_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.26: view_set_mark</h4>
<h4>&sect;2.3.27: view_set_mark</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;'>int app->view_set_mark(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>Buffer_Seek seek<br></div>)
</div>
@ -682,7 +621,7 @@ cursor position is is a vertical motion that tries to keep the cursor in the sam
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero on success</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;'>Sets the the view's mark position.</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='#Buffer_Seek_doc'>Buffer_Seek</a></div></div><hr>
<div id='view_set_highlight_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.27: view_set_highlight</h4>
<h4>&sect;2.3.28: view_set_highlight</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;'>int app->view_set_highlight(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>int start,<br>int end,<br>int turn_on<br></div>)
</div>
@ -707,7 +646,7 @@ is set to true the highlight will be shown and the cursor will be hidden. After
that either setting the with view_set_cursor or calling view_set_highlight and
the turn_on set to false, will switch back to showing the cursor.</div></div><hr>
<div id='view_set_buffer_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.28: view_set_buffer</h4>
<h4>&sect;2.3.29: view_set_buffer</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;'>int app->view_set_buffer(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>int buffer_id,<br>unsigned int flags<br></div>)
</div>
@ -726,7 +665,7 @@ the turn_on set to false, will switch back to showing the cursor.</div></div><hr
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero on success</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;'>On success view_set_buffer sets the specified view's current buffer and
cancels and dialogue shown in the view and displays the file.</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='#Set_Buffer_Flag_doc'>Set_Buffer_Flag</a></div></div><hr>
<div id='view_post_fade_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.29: view_post_fade</h4>
<h4>&sect;2.3.30: view_post_fade</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;'>int app->view_post_fade(
<div style='margin-left: 4mm;'>Application_Links *app,<br>View_Summary *view,<br>float seconds,<br>int start,<br>int end,<br>unsigned int color<br></div>)
</div>
@ -752,7 +691,7 @@ cancels and dialogue shown in the view and displays the file.</div><div style='m
</div>
</div><hr>
<div id='get_user_input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.30: get_user_input</h4>
<h4>&sect;2.3.31: get_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;'>User_Input app->get_user_input(
<div style='margin-left: 4mm;'>Application_Links *app,<br>unsigned int get_type,<br>unsigned int abort_type<br></div>)
</div>
@ -770,19 +709,19 @@ command is executed an abort signal is returned. If an abort signal is ever ret
command should finish execution without any more calls that preempt the command.
If a get condition is met the user input is returned</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='#Input_Type_Flag_doc'>Input_Type_Flag</a></div><div style='margin-left: 5mm; margin-right: 5mm;'><a href='#User_Input_doc'>User_Input</a></div></div><hr>
<div id='get_command_input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.31: get_command_input</h4>
<h4>&sect;2.3.32: get_command_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;'>User_Input app->get_command_input(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns the input that triggered the command in execution.</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_doc'>User_Input</a></div></div><hr>
<div id='get_mouse_state_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.32: get_mouse_state</h4>
<h4>&sect;2.3.33: get_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;'>Mouse_State app->get_mouse_state(
<div style='margin-left: 4mm;'>Application_Links *app<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns the current mouse state</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='#Mouse_State_doc'>Mouse_State</a></div></div><hr>
<div id='start_query_bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.33: start_query_bar</h4>
<h4>&sect;2.3.34: start_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;'>int app->start_query_bar(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Query_Bar *bar,<br>unsigned int flags<br></div>)
</div>
@ -797,7 +736,7 @@ If a get condition is met the user input is returned</div><div style='margin-top
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero on success</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;'>The memory pointed to by bar must remain valid until a call to end_query_bar or
until the command returns.</div></div><hr>
<div id='end_query_bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.34: end_query_bar</h4>
<h4>&sect;2.3.35: end_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;'>void app->end_query_bar(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Query_Bar *bar,<br>unsigned int flags<br></div>)
</div>
@ -811,7 +750,7 @@ until the command returns.</div></div><hr>
</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;'>bar must be a pointer previously passed to start_query_bar previously in the same command.</div></div><hr>
<div id='print_message_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.35: print_message</h4>
<h4>&sect;2.3.36: print_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;'>void app->print_message(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *str,<br>int len<br></div>)
</div>
@ -825,7 +764,7 @@ until the command returns.</div></div><hr>
</div>
</div><hr>
<div id='change_theme_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.36: change_theme</h4>
<h4>&sect;2.3.37: change_theme</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;'>void app->change_theme(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int len<br></div>)
</div>
@ -839,7 +778,7 @@ until the command returns.</div></div><hr>
</div>
</div><hr>
<div id='change_font_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.37: change_font</h4>
<h4>&sect;2.3.38: change_font</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;'>void app->change_font(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *name,<br>int len<br></div>)
</div>
@ -853,7 +792,7 @@ until the command returns.</div></div><hr>
</div>
</div><hr>
<div id='set_theme_colors_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.38: set_theme_colors</h4>
<h4>&sect;2.3.39: set_theme_colors</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;'>void app->set_theme_colors(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Theme_Color *colors,<br>int count<br></div>)
</div>
@ -868,7 +807,7 @@ until the command returns.</div></div><hr>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>For each color struct in the array, the color in the style pallet is set to the color
code paired with the tag.</div></div><hr>
<div id='get_theme_colors_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.39: get_theme_colors</h4>
<h4>&sect;2.3.40: get_theme_colors</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;'>void app->get_theme_colors(
<div style='margin-left: 4mm;'>Application_Links *app,<br>Theme_Color *colors,<br>int count<br></div>)
</div>
@ -883,7 +822,7 @@ code paired with the tag.</div></div><hr>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Description</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>For each color struct in the array, the color field of the struct is filled with the
color from the specified color in the pallet.</div></div><hr>
<div id='directory_get_hot_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.40: directory_get_hot</h4>
<h4>&sect;2.3.41: directory_get_hot</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;'>int app->directory_get_hot(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *out,<br>int capacity<br></div>)
</div>
@ -901,7 +840,7 @@ accessed in the GUI. Whenever the GUI is opened it shows the hot directory.
In the future this will be deprecated and eliminated in favor of more flexible
directories controlled by the custom side.</div></div><hr>
<div id='get_file_list_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.41: get_file_list</h4>
<h4>&sect;2.3.42: get_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;'>File_List app->get_file_list(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *dir,<br>int len<br></div>)
</div>
@ -917,7 +856,7 @@ directories controlled by the custom side.</div></div><hr>
the specified directory. The File_List returned should be passed to free_file_list
when it is no longer in use.</div></div><hr>
<div id='free_file_list_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.42: free_file_list</h4>
<h4>&sect;2.3.43: free_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;'>void app->free_file_list(
<div style='margin-left: 4mm;'>Application_Links *app,<br>File_List list<br></div>)
</div>
@ -927,7 +866,7 @@ when it is no longer in use.</div></div><hr>
</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;'>after this call the file list passed in should not be read or written to</div></div><hr>
<div id='file_exists_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.43: file_exists</h4>
<h4>&sect;2.3.44: file_exists</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;'>int app->file_exists(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *filename,<br>int len<br></div>)
</div>
@ -941,7 +880,7 @@ when it is no longer in use.</div></div><hr>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero if the file exists, returns zero if the file does not exist</div></div><hr>
<div id='directory_cd_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.44: directory_cd</h4>
<h4>&sect;2.3.45: directory_cd</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;'>int app->directory_cd(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *dir,<br>int *len,<br>int capacity,<br>char *rel_path,<br>int rel_len<br></div>)
</div>
@ -973,27 +912,266 @@ For instance if dir contains "C:/Users/MySelf" and rel is "Documents" the buffer
"C:/Users/MySelf/Documents" and len will contain the length of that string. This call can
also be used with rel set to ".." to traverse to parent folders.</div></div><hr>
<div id='get_4ed_path_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.45: get_4ed_path</h4>
<h4>&sect;2.3.46: get_4ed_path</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;'>int app->get_4ed_path(
<div style='margin-left: 4mm;'>Application_Links *app,<br>char *out,<br>int capacity<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Parameters</i></b></div><div>
<div style='font-weight: 600;'>out</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>a buffer that receives the path to the 4ed executable file</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>A char buffer that receives the path to the 4ed executable file.</div></div>
</div>
<div>
<div style='font-weight: 600;'>capacity</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>the maximum capacity of the output buffer</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>The maximum capacity of the output buffer.</div></div>
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>returns non-zero on success, returns zero on failure</div></div><hr>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Return</i></b></div><div style='margin-left: 5mm; margin-right: 5mm;'>Returns non-zero on success, returns zero on failure.</div></div><hr>
<div id='show_mouse_cursor_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.2.46: show_mouse_cursor</h4>
<h4>&sect;2.3.47: show_mouse_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;'>void app->show_mouse_cursor(
<div style='margin-left: 4mm;'>Application_Links *app,<br>int show<br></div>)
</div>
<div style='margin-top: 3mm; margin-bottom: 3mm; color: #309030;'><b><i>Parameters</i></b></div><div>
<div style='font-weight: 600;'>show</div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>The show state to put the mouse cursor into. If this is non-zero the mouse cursor is shown.</div></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>The show state to put the mouse cursor into, should be one of the Mouse_Cursor_Show_Type enum values.</div></div>
</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='#Mouse_Cursor_Show_Type_doc'>Mouse_Cursor_Show_Type</a></div></div><hr>
<h3>&sect;2.4 Type Descriptions</h3>
<div id='Key_Code_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.1: Key_Code</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;'>typedef unsigned char Key_Code;</div>
</div><hr>
<div id='Key_Modifier_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.2: Key_Modifier</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;</div>
</div><hr>
<div id='Command_ID_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.3: Command_ID</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_ID;</div>
</div><hr>
<div id='User_Input_Type_ID_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.4: User_Input_Type_ID</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 User_Input_Type_ID;</div>
</div><hr>
<div id='Event_Message_Type_ID_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.5: Event_Message_Type_ID</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 Event_Message_Type_ID;</div>
</div><hr>
<div id='Buffer_Setting_ID_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.6: Buffer_Setting_ID</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_Setting_ID;</div>
</div><hr>
<div id='View_Setting_ID_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.7: View_Setting_ID</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 View_Setting_ID;</div>
</div><hr>
<div id='Mouse_Cursor_Show_Type_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.8: Mouse_Cursor_Show_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 Mouse_Cursor_Show_Type;</div>
</div><hr>
<div id='Key_Modifier_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.9: 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><hr>
<div id='Buffer_Create_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.10: 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><hr>
<div id='Buffer_Kill_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.11: 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><hr>
<div id='Access_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.12: 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><hr>
<div id='Seek_Boundary_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.13: 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><hr>
<div id='Command_Line_Input_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.14: 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><hr>
<div id='Auto_Indent_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.15: 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><hr>
<div id='Set_Buffer_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.16: 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><hr>
<div id='Input_Type_Flag_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.17: 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><hr>
<div id='Key_Event_Data_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.18: 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>
Key_Code character;<br>
Key_Code character_no_caps_lock;<br>
char modifiers[MDFR_INDEX_COUNT];<br>
</div>
};<br>
</div>
</div><hr>
<div id='Mouse_State_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.19: 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>
char r;<br>
char press_l;<br>
char press_r;<br>
char release_l;<br>
char release_r;<br>
char wheel;<br>
char out_of_window;<br>
int x;<br>
int y;<br>
</div>
};<br>
</div>
</div><hr>
<div id='Range_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.20: 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>
<div style='margin-left: 8mm;'>
int min;<br>
int max;<br>
</div>
};<br>
struct {<br>
<div style='margin-left: 8mm;'>
int start;<br>
int end;<br>
</div>
};<br>
</div>
};<br>
</div>
</div><hr>
<div id='File_Info_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.21: 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>
int filename_len;<br>
int folder;<br>
</div>
};<br>
</div>
</div><hr>
<div id='File_List_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.22: 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>
File_Info * infos;<br>
int count;<br>
int block_size;<br>
</div>
};<br>
</div>
</div><hr>
<div id='Buffer_Identifier_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.23: 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>
int name_len;<br>
int id;<br>
</div>
};<br>
</div>
</div><hr>
<div id='Buffer_Summary_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.24: 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;'>
int exists;<br>
int ready;<br>
int buffer_id;<br>
unsigned int lock_flags;<br>
int size;<br>
char * file_name;<br>
int file_name_len;<br>
char * buffer_name;<br>
int buffer_name_len;<br>
int buffer_cursor_pos;<br>
int is_lexed;<br>
int map_id;<br>
</div>
};<br>
</div>
</div><hr>
<div id='View_Summary_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.25: 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;'>
int exists;<br>
int view_id;<br>
int buffer_id;<br>
unsigned int lock_flags;<br>
Full_Cursor cursor;<br>
Full_Cursor mark;<br>
float preferred_x;<br>
float line_height;<br>
int unwrapped_lines;<br>
int show_whitespace;<br>
i32_Rect file_region;<br>
GUI_Scroll_Vars scroll_vars;<br>
</div>
};<br>
</div>
</div><hr>
<div id='User_Input_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.26: 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;'>
int type;<br>
int abort;<br>
union {<br>
<div style='margin-left: 8mm;'>
Key_Event_Data key;<br>
Mouse_State mouse;<br>
</div>
};<br>
unsigned long long command;<br>
</div>
};<br>
</div>
</div><hr>
<div id='Query_Bar_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.27: 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>
String string;<br>
</div>
};<br>
</div>
</div><hr>
<div id='Event_Message_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.28: 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>
</div>
};<br>
</div>
</div><hr>
<div id='Theme_Color_doc' style='margin-bottom: 1cm;'>
<h4>&sect;2.4.29: 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>
uint32_t color;<br>
</div>
};<br>
</div>
</div><hr>
</div>

View File

@ -12,11 +12,6 @@
#include "4coder_buffer_types.h"
#include "4coder_gui.h"
#define MDFR_NONE 0x0
#define MDFR_CTRL 0x1
#define MDFR_ALT 0x2
#define MDFR_SHIFT 0x4
#ifndef FRED_STRING_STRUCT
#define FRED_STRING_STRUCT
typedef struct String{
@ -31,42 +26,7 @@ typedef struct Offset_String{
} Offset_String;
#endif
typedef unsigned char Code;
typedef enum{
MDFR_SHIFT_INDEX,
MDFR_CONTROL_INDEX,
MDFR_ALT_INDEX,
MDFR_CAPS_INDEX,
MDFR_HOLD_INDEX,
// always last
MDFR_INDEX_COUNT
} Key_Control;
typedef struct Key_Event_Data{
Code keycode;
Code character;
Code character_no_caps_lock;
char modifiers[MDFR_INDEX_COUNT];
} Key_Event_Data;
typedef struct Mouse_State{
char l, r;
char press_l, press_r;
char release_l, release_r;
char wheel;
char out_of_window;
int x, y;
} Mouse_State;
typedef union Range{
struct{
int min, max;
};
struct{
int start, end;
};
} Range;
#include "4coder_types.h"
inline Key_Event_Data
key_event_data_zero(){
@ -92,82 +52,6 @@ make_range(int p1, int p2){
return(range);
}
typedef struct File_Info{
String filename;
int folder;
} File_Info;
typedef struct File_List{
// Ignore this, it's for internal stuff.
void *block;
// The list of files and folders.
File_Info *infos;
int count;
// Ignore this, it's for internal stuff.
int block_size;
} File_List;
// NOTE(allen|a4.0.8): This is used to identify which buffer
// an operation should work on when you might want to
// identify it by id or by name.
typedef struct Buffer_Identifier{
char *name;
int name_len;
int id;
} Buffer_Identifier;
typedef uint64_t Command_ID;
enum{
cmdid_null,
cmdid_center_view,
cmdid_left_adjust_view,
cmdid_page_up,
cmdid_page_down,
cmdid_word_complete,
cmdid_undo,
cmdid_redo,
cmdid_history_backward,
cmdid_history_forward,
cmdid_to_uppercase,
cmdid_to_lowercase,
cmdid_toggle_line_wrap,
cmdid_toggle_show_whitespace,
cmdid_clean_all_lines,
cmdid_eol_dosify,
cmdid_eol_nixify,
cmdid_interactive_new,
cmdid_interactive_open,
cmdid_reopen,
cmdid_save,
cmdid_save_as,
cmdid_interactive_switch_buffer,
cmdid_interactive_kill_buffer,
cmdid_kill_buffer,
cmdid_open_color_tweaker,
cmdid_open_config,
cmdid_open_menu,
cmdid_open_debug,
cmdid_open_panel_vsplit,
cmdid_open_panel_hsplit,
cmdid_close_panel,
cmdid_change_active_panel,
//
cmdid_count
};
// These are regular hooks, any of them can be set to any function
// that matches the HOOK_SIG pattern.
enum Hook_ID{
@ -187,161 +71,20 @@ enum Special_Hook_ID{
_hook_input_filter,
};
// None of the members of *_Summary structs nor any of the data pointed
// to by the members should be modified, I would have made them all
// const... but that causes a lot problems for C++ reasons.
struct Buffer_Summary{
int exists;
int ready;
int buffer_id;
unsigned int lock_flags;
int size;
int file_name_len;
int buffer_name_len;
char *file_name;
char *buffer_name;
int buffer_cursor_pos;
int is_lexed;
int map_id;
};
inline Buffer_Summary
buffer_summary_zero(){
Buffer_Summary summary={0};
return(summary);
}
struct View_Summary{
int exists;
int view_id;
int buffer_id;
unsigned int lock_flags;
Full_Cursor cursor;
Full_Cursor mark;
float preferred_x;
float line_height;
int unwrapped_lines;
int show_whitespace;
i32_Rect file_region;
GUI_Scroll_Vars scroll_vars;
};
inline View_Summary
view_summary_zero(){
View_Summary summary={0};
return(summary);
}
struct User_Input{
int type;
int abort;
union{
Key_Event_Data key;
Mouse_State mouse;
};
unsigned long long command;
};
#define CommandEqual(c1,c2) ((unsigned long long)(c1) == (unsigned long long)(c2))
struct Query_Bar{
String prompt;
String string;
};
struct Event_Message{
int type;
};
struct Theme_Color{
Style_Tag tag;
unsigned int color;
};
// Flags and enum values
// TODO(allen): auto generate this and the docs for it
enum User_Input_Type_ID{
UserInputNone,
UserInputKey,
UserInputMouse
};
enum Event_Message_Type_ID{
EventMessage_NoMessage,
EventMessage_OpenView,
EventMessage_Frame,
EventMessage_CloseView
};
enum Buffer_Setting_ID{
BufferSetting_Null,
BufferSetting_Lex,
BufferSetting_WrapLine,
BufferSetting_MapID,
};
enum View_Setting_ID{
ViewSetting_Null,
ViewSetting_ShowScrollbar,
};
enum Buffer_Kill_Flag{
BufferKill_Background = 0x1,
BufferKill_AlwaysKill = 0x2,
};
enum Buffer_Create_Flag{
BufferCreate_Background = 0x1,
BufferCreate_AlwaysNew = 0x2,
};
enum Access_Flag{
AccessOpen = 0x0,
AccessProtected = 0x1,
AccessHidden = 0x2,
AccessAll = 0xFF
};
enum Seek_Boundry_Flag{
BoundryWhitespace = 0x1,
BoundryToken = 0x2,
BoundryAlphanumeric = 0x4,
BoundryCamelCase = 0x8
};
enum Command_Line_Input_Flag{
CLI_OverlapWithConflict = 0x1,
CLI_AlwaysBindToView = 0x2,
CLI_CursorAtEnd = 0x4,
};
enum Auto_Indent_Flag{
AutoIndent_ClearLine = 0x1,
AutoIndent_UseTab = 0x2
};
enum Set_Buffer_Flag{
SetBuffer_KeepOriginalGUI = 0x1
};
enum Input_Type_Flag{
EventOnAnyKey = 0x1,
EventOnEsc = 0x2,
EventOnLeftButton = 0x4,
EventOnRightButton = 0x8,
EventOnWheel = 0x10,
EventOnButton = (EventOnLeftButton | EventOnRightButton | EventOnWheel),
// NOTE(allen): These don't work so much, so let's pretend they're not here for now.
EventOnMouseMove = 0x20,
EventOnMouse = (EventOnButton | EventOnMouseMove),
EventAll = 0xFF
};
#define VIEW_ROUTINE_SIG(name) void name(struct Application_Links *app, int view_id)
#define GET_BINDING_DATA(name) int name(void *data, int size)
#define CUSTOM_COMMAND_SIG(name) void name(struct Application_Links *app)

View File

@ -214,25 +214,28 @@ INPUT_FILTER_SIG(my_suppress_mouse_filter){
}
}
static void
set_mouse_suppression(Application_Links *app, int suppress){
if (suppress){
suppressing_mouse = true;
app->show_mouse_cursor(app, MouseCursorShow_Never);
}
else{
suppressing_mouse = false;
app->show_mouse_cursor(app, MouseCursorShow_Always);
}
}
CUSTOM_COMMAND_SIG(suppress_mouse){
suppressing_mouse = true;
app->show_mouse_cursor(app, false);
set_mouse_suppression(app, true);
}
CUSTOM_COMMAND_SIG(allow_mouse){
suppressing_mouse = false;
app->show_mouse_cursor(app, true);
set_mouse_suppression(app, false);
}
CUSTOM_COMMAND_SIG(toggle_mouse){
if (suppressing_mouse){
suppressing_mouse = false;
app->show_mouse_cursor(app, true);
}
else{
suppressing_mouse = true;
app->show_mouse_cursor(app, false);
}
set_mouse_suppression(app, !suppressing_mouse);
}
void

View File

@ -610,16 +610,16 @@ CUSTOM_COMMAND_SIG(seek_##n##_##dir){ basic_seek(app, dir, flags); }
#define right true
#define left false
SEEK_COMMAND(whitespace, right, BoundryWhitespace)
SEEK_COMMAND(whitespace, left, BoundryWhitespace)
SEEK_COMMAND(token, right, BoundryToken)
SEEK_COMMAND(token, left, BoundryToken)
SEEK_COMMAND(white_or_token, right, BoundryToken | BoundryWhitespace)
SEEK_COMMAND(white_or_token, left, BoundryToken | BoundryWhitespace)
SEEK_COMMAND(alphanumeric, right, BoundryAlphanumeric)
SEEK_COMMAND(alphanumeric, left, BoundryAlphanumeric)
SEEK_COMMAND(alphanumeric_or_camel, right, BoundryAlphanumeric | BoundryCamelCase)
SEEK_COMMAND(alphanumeric_or_camel, left, BoundryAlphanumeric | BoundryCamelCase)
SEEK_COMMAND(whitespace, right, BoundaryWhitespace)
SEEK_COMMAND(whitespace, left, BoundaryWhitespace)
SEEK_COMMAND(token, right, BoundaryToken)
SEEK_COMMAND(token, left, BoundaryToken)
SEEK_COMMAND(white_or_token, right, BoundaryToken | BoundaryWhitespace)
SEEK_COMMAND(white_or_token, left, BoundaryToken | BoundaryWhitespace)
SEEK_COMMAND(alphanumeric, right, BoundaryAlphanumeric)
SEEK_COMMAND(alphanumeric, left, BoundaryAlphanumeric)
SEEK_COMMAND(alphanumeric_or_camel, right, BoundaryAlphanumeric | BoundaryCamelCase)
SEEK_COMMAND(alphanumeric_or_camel, left, BoundaryAlphanumeric | BoundaryCamelCase)
#undef right
#undef left
@ -803,9 +803,9 @@ CUSTOM_COMMAND_SIG(snipe_token_or_word){
view = app->get_active_view(app, access);
buffer = app->get_buffer(app, view.buffer_id, access);
pos1 = app->buffer_boundary_seek(app, &buffer, view.cursor.pos, false, BoundryToken | BoundryWhitespace);
pos1 = app->buffer_boundary_seek(app, &buffer, view.cursor.pos, false, BoundaryToken | BoundaryWhitespace);
pos2 = app->buffer_boundary_seek(app, &buffer, pos1, true, BoundryToken | BoundryWhitespace);
pos2 = app->buffer_boundary_seek(app, &buffer, pos1, true, BoundaryToken | BoundaryWhitespace);
Range range = make_range(pos1, pos2);
app->buffer_replace_range(app, &buffer, range.start, range.end, 0, 0);
@ -1192,7 +1192,8 @@ CUSTOM_COMMAND_SIG(open_all_code){
for (int i = 0; i < list.count; ++i){
File_Info *info = list.infos + i;
if (!info->folder){
String extension = file_extension(info->filename);
String extension = make_string(info->filename, info->filename_len, info->filename_len+1);
extension = file_extension(extension);
if (match(extension, make_lit_string("cpp")) ||
match(extension, make_lit_string("hpp")) ||
match(extension, make_lit_string("c")) ||

View File

@ -1,4 +1,4 @@
enum Key_Code{
enum Key_Code_Names{
key_back = 1,
key_up = 2,
key_down = 3,

537
4coder_types.h Normal file
View File

@ -0,0 +1,537 @@
/* DOC(Key_Code is the type alias for key codes.) */
typedef unsigned char Key_Code;
#define ENUM(type,name) typedef type name; enum name##_
#define FLAGENUM(name) typedef uint32_t name; enum name##_
/* DOC(A Key_Modifier acts as an index for specifying modifiers in arrays.) */
ENUM(int32_t, Key_Modifier){
MDFR_SHIFT_INDEX,
MDFR_CONTROL_INDEX,
MDFR_ALT_INDEX,
MDFR_CAPS_INDEX,
MDFR_HOLD_INDEX,
/* DOC(MDFR_INDEX_COUNT is used to specify the number of modifiers supported.) */
MDFR_INDEX_COUNT
};
/* DOC(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.) */
FLAGENUM(Key_Modifier_Flag){
/* DOC(MDFR_NONE specifies that no modifiers are pressed.) */
MDFR_NONE = 0x0,
MDFR_CTRL = 0x1,
MDFR_ALT = 0x2,
MDFR_SHIFT = 0x4,
};
/* DOC(A Command_ID is used as a name for commands implemented internally in 4coder.) */
ENUM(uint64_t, Command_ID){
/* DOC(cmdid_null is set aside to always be zero and is not associated with any command.) */
cmdid_null,
/* DOC(cmdid_center_view centers the view vertically on the cursor.) */
cmdid_center_view,
/* DOC(cmdid_left_adjust_view adjusts the view to be just left of the cursor's position.) */
cmdid_left_adjust_view,
/* DOC(cmdid_page_up moves the view up one whole screen height and centers the cursor there.) */
cmdid_page_up,
/* DOC(cmdid_page_down moves the view down one whole screen height and centers the cursor there.) */
cmdid_page_down,
/* DOC(cmdid_word_complete begins or continues cycling through completions for a partial word.) */
cmdid_word_complete,
/* DOC(cmdid_undo performs a standard undo behavior.) */
cmdid_undo,
/* DOC(cmdid_redo reperforms an edit that was undone.) */
cmdid_redo,
/* DOC(cmdid_history_backward performs a step backwards through the file history, which includes previously lost redo branches.) */
cmdid_history_backward,
/* DOC(cmdid_history_forward unperforms the previous cmdid_history_backward step if possib.e) */
cmdid_history_forward,
/* DOC(cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range uppercase.) */
cmdid_to_uppercase,
/* DOC(cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range lowercase.) */
cmdid_to_lowercase,
/* DOC(cmdid_toggle_line_wrap toggles the line wrap setting of the active view. ) */
cmdid_toggle_line_wrap,
/* DOC(cmdid_toggle_line_wrap toggles the show whitespace setting of the active view.) */
cmdid_toggle_show_whitespace,
/* DOC(cmdid_clean_all_lines deletes extra whitespace out the currently active buffer.) */
cmdid_clean_all_lines,
/* DOC(cmdid_eol_dosify sets the currently active buffer to dos save mode where the end of a line is "\r\n") */
cmdid_eol_dosify,
/* DOC(cmdid_eol_nixify sets the currently active buffer to nix save mode where the end of a line is "\n") */
cmdid_eol_nixify,
/* DOC(cmdid_interactive_new begins an interactive dialogue to create a new buffer.) */
cmdid_interactive_new,
/* DOC(cmdid_interactive_open begins an interactive dialogue to open a file into a buffer.) */
cmdid_interactive_open,
/* DOC(cmdid_reopen reloads the active buffer's associated file and discards the old buffer contents for the reloaded file.) */
cmdid_reopen,
/* DOC(cmdid_save saves the buffer's contents into the associated file.) */
cmdid_save,
/* DOC(cmdid_save_as does not currently work and is likely to be removed rather that fixed.) */
cmdid_save_as,
/* DOC(cmdid_interactive_switch_buffer begins an interactive dialogue to choose an open buffer to swap into the active view.) */
cmdid_interactive_switch_buffer,
/* DOC(cmdid_interactive_kill_buffer begins an interactive dialogue to choose an open buffer to kill.) */
cmdid_interactive_kill_buffer,
/* DOC(cmdid_kill_buffer tries to kill the active buffer.) */
cmdid_kill_buffer,
/* DOC(cmdid_open_color_tweaker opens the theme editing GUI.) */
cmdid_open_color_tweaker,
/* DOC(cmdid_open_config opens the configuration menu.) */
cmdid_open_config,
/* DOC(cmdid_open_menu opens the top level menu. ) */
cmdid_open_menu,
/* DOC(cmdid_open_debug opens the debug information viewer mode.) */
cmdid_open_debug,
/* DOC(cmdid_open_panel_vsplit splits the current panel into two with a vertical divider.) */
cmdid_open_panel_vsplit,
/* DOC(cmdid_open_panel_hsplit splits the current panel into two with a horizontal divider.) */
cmdid_open_panel_hsplit,
/* DOC(cmdid_close_panel closes the active panel.) */
cmdid_close_panel,
/* DOC(cmdid_change_active_panel cycles to the next open panel.) */
cmdid_change_active_panel,
// count
cmdid_count
};
/* DOC(User_Input_Type_ID specifies a type of user input event.) */
ENUM(int32_t, User_Input_Type_ID){
/* DOC(UserInputNone indicates that no event has occurred.) */
UserInputNone,
/* DOC(UserInputKey indicates an event which can be described by a Key_Event_Data struct.) */
UserInputKey,
/* DOC(UserInputMouse indicates an event which can be described by a Mouse_State struct.) */
UserInputMouse
};
/* DOC(Event_Message_Type_ID is a part of an unfinished feature.) */
ENUM(int32_t, Event_Message_Type_ID){
/* DOC( TODO. ) */
EventMessage_NoMessage,
/* DOC( TODO. ) */
EventMessage_OpenView,
/* DOC( TODO. ) */
EventMessage_Frame,
/* DOC( TODO. ) */
EventMessage_CloseView
};
/* DOC(A Buffer_Setting_ID names a setting in a buffer.) */
ENUM(int32_t, Buffer_Setting_ID){
/* DOC(BufferSetting_Null is not a valid setting, it is reserved to detect errors.) */
BufferSetting_Null,
/* DOC(The BufferSetting_Lex setting is used to determine whether to store C++ tokens from with the buffer.) */
BufferSetting_Lex,
/* DOC(The BufferSetting_WrapLine setting is used to determine whether a buffer prefers to be viewed with wrapped lines,
individual views can be set to override this value after being tied to the buffer.) */
BufferSetting_WrapLine,
/* DOC(The BufferSetting_MapID setting specifies the id of the command map that should be active when a buffer is active.) */
BufferSetting_MapID,
};
/* DOC(A View_Setting_ID names a setting in a view.) */
ENUM(int32_t, View_Setting_ID){
/* DOC(ViewSetting_Null is not a valid setting, it is reserved to detect errors.) */
ViewSetting_Null,
/* DOC(The ViewSetting_ShowScrollbar setting determines whether a scroll bar is attached to a view in it's scrollable section.) */
ViewSetting_ShowScrollbar,
};
/* DOC(A Buffer_Create_Flag field specifies how a buffer should be created.) */
FLAGENUM(Buffer_Create_Flag){
/* DOC(BufferCreate_Background is not currently implemented.) */
BufferCreate_Background = 0x1,
/* DOC(When BufferCreate_AlwaysNew is et it indicates the buffer should be
cleared to empty even if it's associated file already has content.) */
BufferCreate_AlwaysNew = 0x2,
};
/* DOC(A Buffer_Kill_Flag field specifies how a buffer should be killed.) */
FLAGENUM(Buffer_Kill_Flag){
/* DOC(BufferKill_Background is not currently implemented.) */
BufferKill_Background = 0x1,
/* DOC(When BufferKill_AlwaysKill is set it indicates the buffer should be killed
without asking, even when the buffer is dirty.) */
BufferKill_AlwaysKill = 0x2,
};
/* DOC(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
4coder object has a particular protection flag set and the corresponding bit is
not set in the access field, that 4coder object is hidden. On the other hand if
a protection flag is set in the access parameter and the object does not have
that protection flag, the object is still returned from the access call.) TODO */
FLAGENUM(Access_Flag){
/* DOC(AccessOpen does not include any bits, it indicates that the access should
only return objects that have no protection flags set.) */
AccessOpen = 0x0,
/* DOC(AccessProtected is set on buffers and views that are "read only" such as
the output from an app->exec_system_command call such as *build*. This is to prevent
the user from accidentally editing output that they might prefer to keep in tact.) */
AccessProtected = 0x1,
/* DOC(AccessHidden is set on any view that is not currently showing it's file, for
instance because it is navigating the file system to open a file.) */
AccessHidden = 0x2,
/* DOC(AccessAll is a catchall access for cases where an access call should always
return an object no matter what it's protection flags are.) */
AccessAll = 0xFF
};
/* DOC(A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the
beginning or end of different types of words.) */
FLAGENUM(Seek_Boundary_Flag){
BoundaryWhitespace = 0x1,
BoundaryToken = 0x2,
BoundaryAlphanumeric = 0x4,
BoundaryCamelCase = 0x8
};
/* DOC(A Command_Line_Input_Flag field specifies the behavior of a call to a command line interface.) */
FLAGENUM(Command_Line_Input_Flag){
/* DOC(If CLI_OverlapWithConflict is set if output buffer of the new command is already
in use by another command which is still executing, the older command relinquishes control
of the buffer and both operate simultaneously with only the newer command outputting to
the buffer.) */
CLI_OverlapWithConflict = 0x1,
/* DOC(If CLI_AlwaysBindToView is set the output buffer will always be set in the active
view even if it is already set in another open view.) */
CLI_AlwaysBindToView = 0x2,
/* DOC(If CLI_CursorAtEnd is set the cursor will be kept at the end of the output buffer,
otherwise the cursor is kept at the beginning.) */
CLI_CursorAtEnd = 0x4,
};
/* DOC(An Auto_Indent_Flag field specifies the behavior of an auto indentation operation.) */
FLAGENUM(Auto_Indent_Flag){
/* DOC(If AutoIndent_ClearLine is set, then any line that is only whitespace will
be cleared to contain nothing at all. otherwise the line is filled with whitespace
to match the nearby indentation.) */
AutoIndent_ClearLine = 0x1,
/* DOC(If AutoIndent_UseTab is set, then when putting in leading whitespace to align
code, as many tabs will be used as possible until the fine grained control of spaces
is needed to finish the alignment.) */
AutoIndent_UseTab = 0x2
};
/* DOC(A Set_Buffer_Flag field specifies the behavior of an operation that sets the buffer of a view.) */
FLAGENUM(Set_Buffer_Flag){
/* DOC(If SetBuffer_KeepOriginalGUI then when the file is set, the view will not switch to it
if some other GUI was currently up, otherwise any GUI that is up is closed and the view
switches to the file.) */
SetBuffer_KeepOriginalGUI = 0x1
};
/* DOC(A Input_Type_Flag field specifies a set of input event types.) */
FLAGENUM(Input_Type_Flag){
/* DOC(If EventOnAnyKey is set, all keyboard events are included in the set.) */
EventOnAnyKey = 0x1,
/* DOC(If EventOnEsc is set, any press of the escape key is included in the set.) */
EventOnEsc = 0x2,
/* DOC(If EventOnLeftButton is set, left clicks are included in the set.) */
EventOnLeftButton = 0x4,
/* DOC(If EventOnRightButton is set, right clicks are included in the set.) */
EventOnRightButton = 0x8,
/* DOC(If EventOnWheel is set, any wheel movement is included in the set.) */
EventOnWheel = 0x10,
/* DOC(If EventOnButton is set, all mouse button events are included in the set.) */
EventOnButton = (EventOnLeftButton | EventOnRightButton | EventOnWheel),
/* DOC(This is not totally implemented yet.) */
EventOnMouseMove = 0x20,
/* DOC(This is not totally implemented yet.) */
EventOnMouse = (EventOnButton | EventOnMouseMove),
/* DOC(EventAll is a catch all name for including all possible events in the set.) */
EventAll = 0xFF
};
/* DOC(A Mouse_Cursor_Show_Type value specifes a mode for 4coder to handle the mouse cursor.) */
ENUM(int32_t, Mouse_Cursor_Show_Type){
/* DOC(The MouseCursorShow_Never mode never shows the cursor.) */
MouseCursorShow_Never,
/* DOC(The MouseCursorShow_Never mode always shows the cursor.) */
MouseCursorShow_Always,
// MouseCursorShow_WhenActive,// TODO(allen): coming soon
};
/* DOC(
Key_Event_Data describes a key event, including the
translation to a character, the translation to
a character ignoring the state of caps lock, and
an array of all the modifiers that were pressed
at the time of the event.
)
*/
struct Key_Event_Data{
/* DOC(This field is the raw keycode which is always non-zero in valid key events.) */
Key_Code keycode;
/* DOC(This field is the keycode after translation to a character, this is 0 if there is no translation.) */
Key_Code character;
/* DOC(
This field is like the field character, except that the state of caps lock is ignored in the translation.
) */
Key_Code character_no_caps_lock;
/* DOC(
This field is an array indicating the state of modifiers at the time of the key press.
The array is indexed using the values of Key_Modifier. A 1 indicates that the corresponding
modifier was held, and a 0 indicates that it was not held.
)
DOC_SEE(Key_Modifier)
*/
char modifiers[MDFR_INDEX_COUNT];
};
/* DOC(
Mouse_State describes an entire mouse state complete with the position,
left and right button states, the wheel state, and whether or not the
mouse if in the window.
) */
struct Mouse_State{
/* DOC(This field indicates that the left button is held.) */
char l;
/* DOC(This field indicates that the right button is held.) */
char r;
/* DOC(This field indicates that the left button was pressed this frame.) */
char press_l;
/* DOC(This field indicates that the right button was pressed this frame.) */
char press_r;
/* DOC(This field indicates that the left button was released this frame.) */
char release_l;
/* DOC(This field indicates that the right button was released this frame.) */
char release_r;
/* DOC(
This field is 0 when the wheel has not moved, it is 1 for a downward motion and -1 for an upward motion.
) */
char wheel;
/* DOC(This field indicates that the mouse is outside of the window.) */
char out_of_window;
/* DOC(This field contains the x position of the mouse relative to the window where the left side is 0.) */
int x;
/* DOC(This field contains the y position of the mouse relative to the window where the top side is 0.) */
int y;
};
/* DOC(
Range describes an integer range typically used for ranges within a buffer.
Ranges tend are usually not passed as a Range struct into the API, but this
struct is used to return ranges.
Throughout the API ranges are thought of in the form [min,max) where max is
"one past the end" of the range that is actually read/edited/modified.
) */
union Range{
struct{
/* DOC(This is the smaller value in the range, it is also the 'start'.) */
int min;
/* DOC(This is the larger value in the range, it is also the 'end'.) */
int max;
};
struct{
/* DOC(This is the start of the range, it is also the 'min'.) */
int start;
/* DOC(This is the end of the range, it is also the 'max'.) */
int end;
};
};
/*
DOC(File_Info describes the name and type of a file.)
DOC_SEE(File_List)
*/
struct File_Info{
/* DOC(This field is a null terminated string specifying the name of the file.) */
char *filename;
/* DOC(This field specifies the length of the filename string not counting the null terminator.) */
int filename_len;
/* DOC(This field indicates that the description is for a folder not a file.) */
int folder;
};
/* DOC(File_List is a list of File_Info structs.) */
struct File_List{
/* DOC(This field is for inernal use.) */
void *block;
/* DOC(This field is an array of File_Info structs.) */
File_Info *infos;
/* DOC(This field specifies the number of struts in the info array.) */
int count;
/* DOC(This field is for internal use.) */
int block_size;
};
/* DOC(
Buffer_Identifier acts as a loosely typed description of a buffer that
can either be a name or an id. If the
) */
struct Buffer_Identifier{
/* DOC(
This field is the name of the buffer, need not be null terminated.
If id is specified this should be NULL.
) */
char *name;
/* DOC(This field is specifies the length of the name string.) */
int name_len;
/* DOC(This field is the id of the buffer. If name is specified this should be 0.) */
int id;
};
/* DOC(
Buffer_Summary acts as a handle to a buffer and describes the state of the buffer.
) */
struct Buffer_Summary{
/* DOC(
This field indicates whether the Buffer_Summary describes a buffer that is open in 4coder.
When this field is false the summary is referred to as a "null summary".
) */
int exists;
/* DOC(If this is not a null summary, this field indicates whether the buffer has finished loading.) */
int ready;
/* DOC(
If this is not a null summary this field is the id of the associated buffer.
If this is a null summary then buffer_id is 0.
) */
int buffer_id;
/*
DOC(If this is not a null summary, this field contains flags describing the protection status of the buffer.)
DOC_SEE(Access_Flag)
*/
unsigned int lock_flags;
/* DOC(If this is not a null summary, this field specifies the size of the text in the buffer.) */
int size;
/* DOC(If this is not a null summary, this field specifies the file name associated to this buffer.) */
char *file_name;
/* DOC(This field specifies the length of the file_name string.) */
int file_name_len;
/* DOC(If this is not a null summary, this field specifies the name of the buffer.) */
char *buffer_name;
/* DOC(This field specifies the length of the buffer_name string.) */
int buffer_name_len;
/* DOC(This is a hold over from an old system, consider it deprecated.) */
int buffer_cursor_pos;
/* DOC(If this is not a null summary, this field indicates whether the buffer is set to lex tokens.) */
int is_lexed;
/* DOC(If this is not a null summary, this field specifies the id of the command map for this buffer.) */
int map_id;
};
/* 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.
When this field is false the summary is referred to as a "null summary".
) */
int exists;
/* DOC(
If this is not a null summary, this field is the id of the associated view.
If this is a null summary then view_id is 0.
) */
int view_id;
/* DOC(If this is not a null summary, and this view looks at a buffer, this is the id of the buffer.) */
int buffer_id;
/*
DOC(If this is not a null summary, this field contains flags describing the protection status of the view.)
DOC_SEE(Access_Flag)
*/
unsigned int lock_flags;
/*
DOC(If this is not a null summary, this describes the position of the cursor.)
DOC_SEE(Full_Cursor)
*/
Full_Cursor cursor;
/*
DOC(If this is not a null summary, this describes the position of the mark.)
DOC_SEE(Full_Cursor)
*/
Full_Cursor mark;
/* DOC(If this is not a null summary, this is the x position that is maintained in vertical navigation.) */
float preferred_x;
/* DOC(If this is not a null summary, this specifies the height of a line rendered in the view.) */
float line_height;
/* DOC(If this is not a null summary, this indicates that the view is set to render with unwrapped lines.) */
int unwrapped_lines;
/* DOC(If this is not a null summary, this indicates that the view is set to highlight white space.) */
int show_whitespace;
/* DOC(This feature is not fully implemented yet.) */
i32_Rect file_region;
/* DOC(This feature is not fully implemented yet.) */
GUI_Scroll_Vars scroll_vars;
};
/* DOC(User_Input describes a user input event which can be either a key press or mouse event.) */
struct User_Input{
/*
DOC(This field specifies whether the event was a key press or mouse event.)
DOC_SEE(User_Input_Type_ID)
*/
int type;
/* DOC(This field indicates that an abort event has occurred and the command needs to shut down.) */
int abort;
union{
/* DOC(This field describes a key press event.) */
Key_Event_Data key;
/* DOC(This field describes a mouse input event.) */
Mouse_State mouse;
};
/*
DOC(If this event would trigger a command, this field specifies what the command would be.)
TODO
*/
unsigned long long command;
};
/* DOC(Query_Bar is a struct used to store information in the user's control
that will be displayed as a drop down bar durring an interactive command.) */
struct Query_Bar{
/* DOC(This specifies the prompt portion of the drop down bar.) */
String prompt;
/* DOC(This specifies the main string portion of the drop down bar.) */
String string;
};
/* DOC(This feature is not implemented.) */
struct Event_Message{
/* DOC(This feature is not implemented.) */
int type;
};
/*
DOC(Theme_Color stores a style tag/color pair, for the purpose of setting and getting colors in the theme .)
DOC_SEE(Style_Tag)
*/
struct Theme_Color{
Style_Tag tag;
/* DOC(This field specifies a color in a 24, bit 3 channel RGB integer.) */
uint32_t color;
};

45
4ed.cpp
View File

@ -1119,10 +1119,9 @@ setup_command_table(){
internal void
app_hardcode_styles(Models *models){
Interactive_Style file_info_style;
Style *styles, *style;
styles = models->styles.styles;
style = styles + 1;
Interactive_Style file_info_style = {0};
Style *styles = models->styles.styles;
Style *style = styles + 1;
i16 fonts = 1;
models->global_font.font_id = fonts + 0;
@ -1318,6 +1317,44 @@ app_hardcode_styles(Models *models){
style->main.file_info_style = file_info_style;
++style;
/////////////////
style_set_name(style, make_lit_string("Magic"));
style->main.back_color = 0xFFF0F0F0;
style->main.margin_color = 0xFF9E9E9E;
style->main.margin_hover_color = 0xFF7E7E7E;
style->main.margin_active_color = 0xFF5C5C5C;
style->main.cursor_color = 0xFF000000;
style->main.at_cursor_color = 0xFFD6D6D6;
style->main.mark_color = 0xFF525252;
style->main.highlight_color = 0xFFB87600;
style->main.at_highlight_color = 0xFF000000;
style->main.default_color = 0xFF000000;
style->main.comment_color = 0xFF007E00;
style->main.keyword_color = 0xFF8B4303;
style->main.str_constant_color = 0xFF7C0000;
style->main.char_constant_color = 0xFF7C0000;
style->main.include_color = 0xFF7C0000;
style->main.int_constant_color = 0xFF007C00;
style->main.float_constant_color = 0xFF007C00;
style->main.bool_constant_color = 0xFF007C00;
style->main.preproc_color = 0xFF0000FF;
style->main.special_character_color = 0xFF9A0000;
style->main.paste_color = 0xFFB87600;
style->main.undo_color = 0xFFB87600;
style->main.highlight_junk_color = 0xFFFF7878;
style->main.highlight_white_color = 0xFFB87600;
file_info_style.bar_color = 0xFF606060;
file_info_style.bar_active_color = 0xFF3E3E3E;
file_info_style.base_color = 0xFFFFFFFF;
file_info_style.pop1_color = 0xFF007E00;
file_info_style.pop2_color = 0xFFE80505;
style->main.file_info_style = file_info_style;
++style;
models->styles.count = (i32)(style - styles);
models->styles.max = ArrayCount(models->styles.styles);
style_copy(main_style(models), models->styles.styles + 1);

View File

@ -916,10 +916,10 @@ DOC_RETURN(returns non-zero if the save succeeds)
API_EXPORT int
Kill_Buffer(Application_Links *app, Buffer_Identifier buffer, int view_id, unsigned int flags)/*
DOC_PARAM(buffer, a buffer identifier specifying the buffer to try to kill)
DOC_PARAM(view_id, the id of view that will contain the "are you sure" dialogue)
DOC_PARAM(flags, flags for buffer kill behavior)
DOC_RETURN(returns non-zero if the kill succeeds)
DOC_PARAM(buffer, A buffer identifier specifying the buffer to try to kill.)
DOC_PARAM(view_id, The id of view that will contain the "are you sure" dialogue.)
DOC_PARAM(flags, Flags for buffer kill behavior.)
DOC_RETURN(Returns non-zero if the kill succeeds.)
DOC
(
Tries to kill the idenfied buffer. If the buffer is dirty and the "are you sure"

View File

@ -24,7 +24,7 @@ struct App_Settings{
};
struct Debug_Input_Event{
Code key;
Key_Code key;
char consumer[32];

View File

@ -3687,8 +3687,11 @@ get_exhaustive_info(System_Functions *system, Working_Set *working_set, Exhausti
terminate_with_null(&loop->full_path);
file = working_set_contains(system, working_set, loop->full_path);
String filename = make_string(result.info->filename,
result.info->filename_len, result.info->filename_len+1);
result.is_folder = (result.info->folder != 0);
result.name_match = (filename_match(loop->front_name, &loop->absolutes, result.info->filename, 0) != 0);
result.name_match = (filename_match(loop->front_name, &loop->absolutes, filename, 0) != 0);
result.is_loaded = (file != 0 && file_is_ready(file));
result.message = string_zero();
@ -4389,7 +4392,12 @@ step_file_view(System_Functions *system, View *view, View *active_view, Input_Su
if (file_info.name_match){
id.id[0] = (u64)(file_info.info);
if (gui_do_file_option(target, id, file_info.info->filename,
String filename = make_string(file_info.info->filename,
file_info.info->filename_len,
file_info.info->filename_len+1);
if (gui_do_file_option(target, id, filename,
file_info.is_folder, file_info.message)){
if (file_info.is_folder){
set_last_folder(&hdir->string, file_info.info->filename, '/');

View File

@ -21,6 +21,8 @@
#include "4coder_version.h"
#include "4coder_mem.h"
struct Struct_Field{
char *type;
char *name;
@ -153,7 +155,7 @@ char* generate_keycode_enum(){
unsigned char code = 1;
file = fopen(filename, "wb");
fprintf(file, "enum Key_Code{\n");
fprintf(file, "enum Key_Code_Names{\n");
count = ArrayCount(keys_that_need_codes);
for (i = 0; i < count; i){
if (strcmp(keys_that_need_codes[i], "f1") == 0 && code < 0x7F){
@ -346,7 +348,7 @@ typedef struct Documentation{
String *see_also;
} Documentation;
typedef struct Function_Set{
struct Function_Set{
String *name;
String *ret;
String *args;
@ -359,7 +361,40 @@ typedef struct Function_Set{
Argument_Breakdown *breakdown;
Documentation *doc;
} Function_Set;
};
struct Typedef_Set{
String *type;
String *name;
String *doc_string;
};
struct Struct_Member{
String name;
String type;
String type_postfix;
String doc_string;
Struct_Member *first_child;
Struct_Member *next_sibling;
};
struct Struct_Set{
Struct_Member *structs;
};
struct Enum_Member{
String name;
String value;
String doc_string;
Enum_Member *next;
};
struct Enum_Set{
String *name;
String *type;
Enum_Member **first_member;
String *doc_string;
};
void
zero_index(Function_Set fnc_set, int sig_count){
@ -663,16 +698,614 @@ perform_doc_parse(String doc_string, Documentation *doc){
}while(keep_parsing);
}
static int
get_type_doc_string(Cpp_File file, Cpp_Token *tokens, int i,
String *doc_string){
int result = false;
if (i > 0){
Cpp_Token *prev_token = tokens + i - 1;
if (prev_token->type == CPP_TOKEN_COMMENT){
*doc_string = make_string(file.data + prev_token->start, prev_token->size);
if (check_and_fix_docs(doc_string)){
result = true;
}
}
}
return(result);
}
static int
parse_struct(Partition *part, int is_struct,
Cpp_File file, Cpp_Token *tokens, int count,
Cpp_Token **token_ptr,
Struct_Member *top_member);
static int
parse_struct_member(Partition *part,
Cpp_File file, Cpp_Token *tokens, int count,
Cpp_Token **token_ptr,
Struct_Member *member){
int result = false;
Cpp_Token *token = *token_ptr;
int i = (int)(token - tokens);
String doc_string = {0};
get_type_doc_string(file, tokens, i, &doc_string);
int start_i = i;
Cpp_Token *start_token = token;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_SEMICOLON){
break;
}
}
if (i < count){
Cpp_Token *token_j = token;
int nest_level = 0;
for (int j = i; j > start_i; --j, --token_j){
if (token_j->type == CPP_TOKEN_BRACKET_CLOSE){
++nest_level;
}
else if (token_j->type == CPP_TOKEN_BRACKET_OPEN){
--nest_level;
if (nest_level < 0){
j = start_i;
break;
}
}
if (nest_level == 0){
if (token_j->type == CPP_TOKEN_IDENTIFIER){
break;
}
}
}
String name = make_string(file.data + token_j->start, token_j->size);
name = skip_chop_whitespace(name);
int type_start = start_token->start;
int type_end = token_j->start;
String type = make_string(file.data + type_start, type_end - type_start);
type = skip_chop_whitespace(type);
type_start = token_j->start + token_j->size;
type_end = token->start;
String type_postfix = make_string(file.data + type_start, type_end - type_start);
type_postfix = skip_chop_whitespace(type_postfix);
++token;
result = true;
member->name = name;
member->type = type;
member->type_postfix = type_postfix;
member->doc_string = doc_string;
member->first_child = 0;
member->next_sibling = 0;
}
*token_ptr = token;
return(result);
}
static Struct_Member*
parse_struct_next_member(Partition *part,
Cpp_File file, Cpp_Token *tokens, int count,
Cpp_Token **token_ptr){
Struct_Member *result = 0;
Cpp_Token *token = *token_ptr;
int i = (int)(token - tokens);
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_IDENTIFIER ||
(token->flags & CPP_TFLAG_IS_KEYWORD)){
String lexeme = make_string(file.data + token->start, token->size);
if (match(lexeme, make_lit_string("struct"))){
Struct_Member *member = push_struct(part, Struct_Member);
if (parse_struct(part, true, file, tokens, count, &token, member)){
result = member;
break;
}
else{
assert(!"unhandled error");
}
}
else if (match(lexeme, make_lit_string("union"))){
Struct_Member *member = push_struct(part, Struct_Member);
if (parse_struct(part, false, file, tokens, count, &token, member)){
result = member;
break;
}
else{
assert(!"unhandled error");
}
}
else{
Struct_Member *member = push_struct(part, Struct_Member);
if (parse_struct_member(part, file, tokens, count, &token, member)){
result = member;
break;
}
else{
assert(!"unhandled error");
}
}
}
else if (token->type == CPP_TOKEN_BRACE_CLOSE){
break;
}
}
*token_ptr = token;
return(result);
}
static int
parse_struct(Partition *part, int is_struct,
Cpp_File file, Cpp_Token *tokens, int count,
Cpp_Token **token_ptr,
Struct_Member *top_member){
int result = false;
Cpp_Token *token = *token_ptr;
int i = (int)(token - tokens);
String doc_string = {0};
get_type_doc_string(file, tokens, i, &doc_string);
int start_i = i;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_BRACE_OPEN){
break;
}
}
if (i < count){
Cpp_Token *token_j = token;
int j = i;
for (; j > start_i; --j, --token_j){
if (token_j->type == CPP_TOKEN_IDENTIFIER){
break;
}
}
String name = {0};
if (j != start_i){
name = make_string(file.data + token_j->start, token_j->size);
name = skip_chop_whitespace(name);
}
String type = {0};
if (is_struct){
type = make_lit_string("struct");
}
else{
type = make_lit_string("union");
}
++token;
Struct_Member *new_member =
parse_struct_next_member(part, file, tokens, count, &token);
if (new_member){
top_member->first_child = new_member;
Struct_Member *head_member = new_member;
for(;;){
new_member =
parse_struct_next_member(part, file, tokens, count, &token);
if (new_member){
head_member->next_sibling = new_member;
head_member = new_member;
}
else{
break;
}
}
}
i = (int)(token - tokens);
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_SEMICOLON){
break;
}
}
++token;
top_member->name = name;
top_member->type = type;
top_member->doc_string = doc_string;
top_member->next_sibling = 0;
result = true;
}
*token_ptr = token;
return(result);
}
static void
print_struct_html(FILE *file, Struct_Member *member){
String name = member->name;
String type = member->type;
String type_postfix = member->type_postfix;
if (match(type, make_lit_string("struct")) ||
match(type, make_lit_string("union"))){
fprintf(file,
"%.*s %.*s {<br>\n"
"<div style='margin-left: 8mm;'>\n",
type.size, type.str,
name.size, name.str);
for (Struct_Member *member_iter = member->first_child;
member_iter != 0;
member_iter = member_iter->next_sibling){
print_struct_html(file, member_iter);
}
fprintf(file,
"</div>\n"
"};<br>\n");
}
else{
fprintf(file,
"%.*s %.*s%.*s;<br>\n",
type.size, type.str,
name.size, name.str,
type_postfix.size, type_postfix.str
);
}
}
static int
parse_enum(Partition *part, Cpp_File file,
Cpp_Token *tokens, int count,
Cpp_Token **token_ptr, int start_i,
Enum_Set flag_set, int flag_index){
int result = false;
Cpp_Token *token = *token_ptr;
int i = (int)(token - tokens);
if (i < count){
Cpp_Token *token_j = token;
for (int j = i; j > start_i; --j, --token_j){
if (token_j->type == CPP_TOKEN_IDENTIFIER){
break;
}
}
String name = make_string(file.data + token_j->start, token_j->size);
name = skip_chop_whitespace(name);
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_BRACE_OPEN){
break;
}
}
if (i < count){
Enum_Member *first_member = 0;
Enum_Member *head_member = 0;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_BRACE_CLOSE){
break;
}
else if (token->type == CPP_TOKEN_IDENTIFIER){
String doc_string = {0};
get_type_doc_string(file, tokens, i, &doc_string);
String name = make_string(file.data + token->start, token->size);
name = skip_chop_whitespace(name);
String value = {0};
++i;
++token;
if (token->type == CPP_TOKEN_EQ){
Cpp_Token *start_token = token;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_COMMA ||
token->type == CPP_TOKEN_BRACE_CLOSE){
break;
}
}
int val_start = start_token->start + start_token->size;
int val_end = token->start;
value = make_string(file.data + val_start, val_end - val_start);
value = skip_chop_whitespace(value);
--i;
--token;
}
else{
--i;
--token;
}
Enum_Member *new_member = push_struct(part, Enum_Member);
if (first_member == 0){
first_member = new_member;
}
if (head_member){
head_member->next = new_member;
}
head_member = new_member;
new_member->name = name;
new_member->value = value;
new_member->doc_string = doc_string;
new_member->next = 0;
}
}
if (i < count){
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_BRACE_CLOSE){
break;
}
}
++i;
++token;
result = true;
flag_set.name[flag_index] = name;
flag_set.first_member[flag_index] = first_member;
}
}
}
*token_ptr = token;
return(result);
}
char*
generate_custom_headers(){
#define API_H "4coder_custom_api.h"
#define API_DOC "4coder_API.html"
int size = Mbytes(512);
void *mem = malloc(size);
memset(mem, 0, size);
Partition part_ = make_part(mem, size);
Partition *part = &part_;
char *filename = API_H " & " API_DOC;
Function_Set function_set = {0};
Typedef_Set typedef_set = {0};
Struct_Set struct_set = {0};
Enum_Set flag_set = {0};
Enum_Set enum_set = {0};
String type_code = file_dump("4coder_types.h");
// TODO(allen): KILL THIS FUCKIN' Cpp_File FUCKIN' NONSENSE HORSE SHIT!!!!!
Cpp_File type_file;
type_file.data = type_code.str;
type_file.size = type_code.size;
Cpp_Token_Stack types_tokens = cpp_make_token_stack(512);
cpp_lex_file(type_file, &types_tokens);
int typedef_count = 0;
int struct_count = 0;
int flag_count = 0;
int enum_count = 0;
{
int count = types_tokens.count;
Cpp_Token *tokens = types_tokens.tokens;
Cpp_Token *token = tokens;
static String type_spec_keys[] = {
make_lit_string("typedef"),
make_lit_string("struct"),
make_lit_string("union"),
make_lit_string("ENUM"),
make_lit_string("FLAGENUM"),
};
for (int i = 0; i < count; ++i, ++token){
if (!(token->flags & CPP_TFLAG_PP_BODY) &&
(token->type == CPP_TOKEN_KEY_TYPE_DECLARATION ||
token->type == CPP_TOKEN_IDENTIFIER)){
String lexeme = make_string(type_file.data + token->start, token->size);
int match_index = 0;
if (string_set_match(type_spec_keys, ArrayCount(type_spec_keys),
lexeme, &match_index)){
switch (match_index){
case 0: //typedef
++typedef_count; break;
case 1: case 2: //struct/union
++struct_count; break;
case 3: //ENUM
++enum_count; break;
case 4: //FLAGENUM
++flag_count; break;
}
}
}
}
if (typedef_count > 0){
typedef_set.type = push_array(part, String, typedef_count);
typedef_set.name = push_array(part, String, typedef_count);
typedef_set.doc_string = push_array(part, String, typedef_count);
}
if (struct_count > 0){
struct_set.structs = push_array(part, Struct_Member, struct_count);
}
if (enum_count > 0){
enum_set.name = push_array(part, String, enum_count);
enum_set.type = push_array(part, String, enum_count);
enum_set.first_member = push_array(part, Enum_Member*, enum_count);
enum_set.doc_string = push_array(part, String, enum_count);
}
if (flag_count > 0){
flag_set.name = push_array(part, String, flag_count);
flag_set.first_member = push_array(part, Enum_Member*, flag_count);
flag_set.doc_string = push_array(part, String, flag_count);
}
int typedef_index = 0;
int struct_index = 0;
int flag_index = 0;
int enum_index = 0;
token = tokens;
for (int i = 0; i < count; ++i, ++token){
if (!(token->flags & CPP_TFLAG_PP_BODY) &&
(token->type == CPP_TOKEN_KEY_TYPE_DECLARATION ||
token->type == CPP_TOKEN_IDENTIFIER)){
String lexeme = make_string(type_file.data + token->start, token->size);
int match_index = 0;
if (string_set_match(type_spec_keys, ArrayCount(type_spec_keys),
lexeme, &match_index)){
switch (match_index){
case 0: //typedef
{
String doc_string = {0};
get_type_doc_string(type_file, tokens, i, &doc_string);
int start_i = i;
Cpp_Token *start_token = token;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_SEMICOLON){
break;
}
}
if (i < count){
Cpp_Token *token_j = token;
for (int j = i; j > start_i; --j, --token_j){
if (token_j->type == CPP_TOKEN_IDENTIFIER){
break;
}
}
String name = make_string(type_file.data + token_j->start, token_j->size);
name = skip_chop_whitespace(name);
int type_start = start_token->start + start_token->size;
int type_end = token_j->start;
String type = make_string(type_file.data + type_start, type_end - type_start);
type = skip_chop_whitespace(type);
typedef_set.type[typedef_index] = type;
typedef_set.name[typedef_index] = name;
typedef_set.doc_string[typedef_index] = doc_string;
++typedef_index;
}
}break;
case 1: case 2: //struct/union
{
if (parse_struct(part, (match_index == 1),
type_file, tokens, count, &token,
struct_set.structs + struct_index)){
++struct_index;
}
i = (int)(token - tokens);
}break;
case 3: //ENUM
{
String doc_string = {0};
get_type_doc_string(type_file, tokens, i, &doc_string);
int start_i = i;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_PARENTHESE_CLOSE){
break;
}
}
if (parse_enum(part, type_file,
tokens, count,
&token, start_i,
enum_set, enum_index)){
enum_set.doc_string[enum_index] = doc_string;
++enum_index;
}
}break;
case 4: //FLAGENUM
{
String doc_string = {0};
get_type_doc_string(type_file, tokens, i, &doc_string);
int start_i = i;
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_PARENTHESE_CLOSE){
break;
}
}
if (parse_enum(part, type_file,
tokens, count,
&token, start_i,
flag_set, flag_index)){
flag_set.doc_string[flag_index] = doc_string;
++flag_index;
}
}break;
}
}
}
}
typedef_count = typedef_index;
struct_count = struct_index;
enum_count = enum_index;
flag_count = flag_index;
}
// NOTE(allen): Documentation
String code_data[2];
code_data[0] = file_dump("4ed_api_implementation.cpp");
code_data[1] = file_dump("win32_api_impl.cpp");
@ -1024,6 +1657,10 @@ generate_custom_headers(){
"margin: 0; "
"}\n"
"h3 { "
"margin-top: 5mm; margin-bottom: 5mm; "
"}\n"
"h4 { "
"font-size: 1.1em; "
"}\n"
@ -1091,8 +1728,8 @@ generate_custom_headers(){
for (int i = 0; i < sig_count; ++i){
String name = function_set.public_name[i];
fprintf(file,
"<li>\n"
"<a href='#%.*s_doc'>%.*s</a>\n"
"<li>"
"<a href='#%.*s_doc'>%.*s</a>"
"</li>\n",
name.size, name.str,
name.size, name.str
@ -1103,16 +1740,73 @@ generate_custom_headers(){
#undef SECTION
#define SECTION "2.2"
fprintf(file, "<h3 style='margin-top: 5mm; margin-bottom: 5mm;'>&sect;"SECTION" Descriptions</h3>\n");
fprintf(file,
"<h3>&sect;"SECTION" Type List</h3>\n"
"<ul>\n"
);
for (int i = 0; i < typedef_count; ++i){
String name = typedef_set.name[i];
fprintf(file,
"<li>"
"<a href='#%.*s_doc'>%.*s</a>"
"</li>\n",
name.size, name.str,
name.size, name.str
);
}
for (int i = 0; i < enum_count; ++i){
String name = enum_set.name[i];
fprintf(file,
"<li>"
"<a href='#%.*s_doc'>%.*s</a>"
"</li>\n",
name.size, name.str,
name.size, name.str
);
}
for (int i = 0; i < flag_count; ++i){
String name = flag_set.name[i];
fprintf(file,
"<li>"
"<a href='#%.*s_doc'>%.*s</a>"
"</li>\n",
name.size, name.str,
name.size, name.str
);
}
for (int i = 0; i < struct_count; ++i){
String name = struct_set.structs[i].name;
fprintf(file,
"<li>"
"<a href='#%.*s_doc'>%.*s</a>"
"</li>\n",
name.size, name.str,
name.size, name.str
);
}
fprintf(file, "</ul>\n");
#define DESCRIPT_SECTION_STYLE \
"margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; " \
"background: "CODE_BACK"; padding: 0.25em;"
#undef SECTION
#define SECTION "2.3"
fprintf(file, "<h3>&sect;"SECTION" Function Descriptions</h3>\n");
for (int i = 0; i < sig_count; ++i){
String name = function_set.public_name[i];
fprintf(file,
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
" <h4>&sect;"SECTION".%d: %.*s</h4>\n"
" <div style='"CODE_STYLE" margin-top: 3mm; margin-bottom: 3mm; font-size: .95em; "
"background: "CODE_BACK"; padding: 0.25em;'>",
name.size, name.str, i,
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
name.size, name.str, i+1,
name.size, name.str
);
@ -1205,6 +1899,124 @@ generate_custom_headers(){
}
}
fprintf(file, "</div><hr>\n");
}
#undef SECTION
#define SECTION "2.4"
fprintf(file, "<h3>&sect;"SECTION" Type Descriptions</h3>\n");
int I = 1;
for (int i = 0; i < typedef_count; ++i, ++I){
String name = typedef_set.name[i];
String type = typedef_set.type[i];
fprintf(file,
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
" <h4>&sect;"SECTION".%d: %.*s</h4>\n"
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
name.size, name.str, I,
name.size, name.str
);
// NOTE(allen): Code box
{
fprintf(file,
"typedef %.*s %.*s;",
type.size, type.str,
name.size, name.str
);
}
fprintf(file, "</div>\n");
// NOTE(allen): Descriptive section
{
}
fprintf(file, "</div><hr>\n");
}
for (int i = 0; i < enum_count; ++i, ++I){
String name = enum_set.name[i];
fprintf(file,
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
" <h4>&sect;"SECTION".%d: %.*s</h4>\n"
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
name.size, name.str, I,
name.size, name.str
);
// NOTE(allen): Code box
{
fprintf(file,
"enum %.*s;",
name.size, name.str);
}
fprintf(file, "</div>\n");
// NOTE(allen): Descriptive section
{
}
fprintf(file, "</div><hr>\n");
}
for (int i = 0; i < flag_count; ++i, ++I){
String name = flag_set.name[i];
fprintf(file,
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
" <h4>&sect;"SECTION".%d: %.*s</h4>\n"
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
name.size, name.str, I,
name.size, name.str
);
// NOTE(allen): Code box
{
fprintf(file,
"enum %.*s;",
name.size, name.str);
}
fprintf(file, "</div>\n");
// NOTE(allen): Descriptive section
{
}
fprintf(file, "</div><hr>\n");
}
for (int i = 0; i < struct_count; ++i, ++I){
Struct_Member *member = &struct_set.structs[i];
String name = member->name;
fprintf(file,
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
" <h4>&sect;"SECTION".%d: %.*s</h4>\n"
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
name.size, name.str, I,
name.size, name.str
);
// NOTE(allen): Code box
{
print_struct_html(file, member);
}
fprintf(file, "</div>\n");
// NOTE(allen): Descriptive section
{
}
fprintf(file, "</div><hr>\n");
}
}

View File

@ -1,4 +1,4 @@
Distribution Date: 29.6.2016 (dd.mm.yyyy)
Distribution Date: 30.6.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project!

View File

@ -1,4 +1,4 @@
Distribution Date: 29.6.2016 (dd.mm.yyyy)
Distribution Date: 30.6.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project!

View File

@ -794,12 +794,11 @@ Sys_Set_File_List_Sig(system_set_file_list){
if (!match(find_data.cFileName, ".") &&
!match(find_data.cFileName, "..")){
info->folder = (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
info->filename.str = name;
info->filename = name;
i32 i = 0;
for(;find_data.cFileName[i];++i) *name++ = find_data.cFileName[i];
info->filename.size = i;
info->filename.memory_size = info->filename.size + 1;
info->filename_len = i;
*name++ = 0;
replace_char(info->filename, '\\', '/');
++info;

View File

@ -99,9 +99,9 @@ also be used with rel set to ".." to traverse to parent folders.
API_EXPORT int
Get_4ed_Path(Application_Links *app, char *out, int capacity)/*
DOC_PARAM(out, a buffer that receives the path to the 4ed executable file)
DOC_PARAM(capacity, the maximum capacity of the output buffer)
DOC_RETURN(returns non-zero on success, returns zero on failure)
DOC_PARAM(out, A char buffer that receives the path to the 4ed executable file.)
DOC_PARAM(capacity, The maximum capacity of the output buffer.)
DOC_RETURN(Returns non-zero on success, returns zero on failure.)
*/{
String str = make_string(out, 0, capacity);
return(system_get_binary_path(&str));
@ -110,9 +110,20 @@ DOC_RETURN(returns non-zero on success, returns zero on failure)
// TODO(allen): add a "shown but auto-hides on timer" setting here.
API_EXPORT void
Show_Mouse_Cursor(Application_Links *app, int show)/*
DOC_PARAM(show, The show state to put the mouse cursor into. If this is 1 the mouse cursor is shown. If it is 0 the mouse cursor is hidden.)
DOC_PARAM(show, The show state to put the mouse cursor into, should be one of the Mouse_Cursor_Show_Type enum values.)
DOC_SEE(Mouse_Cursor_Show_Type)
*/{
ShowCursor(show);
switch (show){
case MouseCursorShow_Never:
ShowCursor(false);
break;
case MouseCursorShow_Always:
ShowCursor(true);
break;
// TODO(allen): MouseCursor_HideWhenStill
}
}
// BOTTOM