diff --git a/4coder_API.html b/4coder_API.html
index 24252cbb..ab990ab1 100644
--- a/4coder_API.html
+++ b/4coder_API.html
@@ -24,8 +24,9 @@ This is the documentation for alpha 4.0.9 super! The documentation has been made
-§2 Types and Functions
-§2.1 Function List
+§2 4coder Systems
+§3 Types and Functions
+§3.1 Function List
-§2.2 Type List
+§3.2 Type List
-§2.3 Function Descriptions
+§3.3 Function Descriptions
-
§2.3.1: exec_command
-
void app->exec_command(
-
Application_Links *app,
uint64_t command_id
)
+
§3.3.1: exec_command
+
bool32 app->exec_command(
+
Application_Links *app,
Command_ID command_id
)
Parameters
command_id
-
an integer id enumerated in 4coder_custom.h starting with cmdid
+
The command_id parameter specifies which internal command to execute.
-
Description
Executes the command associated with the command_id passed in
+
Return
This call returns non-zero if command_id named a valid internal command.
Description
A call to exec_command executes an internal command.
+If command_id is invalid a warning is posted to *messages*.
See Also
-
§2.3.2: exec_system_command
-
int app->exec_system_command(
-
Application_Links *app,
View_Summary *view,
Buffer_Identifier buffer,
char *path,
int path_len,
char *command,
int command_len,
unsigned int flags
)
+
§3.3.2: exec_system_command
+
bool32 app->exec_system_command(
+
Application_Links *app,
View_Summary *view,
Buffer_Identifier buffer,
char *path,
int32_t path_len,
char *command,
int32_t command_len,
Command_Line_Input_Flag flags
)
Parameters
view
-
the target view that will display the output buffer, may be NULL, see description for details
+
If the view parameter is non-null it specifies a view to display the command's output buffer.
buffer
-
a buffer identifier for the buffer that will be filled with the output from the command
+
The buffer the command will output to is specified by the buffer parameter.
+See Buffer_Identifier for information on how this type specifies a buffer.
path
-
the path from which the command is executed
+
The path parameter specifies the path in which the command shall be executed. The string need not be null terminated.
path_len
-
the length of the path string
+
The parameter path_len specifies the length of the path string.
command
-
the command to be executed
+
The command parameter specifies the command that shall be executed. The string need not be null terminated.
command_len
-
the length of the command string
+
The parameter command_len specifies the length of the command string.
flags
-
may be zero or one or more CLI flags ORed together
+
Flags for the behavior of the call are specified in the flags parameter.
-
Return
returns non-zero if the command is successfully started, returns zero otherwise
Description
Executes a system command as if called from the command line, and sends the output to a buffer. The buffer
-identifier can either name a new buffer that does not exist, name a buffer that does exist, or provide the
-id of a buffer that does exist. If the buffer already exists the command will fail, unless
-CLI_OverlapWithConflict is set in the flags.
+
Return
This call returns non-zero on success.
Description
A call to exec_system_command executes a command as if called from the command line, and sends the output to
+a buffer. The buffer identifier can either name a new buffer that does not exist, name a buffer that does
+exist, or provide the id of a buffer that does exist.
-If the buffer is not already in an open view, and the view parameter is no NULL, then the provided view
-will display the output buffer. If the view parameter is NULL, no view will display the output.
+If the buffer is not already in an open view and the view parameter is not NULL,
+then the provided view will display the output buffer.
-If CLI_OverlapWithConflict is set in the flags, the command will always be executed even if another command
-was outputting to the same buffer still.
-
-If CLI_AlwaysBindToView is set and the view parameter is not NULL, then the specified view will always
-begin displaying the output buffer, even if another open view already displays that buffer.
-
-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.
+If the view parameter is NULL, no view will switch to the output.
See Also
-
§2.3.3: clipboard_post
+
§3.3.3: clipboard_post
void app->clipboard_post(
-
Application_Links *app,
char *str,
int len
)
+
Application_Links *app,
int32_t clipboard_id,
char *str,
int32_t len
)
Parameters
+
clipboard_id
+
This parameter is set up to prepare for future features, it should always be 0 for now.
+
+
str
-
the string to post to the clipboard
+
The str parameter specifies the string to be posted to the clipboard, it need not be null terminated.
len
-
the length of the string str
+
The len parameter specifies the length of the str string.
Description
Stores the string str in the clipboard initially with index 0.
Also reports the copy to the operating system, so that it may
-be pasted into other applications.
+be pasted into other applications.See Also
-
§2.3.4: clipboard_count
-
int app->clipboard_count(
-
Application_Links *app
)
-
-
Description
returns the number of items in the clipboard
-
-
§2.3.5: clipboard_index
-
int app->clipboard_index(
-
Application_Links *app,
int index,
char *out,
int len
)
+
§3.3.4: clipboard_count
+
int32_t app->clipboard_count(
+
Application_Links *app,
int32_t clipboard_id
)
Parameters
-
index
-
the index of the item to be read
+
clipboard_id
+
This parameter is set up to prepare for future features, it should always be 0 for now.
+
+
Description
This call returns the number of items in the clipboard.
See Also
+
+
§3.3.5: clipboard_index
+
int32_t app->clipboard_index(
+
Application_Links *app,
int32_t clipboard_id,
int32_t item_index,
char *out,
int32_t len
)
+
+
Parameters
+
clipboard_id
+
This parameter is set up to prepare for future features, it should always be 0 for now.
+
+
+
item_index
+
This parameter specifies which item to read, 0 is the most recent copy, 1 is the second most recent copy, etc.
out
@@ -206,286 +218,283 @@ be pasted into other applications.
len
the length of the out buffer
-Return
returns the size of the item on the clipboard associated with the given index
Description
There are multiple items on the 4coder clipboard. The most recent copy is always at
-index 0. The second most recent is at index 1, and so on for all the stored clipboard items.
-This function reads one of the clipboard items and stores it into the out buffer, if the out
-buffer is not NULL. This function always returns the size of the clipboard item specified
-even if the output buffer is NULL. If the output buffer is too small to contain the whole
-string, it is filled with the first len character of the clipboard contents. The output
-string is not null terminated.
+Return
This call returns the size of the item associated with item_index.
Description
This function always returns the size of the item even if the output buffer is NULL.
+If the output buffer is too small to contain the whole string, it is filled with the
+first len character of the clipboard contents. The output string is not null terminated.
See Also
-
§2.3.6: get_buffer_first
+
§3.3.6: get_buffer_first
Buffer_Summary app->get_buffer_first(
-
Application_Links *app,
unsigned int access
)
+
Application_Links *app,
Access_Flag access
)
Parameters
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns the summary of the first buffer in a buffer loop
Description
Begins a loop across all the buffers.
+
Return
This call returns the summary of the first buffer in a buffer loop.
Description
This call begins a loop across all the buffers.
-If the buffer returned does not exist, the loop is finished. Buffers
-should not be killed durring a buffer loop.
See Also
+If the buffer returned does not exist, the loop is finished.
+Buffers should not be killed durring a buffer loop.
See Also
-
§2.3.7: get_buffer_next
+
§3.3.7: get_buffer_next
void app->get_buffer_next(
-
Application_Links *app,
Buffer_Summary *buffer,
unsigned int access
)
+
Application_Links *app,
Buffer_Summary *buffer,
Access_Flag access
)
Parameters
buffer
-
pointer to the loop buffer originally returned by get_buffer_first
+
The buffer summary pointed to by buffer is iterated to the next buffer or to a null summary if this is the last buffer.
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access. The buffer outputted will be the next buffer that is accessible.
-
Description
Writes the next buffer into the buffer struct. To get predictable results every
-call to get_buffer_first and get_buffer_next in the loop should have the same
-access flags.
+
Description
This call steps a buffer summary to the next buffer in the global buffer order.
+The global buffer order is kept roughly in the order of most recently used to least recently used.
-If the buffer returned does not exist, the loop is finished. Buffers
-should not be killed durring a buffer loop.
See Also
+If the buffer outputted does not exist, the loop is finished.
+Buffers should not be killed or created durring a buffer loop.
See Also
-
§2.3.8: get_buffer
+
§3.3.8: get_buffer
Buffer_Summary app->get_buffer(
-
Application_Links *app,
int buffer_id,
unsigned int access
)
+
Application_Links *app,
Buffer_ID buffer_id,
Access_Flag access
)
Parameters
buffer_id
-
the id of the buffer to get
+
The parameter buffer_id specifies which buffer to try to get.
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns a summary that describes the indicated buffer if it exists and is accessible
+Return
This call returns a summary that describes the indicated buffer if it exists and is accessible.
See Also
-
§2.3.9: get_buffer_by_name
+
§3.3.9: get_buffer_by_name
Buffer_Summary app->get_buffer_by_name(
-
Application_Links *app,
char *name,
int len,
unsigned int access
)
+
Application_Links *app,
char *name,
int32_t len,
Access_Flag access
)
Parameters
name
-
+
The name parameter specifies the buffer name to try to get. The string need not be null terminated.
len
-
the length of the name string
+
The len parameter specifies the length of the name string.
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns a summary that describes the indicated buffer if it exists and is accessible
+Return
This call returns a summary that describes the indicated buffer if it exists and is accessible.
See Also
-
§2.3.10: buffer_boundary_seek
-
int app->buffer_boundary_seek(
-
Application_Links *app,
Buffer_Summary *buffer,
int start_pos,
int seek_forward,
unsigned int flags
)
+
§3.3.10: buffer_boundary_seek
+
int32_t app->buffer_boundary_seek(
+
Application_Links *app,
Buffer_Summary *buffer,
int32_t start_pos,
bool32 seek_forward,
Seek_Boundary_Flag flags
)
Parameters
buffer
-
the buffer to seek through
+
The buffer parameter specifies the buffer through which to seek.
start_pos
-
the absolute position in the buffer to begin the seek
+
The beginning position of the seek is specified by start_pos measured in absolute position.
seek_forward
-
non-zero indicates to seek forward otherwise the seek goes backward
+
If this parameter is non-zero it indicates that the seek should move foward through the buffer.
flags
-
one or more types of boundaries to use for stopping the seek
+
This field specifies the types of boundaries at which the seek should stop.
-
Return
returns the position where the seek stops
See Also
+
Return
This call returns the absolute position where the seek stopped.
+If the seek goes below 0 the returned value is -1.
+If the seek goes past the end the returned value is the size of the buffer.
See Also
-
§2.3.11: buffer_read_range
-
int app->buffer_read_range(
-
Application_Links *app,
Buffer_Summary *buffer,
int start,
int end,
char *out
)
+
§3.3.11: buffer_read_range
+
bool32 app->buffer_read_range(
+
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
char *out
)
Parameters
buffer
-
+
This parameter specifies the buffer to read.
start
-
The beginning of the read range.
+
This parameter specifies absolute position of the first character in the read range.
end
-
One past the end of the read range.
+
This parameter specifies the absolute position of the the character one past the end of the read range.
out
-
The output buffer to fill with the result of the read.
+
This paramter provides the output character buffer to fill with the result of the read.
-
Return
Returns non-zero on success.
Description
The output buffer must have a capacity of at least (end - start).
+
Return
This call returns non-zero if the read succeeds.
Description
The output buffer must have a capacity of at least (end - start).
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.
+This call fails if the buffer does not exist,
+or if the read range is not within the bounds of the buffer.
See Also
-
§2.3.12: buffer_replace_range
-
int app->buffer_replace_range(
-
Application_Links *app,
Buffer_Summary *buffer,
int start,
int end,
char *str,
int len
)
+
§3.3.12: buffer_replace_range
+
bool32 app->buffer_replace_range(
+
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
char *str,
int32_t len
)
Parameters
buffer
-
+
This parameter specifies the buffer to edit.
start
-
the start of the range to edit
+
This parameter specifies absolute position of the first character in the replace range.
end
-
the end of the range to edit
+
This parameter specifies the absolute position of the the character one past the end of the replace range.
str
-
the string to write into the range
+
This parameter specifies the the string to write into the range; it need not be null terminated.
len
-
the length of the str string
+
This parameter specifies the length of the str string.
-
Return
returns non-zero if the replacement succeeds
Description
If this call succeeds it deletes the range from start to end
+
Return
This call returns non-zero if the replacement succeeds.
Description
If this call succeeds it deletes the range from start to end
and writes str in the same position. If end == start then
this call is equivalent to inserting the string at start.
If len == 0 this call is equivalent to deleteing the range
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.
+range is not within the bounds of the buffer.
See Also
-
§2.3.13: buffer_set_setting
-
int app->buffer_set_setting(
-
Application_Links *app,
Buffer_Summary *buffer,
int setting,
int value
)
+
§3.3.13: buffer_set_setting
+
bool32 app->buffer_set_setting(
+
Application_Links *app,
Buffer_Summary *buffer,
Buffer_Setting_ID setting,
int32_t value
)
Parameters
buffer
-
The buffer on which to set a setting.
+
The buffer parameter specifies the buffer on which to set a setting.
setting
-
One of the Buffer_Setting_ID enum values that identifies the setting to set.
+
The setting parameter identifies the setting that shall be changed.
value
-
The value to set the specified setting to.
+
The value parameter specifies the value to which the setting shall be changed.
See Also
-
§2.3.14: buffer_auto_indent
-
int app->buffer_auto_indent(
-
Application_Links *app,
Buffer_Summary *buffer,
int start,
int end,
int tab_width,
unsigned int flags
)
+
§3.3.14: buffer_auto_indent
+
bool32 app->buffer_auto_indent(
+
Application_Links *app,
Buffer_Summary *buffer,
int32_t start,
int32_t end,
int32_t tab_width,
Auto_Indent_Flag flags
)
Parameters
buffer
-
the buffer in which to apply the auto indenting
+
The buffer specifies the buffer in which to apply auto indentation.
start
-
the position to start the auto indenting
+
This parameter specifies the absolute position of the start of the indentation range.
end
-
the position to end the auto indenting
+
This parameter specifies the absolute position of the end of the indentation range.
tab_width
-
the number of spaces to place as a tab
+
The tab_width parameter specifies how many spaces should be used for one indentation in space mode.
flags
-
the auto tab behavior flags
+
This parameter specifies behaviors for the indentation.
-
Return
returns non-zero when the call succeeds
Description
Applies the built in auto-indentation rule to the code in the range from
+
Return
This call returns non-zero when the call succeeds.
Description
Applies the built in auto-indentation rule to the code in the range from
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.
See Also
+completed this function will fail.
See Also
-
§2.3.15: create_buffer
+
§3.3.15: create_buffer
Buffer_Summary app->create_buffer(
-
Application_Links *app,
char *filename,
int filename_len,
unsigned int flags
)
+
Application_Links *app,
char *filename,
int32_t filename_len,
Buffer_Create_Flag flags
)
Parameters
filename
-
the name of the file to be opened or created
+
The filename parameter specifies the name of the file to be opened or created; it need not be null terminated.
filename_len
-
the length of the filename string
+
The filename_len parameter spcifies the length of the filename string.
flags
-
flags for buffer creation behavior
+
The flags parameter specifies behaviors for buffer creation.
-
Return
returns the summary of the created buffer on success or a NULL buffer otherwise
Description
Tries to create a new buffer and associate it to the given filename. If such a buffer already
+
Return
This call returns the summary of the created buffer.
Description
Tries to create a new buffer and associate it to the given filename. If such a buffer already
exists the existing buffer is returned in the buffer summary and no new buffer is created.
If the buffer does not exist a new buffer is created and named after the given filename. If
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.
See Also
-
§2.3.16: save_buffer
-
int app->save_buffer(
-
Application_Links *app,
Buffer_Summary *buffer,
char *filename,
int filename_len,
unsigned int flags
)
+
§3.3.16: save_buffer
+
bool32 app->save_buffer(
+
Application_Links *app,
Buffer_Summary *buffer,
char *filename,
int32_t filename_len,
uint32_t flags
)
Parameters
buffer
-
the buffer to save to a file
+
The buffer parameter specifies the buffer to save to a file.
filename
-
the name of the file to save the buffer into
+
The filename parameter specifies the name of the file to associated to the buffer; it need not be null terminated.
filename_len
-
length of the filename string
+
The filename_len parameter specifies the length of the filename string.
flags
-
+
This parameter is not currently used and should be set to 0 for now.
-
Return
returns non-zero if the save succeeds
+
Return
This call returns non-zero on success.
-
§2.3.17: kill_buffer
-
int app->kill_buffer(
-
Application_Links *app,
Buffer_Identifier buffer,
int view_id,
unsigned int flags
)
+
§3.3.17: kill_buffer
+
bool32 app->kill_buffer(
+
Application_Links *app,
Buffer_Identifier buffer,
View_ID view_id,
Buffer_Kill_Flag flags
)
Parameters
buffer
-
A buffer identifier specifying the buffer to try to kill.
+
The buffer parameter specifies the buffer to try to kill.
view_id
-
The id of view that will contain the "are you sure" dialogue.
+
The view_id parameter specifies the view that will contain the "are you sure" dialogue if the buffer is dirty.
flags
-
Flags for buffer kill behavior.
+
The flags parameter specifies behaviors for the buffer kill.
-
Return
Returns non-zero if the kill succeeds.
Description
Tries to kill the idenfied buffer. If the buffer is dirty and the "are you sure"
+
Return
This call returns non-zero on success.
Description
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.
See Also
+If the view is not open the kill fails.
See Also
-
§2.3.18: get_view_first
+
§3.3.18: get_view_first
View_Summary app->get_view_first(
-
Application_Links *app,
unsigned int access
)
+
Application_Links *app,
Access_Flag access
)
Parameters
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns the summary of the first view in a view loop
Description
Begins a loop across all the open views.
+
Return
This call returns the summary of the first view in a view loop.
Description
This call begins a loop across all the open views.
-If the view summary returned is NULL, the loop is finished.
+If the view summary returned is a null summary, the loop is finished.
Views should not be closed or opened durring a view loop.
See Also
-
§2.3.19: get_view_next
+
§3.3.19: get_view_next
void app->get_view_next(
-
Application_Links *app,
View_Summary *view,
unsigned int access
)
+
Application_Links *app,
View_Summary *view,
Access_Flag access
)
Parameters
view
@@ -493,323 +502,328 @@ Views should not be closed or opened durring a view loop.
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access. The view outputted will be the next view that is accessible.
-
Description
Writes the next view into the view struct. To get predictable results every
-call to get_view_first and get_view_next in the loop should have the same
-access flags.
+
Description
This call steps a view summary to the next view in the global view order.
-If the view summary returned is NULL, the loop is finished.
+If the view outputted does not exist, the loop is finished.
Views should not be closed or opened durring a view loop.
See Also
-
§2.3.20: get_view
+
§3.3.20: get_view
View_Summary app->get_view(
-
Application_Links *app,
int view_id,
unsigned int access
)
+
Application_Links *app,
View_ID view_id,
Access_Flag access
)
Parameters
view_id
-
the id of the view to get
+
The view_id specifies the view to try to get.
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns a summary that describes the indicated view if it is open and is accessible
+
Return
This call returns a summary that describes the indicated view if it is open and accessible.
See Also
-
§2.3.21: get_active_view
+
§3.3.21: get_active_view
View_Summary app->get_active_view(
-
Application_Links *app,
unsigned int access
)
+
Application_Links *app,
Access_Flag access
)
Parameters
access
-
the access flags for the access
+
The access parameter determines what levels of protection this call can access.
-
Return
returns a summary that describes the active view
See Also
+
Return
This call returns a summary that describes the active view.
See Also
-
§2.3.22: set_active_view
-
int app->set_active_view(
+
§3.3.22: set_active_view
+
bool32 app->set_active_view(
Application_Links *app,
View_Summary *view
)
Parameters
view
-
the view to set as active
+
The view parameter specifies which view to make active.
-
Return
returns non-zero on success
Description
If the given view is a currently open view, it is set as the
+
Return
This call returns non-zero on success.
Description
If the given view is open, it is set as the
active view, and takes subsequent commands and is returned
from get_active_view.
See Also
-
§2.3.23: view_set_setting
-
int app->view_set_setting(
-
Application_Links *app,
View_Summary *view,
int setting,
int value
)
+
§3.3.23: view_set_setting
+
bool32 app->view_set_setting(
+
Application_Links *app,
View_Summary *view,
View_Setting_ID setting,
int32_t value
)
Parameters
view
-
The view on which to set a setting.
+
The view parameter specifies the view on which to set a setting.
setting
-
One of the View_Setting_ID enum values that identifies the setting to set.
+
The setting parameter identifies the setting that shall be changed.
value
-
The value to set the specified setting to.
+
The value parameter specifies the value to which the setting shall be changed.
-
See Also
+
Return
This call returns non-zero on success.
See Also
-
§2.3.24: view_set_split_proportion
-
int app->view_set_split_proportion(
+
§3.3.24: view_set_split_proportion
+
bool32 app->view_set_split_proportion(
Application_Links *app,
View_Summary *view,
float t
)
Parameters
view
-
The view on which to adjust size.
+
The view parameter specifies which view shall have it's size adjusted.
t
-
The proportion of the view's containing box that it should occupy in [0,1]
+
The t parameter specifies the proportion of the containing box that the view should occupy. t should be in [0,1].
-
Return
Returns non-zero on success.
+
Return
This call returns non-zero on success.
-
§2.3.25: view_compute_cursor
-
int app->view_compute_cursor(
+
§3.3.25: view_compute_cursor
+
bool32 app->view_compute_cursor(
Application_Links *app,
View_Summary *view,
Buffer_Seek seek,
Full_Cursor *cursor_out
)
Parameters
view
-
The view on which to run the cursor computation.
+
The view parameter specifies the view on which to run the cursor computation.
seek
-
+
The seek parameter specifies the target position for the seek.
cursor_out
-
On success this is filled with result of the seek.
+
On success this struct is filled with the result of the seek.
-
Return
Returns non-zero on success.
Description
Computes a full cursor for the given seek position.
See Also
+
Return
This call returns non-zero on success.
Description
Computes a Full_Cursor for the given seek position with no side effects.
See Also
-
§2.3.26: view_set_cursor
-
int app->view_set_cursor(
-
Application_Links *app,
View_Summary *view,
Buffer_Seek seek,
int set_preferred_x
)
+
§3.3.26: view_set_cursor
+
bool32 app->view_set_cursor(
+
Application_Links *app,
View_Summary *view,
Buffer_Seek seek,
bool32 set_preferred_x
)
Parameters
view
-
the view in which to set the cursor
+
The view parameter specifies the view in which to set the cursor.
seek
-
+
The seek parameter specifies the target position for the seek.
set_preferred_x
-
if true the preferred x is updated to match the new cursor position
+
If this parameter is true the preferred x is updated to match the new cursor x.
-
Return
returns non-zero on success
Description
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.
See Also
+
Return
This call returns non-zero on success.
Description
This call 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.
See Also
-
§2.3.27: view_set_mark
-
int app->view_set_mark(
+
§3.3.27: view_set_mark
+
bool32 app->view_set_mark(
Application_Links *app,
View_Summary *view,
Buffer_Seek seek
)
Parameters
view
-
the view in which to set the mark
+
The view parameter specifies the view in which to set the mark.
seek
-
+
The seek parameter specifies the target position for the seek.
-
Return
returns non-zero on success
Description
Sets the the view's mark position.
See Also
+
Return
This call returns non-zero on success.
Description
This call sets the the view's mark position.
See Also
-
§2.3.28: view_set_highlight
-
int app->view_set_highlight(
-
Application_Links *app,
View_Summary *view,
int start,
int end,
int turn_on
)
+
§3.3.28: view_set_highlight
+
bool32 app->view_set_highlight(
+
Application_Links *app,
View_Summary *view,
int32_t start,
int32_t end,
bool32 turn_on
)
Parameters
view
-
the view to set the highlight in
+
The view parameter specifies the view in which to set the highlight.
start
-
the start of the highlight range
+
This parameter specifies the absolute position of the first character of the highlight range.
end
-
the end of the highlight range
+
This parameter specifies the absolute position of the character one past the end of the highlight range.
turn_on
-
indicates whether the highlight is being turned on or off
+
This parameter indicates whether the highlight is being turned on or off.
-
Return
returns non-zero on success
Description
The highlight is mutually exclusive to the cursor. When the turn_on parameter
+
Return
This call returns non-zero on success.
Description
The highlight is mutually exclusive to the cursor. When the turn_on parameter
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.
-
§2.3.29: view_set_buffer
-
int app->view_set_buffer(
-
Application_Links *app,
View_Summary *view,
int buffer_id,
unsigned int flags
)
+
§3.3.29: view_set_buffer
+
bool32 app->view_set_buffer(
+
Application_Links *app,
View_Summary *view,
Buffer_ID buffer_id,
Set_Buffer_Flag flags
)
Parameters
view
-
the view to display the buffer in
+
The view parameter specifies the view in which to display the buffer.
buffer_id
-
the buffer to show in the view
+
The buffer_id parameter specifies which buffer to show in the view.
flags
-
set buffer behavior flags
+
The flags parameter specifies behaviors for setting the buffer.
-
Return
returns non-zero on success
Description
On success view_set_buffer sets the specified view's current buffer and
+
Return
This call returns non-zero on success.
Description
On success view_set_buffer sets the specified view's current buffer and
cancels and dialogue shown in the view and displays the file.
See Also
-
§2.3.30: view_post_fade
-
int app->view_post_fade(
-
Application_Links *app,
View_Summary *view,
float seconds,
int start,
int end,
unsigned int color
)
+
§3.3.30: view_post_fade
+
bool32 app->view_post_fade(
+
Application_Links *app,
View_Summary *view,
float seconds,
int32_t start,
int32_t end,
int_color color
)
Parameters
view
-
the veiw to post a fade effect to
+
The view parameter specifies the view onto which the fade effect shall be posted.
seconds
-
the number of seconds the fade effect should last
+
This parameter specifies the number of seconds the fade effect should last.
start
-
the first character in the fade range
+
This parameter specifies the absolute position of the first character of the fade range.
end
-
one after the last character in the fade range
+
This parameter specifies the absolute position of the character one past the end of the fdae range.
color
-
+
The color parameter specifies the initial color of the text before it fades to it's natural color.
-
+
Return
This call returns non-zero on success.
See Also
See Also
+
Return
This call returns the input that triggered the currently executing command.
See Also
-
§2.3.33: get_mouse_state
+
§3.3.33: get_mouse_state
Mouse_State app->get_mouse_state(
Application_Links *app
)
-
Return
returns the current mouse state
See Also
+
Return
This call returns the current mouse state as of the beginning of the frame.
See Also
-
§2.3.34: start_query_bar
-
int app->start_query_bar(
-
Application_Links *app,
Query_Bar *bar,
unsigned int flags
)
+
§3.3.34: start_query_bar
+
bool32 app->start_query_bar(
+
Application_Links *app,
Query_Bar *bar,
uint32_t flags
)
Parameters
bar
-
a pointer to the Query_Bar struct that defines the bar's contents
+
This parameter provides a Query_Bar that should remain in valid memory
+until end_query_bar or the end of the command. It is commonly a good idea to make
+this a pointer to a Query_Bar stored on the stack.
flags
-
+
This parameter is not currently used and should be 0 for now.
-
Return
returns non-zero on success
Description
The memory pointed to by bar must remain valid until a call to end_query_bar or
-until the command returns.
+
Return
This call returns non-zero on success.
Description
This call tells the active view to begin displaying a "Query_Bar" which is a small
+GUI element that can overlap a buffer or other 4coder GUI. The contents of the bar
+can be changed after the call to start_query_bar and the query bar shown by 4coder
+will reflect the change. Since the bar stops showing when the command exits the
+only use for this call is in an interactive command that makes calls to get_user_input.
-
§2.3.35: end_query_bar
+
§3.3.35: end_query_bar
void app->end_query_bar(
-
Application_Links *app,
Query_Bar *bar,
unsigned int flags
)
+
Application_Links *app,
Query_Bar *bar,
uint32_t flags
)
Parameters
bar
-
a pointer to the Query_Bar struct to end
+
This parameter should be a bar pointer of a currently active query bar.
flags
-
+
This parameter is not currently used and should be 0 for now.
-
Description
bar must be a pointer previously passed to start_query_bar previously in the same command.
+
Description
Stops showing the particular query bar specified by the bar parameter.
-
§2.3.36: print_message
+
§3.3.36: print_message
void app->print_message(
-
Application_Links *app,
char *str,
int len
)
+
Application_Links *app,
char *str,
int32_t len
)
Parameters
str
-
the string to post to *messages*
+
The str parameter specifies the string to post to *messages*; it need not be null terminated.
len
-
+
The len parameter specifies the length of the str string.
-
+
Description
This call posts a string to the *messages* buffer.
-
§2.3.37: change_theme
+
§3.3.37: change_theme
void app->change_theme(
-
Application_Links *app,
char *name,
int len
)
+
Application_Links *app,
char *name,
int32_t len
)
Parameters
name
-
the name of the built in theme to change to
+
The name parameter specifies the name of the theme to begin using; it need not be null terminated.
len
-
the length of the name string
+
The len parameter specifies the length of the name string.
-
+
Description
This call changes 4coder's theme to one of the built in themes.
-
§2.3.38: change_font
+
§3.3.38: change_font
void app->change_font(
-
Application_Links *app,
char *name,
int len
)
+
Application_Links *app,
char *name,
int32_t len
)
Parameters
name
-
the name of the built in font to change to
+
The name parameter specifies the name of the font to begin using; it need not be null terminated.
len
-
the length of the name string
+
The len parameter specifies the length of the name string.
-
+
Description
This call changes 4coder's font to one of the built in fonts.
-
§2.3.39: set_theme_colors
+
§3.3.39: set_theme_colors
void app->set_theme_colors(
-
Application_Links *app,
Theme_Color *colors,
int count
)
+
Application_Links *app,
Theme_Color *colors,
int32_t count
)
Parameters
colors
-
an array of color structs pairing differet style tags to color codes
+
The colors pointer provides an array of color structs pairing differet style tags to color codes.
count
-
the number of color structs in the colors array
+
The count parameter specifies the number of Theme_Color structs in the colors array.
-
Description
For each color struct in the array, the color in the style pallet is set to the color
-code paired with the tag.
+Description
For each struct in the array, the slot in the main color pallet specified by the
+struct's tag is set to the color code in the struct. If the tag value is invalid
+no change is made to the color pallet.
-
§2.3.40: get_theme_colors
+
§3.3.40: get_theme_colors
void app->get_theme_colors(
-
Application_Links *app,
Theme_Color *colors,
int count
)
+
Application_Links *app,
Theme_Color *colors,
int32_t count
)
Parameters
colors
@@ -819,193 +833,607 @@ code paired with the tag.
count
the number of color structs in the colors array
-Description
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.
+Description
For each struct in the array, the color field of the struct is filled with the
+color from the slot in the main color pallet specified by the tag. If the tag
+value is invalid the color is filled with black.
-
§2.3.41: directory_get_hot
-
int app->directory_get_hot(
-
Application_Links *app,
char *out,
int capacity
)
+
§3.3.41: directory_get_hot
+
int32_t app->directory_get_hot(
+
Application_Links *app,
char *out,
int32_t capacity
)
Parameters
out
-
a buffer that receives the 4coder 'hot directory'
+
This parameter provides a character buffer that receives the 4coder 'hot directory'.
capacity
-
the maximum size to be output to the output buffer
+
This parameter specifies the maximum size to be output to the out buffer.
-
Return
returns the size of the string written into the buffer
Description
4coder has a concept of a 'hot directory' which is the directory most recently
+
Return
This call returns the size of the string written into the buffer.
Description
4coder has a concept of a 'hot directory' which is the directory most recently
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.
+directories controlled on the custom side.
-
§2.3.42: get_file_list
+
§3.3.42: get_file_list
File_List app->get_file_list(
-
Application_Links *app,
char *dir,
int len
)
+
Application_Links *app,
char *dir,
int32_t len
)
Parameters
dir
-
the directory whose files will be enumerated in the returned list
+
This parameter specifies the directory whose files will be enumerated in the returned list; it need not be null terminated.
len
-
the length of the dir string
+
This parameter the length of the dir string.
-
Return
returns a File_List struct containing pointers to the names of the files in
+
Return
This call returns a File_List struct containing pointers to the names of the files in
the specified directory. The File_List returned should be passed to free_file_list
when it is no longer in use.
-
§2.3.43: free_file_list
+
§3.3.43: free_file_list
void app->free_file_list(
Application_Links *app,
File_List list
)
Parameters
list
-
the file list to be freed
+
This parameter provides the file list to be freed.
-
Description
after this call the file list passed in should not be read or written to
+
Description
After this call the file list passed in should not be read or written to.
-
§2.3.44: file_exists
-
int app->file_exists(
+
§3.3.44: file_exists
+
bool32 app->file_exists(
Application_Links *app,
char *filename,
int len
)
Parameters
filename
-
+
This parameter specifies the full path to a file; it need not be null terminated.
len
-
the number of characters in the filename string
+
This parameter specifies the length of the filename string.
-
Return
returns non-zero if the file exists, returns zero if the file does not exist
+
Return
This call returns non-zero if and only if the file exists.
-
§2.3.45: directory_cd
-
int app->directory_cd(
+
§3.3.45: directory_cd
+
bool32 app->directory_cd(
Application_Links *app,
char *dir,
int *len,
int capacity,
char *rel_path,
int rel_len
)
Parameters
dir
-
a string buffer containing a directory
+
This parameter provides a character buffer that stores a directory; it need not be null terminated.
len
-
the length of the string in the string buffer
+
This parameter specifies the length of the dir string.
capacity
-
the maximum size of the string buffer
+
This parameter specifies the maximum size of the dir string.
rel_path
-
the path to change to, may include '.' or '..'
+
This parameter specifies the path to change to, may include '.' or '..'; it need not be null terminated.
rel_len
-
the length of the rel_path string
+
This parameter specifies the length of the rel_path string.
-
Return
returns non-zero if the call succeeds, returns zero otherwise
Description
This call succeeds if the directory exists and the new directory fits inside the dir buffer.
-If the call succeeds the dir buffer is filled with the new directory and len contains the
-length of the string in the buffer.
+
Return
This call returns non-zero if the call succeeds.
Description
This call succeeds if the new directory exists and the it fits inside the
+dir buffer. If the call succeeds the dir buffer is filled with the new
+directory and len is overwritten with the length of the new string in the buffer.
-For instance if dir contains "C:/Users/MySelf" and rel is "Documents" the buffer will contain
-"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.
+For instance if dir contains "C:/Users/MySelf" and rel is "Documents" the buffer
+will contain "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.
-
§2.3.46: get_4ed_path
-
int app->get_4ed_path(
-
Application_Links *app,
char *out,
int capacity
)
+
§3.3.46: get_4ed_path
+
bool32 app->get_4ed_path(
+
Application_Links *app,
char *out,
int32_t capacity
)
Parameters
out
-
A char buffer that receives the path to the 4ed executable file.
+
This parameter provides a character buffer that receives the path to the 4ed executable file.
capacity
-
The maximum capacity of the output buffer.
+
This parameter specifies the maximum capacity of the out buffer.
-
Return
Returns non-zero on success, returns zero on failure.
+
Return
This call returns non-zero on success.
-
§2.3.47: show_mouse_cursor
+
§3.3.47: show_mouse_cursor
void app->show_mouse_cursor(
-
Application_Links *app,
int show
)
+
Application_Links *app,
Mouse_Cursor_Show_Type show
)
Parameters
show
-
The show state to put the mouse cursor into, should be one of the Mouse_Cursor_Show_Type enum values.
+
This parameter specifies the new state of the mouse cursor.
See Also
-§2.4 Type Descriptions
+§3.4 Type Descriptions
+
+
§3.4.1: bool32
+
typedef int32_t bool32;
+
Description
bool32 is an alias name to signal that an integer parameter or field is for
+true/false vales.
+
+
§3.4.2: int_color
+
typedef uint32_t int_color;
+
Description
int_color is an alias name to signal that an integer parameter or field is for
+a color value, colors are specified as 24 bit integers in 3 channels: 0xRRGGBB.
-
§2.4.1: Key_Code
+
§3.4.3: Key_Code
typedef unsigned char Key_Code;
-
+Description
Key_Code is the alias for key codes including raw codes and codes translated
+to textual input that takes modifiers into account.
+
+
§3.4.4: Buffer_ID
+
typedef int32_t Buffer_ID;
+
Description
Buffer_ID is used to name a 4coder buffer. Each buffer has a unique id but
+when a buffer is closed it's id may be recycled by future, different buffers.
+
+
§3.4.5: View_ID
+
typedef int32_t View_ID;
+
Description
View_ID is used to name a 4coder view. Each view has a unique id in
+the range [1,16].
-
§2.4.2: Key_Modifier
+
§3.4.6: Key_Modifier
enum Key_Modifier;
+
Description
A Key_Modifier acts as an index for specifying modifiers in arrays.
Values
+
+
+
+
+
+
MDFR_INDEX_COUNT
+
MDFR_INDEX_COUNT is used to specify the number of modifiers supported.
+
-
§2.4.3: Command_ID
+
§3.4.7: Command_ID
enum Command_ID;
+
Description
A Command_ID is used as a name for commands implemented internally in 4coder.
Values
+
cmdid_null
+
cmdid_null is set aside to always be zero and is not associated with any command.
+
+
+
cmdid_center_view
+
cmdid_center_view centers the view vertically on the cursor.
+
+
+
cmdid_left_adjust_view
+
cmdid_left_adjust_view adjusts the view to be just left of the cursor's position.
+
+
+
cmdid_page_up
+
cmdid_page_up moves the view up one whole screen height and centers the cursor there.
+
+
+
cmdid_page_down
+
cmdid_page_down moves the view down one whole screen height and centers the cursor there.
+
+
+
cmdid_word_complete
+
cmdid_word_complete begins or continues cycling through completions for a partial word.
+
+
+
cmdid_undo
+
cmdid_undo performs a standard undo behavior.
+
+
+
cmdid_redo
+
cmdid_redo reperforms an edit that was undone.
+
+
+
cmdid_history_backward
+
cmdid_history_backward performs a step backwards through the file history, which includes previously lost redo branches.
+
+
+
cmdid_history_forward
+
cmdid_history_forward unperforms the previous cmdid_history_backward step if possib.e
+
+
+
cmdid_to_uppercase
+
cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range uppercase.
+
+
+
cmdid_to_lowercase
+
cmdid_to_uppercase makes all the alphabetic characters in the cursor/mark range lowercase.
+
+
+
cmdid_toggle_line_wrap
+
cmdid_toggle_line_wrap toggles the line wrap setting of the active view.
+
+
+
cmdid_toggle_show_whitespace
+
cmdid_toggle_line_wrap toggles the show whitespace setting of the active view.
+
+
+
cmdid_clean_all_lines
+
cmdid_clean_all_lines deletes extra whitespace out the currently active buffer.
+
+
+
cmdid_eol_dosify
+
cmdid_eol_dosify sets the currently active buffer to dos save mode where the end of a line is "\r\n"
+
+
+
cmdid_eol_nixify
+
cmdid_eol_nixify sets the currently active buffer to nix save mode where the end of a line is "\n"
+
+
+
cmdid_interactive_new
+
cmdid_interactive_new begins an interactive dialogue to create a new buffer.
+
+
+
cmdid_interactive_open
+
cmdid_interactive_open begins an interactive dialogue to open a file into a buffer.
+
+
+
cmdid_reopen
+
cmdid_reopen reloads the active buffer's associated file and discards the old buffer contents for the reloaded file.
+
+
+
cmdid_save
+
cmdid_save saves the buffer's contents into the associated file.
+
+
+
cmdid_save_as
+
cmdid_save_as does not currently work and is likely to be removed rather that fixed.
+
+
+
cmdid_interactive_switch_buffer
+
cmdid_interactive_switch_buffer begins an interactive dialogue to choose an open buffer to swap into the active view.
+
+
+
cmdid_interactive_kill_buffer
+
cmdid_interactive_kill_buffer begins an interactive dialogue to choose an open buffer to kill.
+
+
+
cmdid_kill_buffer
+
cmdid_kill_buffer tries to kill the active buffer.
+
+
+
cmdid_open_color_tweaker
+
cmdid_open_color_tweaker opens the theme editing GUI.
+
+
+
cmdid_open_config
+
cmdid_open_config opens the configuration menu.
+
+
+
cmdid_open_menu
+
cmdid_open_menu opens the top level menu.
+
+
+
cmdid_open_debug
+
cmdid_open_debug opens the debug information viewer mode.
+
+
+
cmdid_open_panel_vsplit
+
cmdid_open_panel_vsplit splits the current panel into two with a vertical divider.
+
+
+
cmdid_open_panel_hsplit
+
cmdid_open_panel_hsplit splits the current panel into two with a horizontal divider.
+
+
+
cmdid_close_panel
+
cmdid_close_panel closes the active panel.
+
+
+
cmdid_change_active_panel
+
cmdid_change_active_panel cycles to the next open panel.
+
+
-
§2.4.5: Event_Message_Type_ID
+
§3.4.9: Event_Message_Type_ID
enum Event_Message_Type_ID;
+
Description
Event_Message_Type_ID is a part of an unfinished feature.
Values
+
EventMessage_NoMessage
+
+
+
+
EventMessage_OpenView
+
+
+
+
+
EventMessage_CloseView
+
+
-
§2.4.6: Buffer_Setting_ID
+
§3.4.10: Buffer_Setting_ID
enum Buffer_Setting_ID;
+
Description
A Buffer_Setting_ID names a setting in a buffer.
Values
+
BufferSetting_Null
+
BufferSetting_Null is not a valid setting, it is reserved to detect errors.
+
+
+
BufferSetting_Lex
+
The BufferSetting_Lex setting is used to determine whether to store C++ tokens from with the buffer.
+
+
+
BufferSetting_WrapLine
+
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_MapID
+
The BufferSetting_MapID setting specifies the id of the command map that should be active when a buffer is active.
+
-
§2.4.7: View_Setting_ID
+
§3.4.11: View_Setting_ID
enum View_Setting_ID;
+
Description
A View_Setting_ID names a setting in a view.
Values
+
ViewSetting_Null
+
ViewSetting_Null is not a valid setting, it is reserved to detect errors.
+
+
+
ViewSetting_ShowScrollbar
+
The ViewSetting_ShowScrollbar setting determines whether a scroll bar is attached to a view in it's scrollable section.
+
-
§2.4.8: Mouse_Cursor_Show_Type
+
§3.4.12: Mouse_Cursor_Show_Type
enum Mouse_Cursor_Show_Type;
+
Description
A Mouse_Cursor_Show_Type value specifes a mode for 4coder to handle the mouse cursor.
Values
+
MouseCursorShow_Never
+
The MouseCursorShow_Never mode never shows the cursor.
+
+
+
MouseCursorShow_Always
+
The MouseCursorShow_Never mode always shows the cursor.
+
-
§2.4.9: Key_Modifier_Flag
+
§3.4.13: Key_Modifier_Flag
enum Key_Modifier_Flag;
+
Description
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.
Flags
+
MDFR_NONE = 0x0
+
MDFR_NONE specifies that no modifiers are pressed.
+
+
+
+
-
§2.4.10: Buffer_Create_Flag
+
§3.4.14: Buffer_Create_Flag
enum Buffer_Create_Flag;
+
Description
A Buffer_Create_Flag field specifies how a buffer should be created.
Flags
+
BufferCreate_Background = 0x1
+
BufferCreate_Background is not currently implemented.
+
+
+
BufferCreate_AlwaysNew = 0x2
+
When BufferCreate_AlwaysNew is et it indicates the buffer should be
+ cleared to empty even if it's associated file already has content.
+
-
§2.4.11: Buffer_Kill_Flag
+
§3.4.15: Buffer_Kill_Flag
enum Buffer_Kill_Flag;
+
Description
A Buffer_Kill_Flag field specifies how a buffer should be killed.
Flags
+
BufferKill_Background = 0x1
+
BufferKill_Background is not currently implemented.
+
+
+
BufferKill_AlwaysKill = 0x2
+
When BufferKill_AlwaysKill is set it indicates the buffer should be killed
+ without asking, even when the buffer is dirty.
+
-
§2.4.12: Access_Flag
+
§3.4.16: Access_Flag
enum Access_Flag;
+
Description
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.
Flags
+
AccessOpen = 0x0
+
AccessOpen does not include any bits, it indicates that the access should
+ only return objects that have no protection flags set.
+
+
+
AccessProtected = 0x1
+
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.
+
+
+
AccessHidden = 0x2
+
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.
+
+
+
AccessAll = 0xFF
+
AccessAll is a catchall access for cases where an access call should always
+ return an object no matter what it's protection flags are.
+
-
§2.4.13: Seek_Boundary_Flag
+
§3.4.17: Seek_Boundary_Flag
enum Seek_Boundary_Flag;
+
Description
A Seek_Boundary_Flag field specifies a set of "boundary" types used in seeks for the
+beginning or end of different types of words.
Flags
+
BoundaryWhitespace = 0x1
+
+
+
+
+
BoundaryAlphanumeric = 0x4
+
+
+
+
BoundaryCamelCase = 0x8
+
+
-
§2.4.15: Auto_Indent_Flag
+
§3.4.19: Auto_Indent_Flag
enum Auto_Indent_Flag;
+
Description
An Auto_Indent_Flag field specifies the behavior of an auto indentation operation.
Flags
+
AutoIndent_ClearLine = 0x1
+
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_UseTab = 0x2
+
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.
+
-
§2.4.16: Set_Buffer_Flag
+
§3.4.20: Set_Buffer_Flag
enum Set_Buffer_Flag;
+
Description
A Set_Buffer_Flag field specifies the behavior of an operation that sets the buffer of a view.
Flags
+
SetBuffer_KeepOriginalGUI = 0x1
+
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.
+
+
+
§3.4.22: Generic_Command
+
union Generic_Command {
+
+Command_ID cmdid;
+Custom_Command_Function * command;
+
+};
+
+
Description
Generic_Command acts as a name for a command, and can name an
+internal command or a custom command.
Fields
+
cmdid
+
If this Generic_Command represents an internal command the cmdid field
+ will have a value less than cmdid_count, and this field is the command id for the command.
+
+
+
command
+
If this Generic_Command does not represent an internal command the command
+ field is the pointer to the custom command..
+
-
§2.4.18: Key_Event_Data
+
§3.4.23: Key_Event_Data
struct Key_Event_Data {
Key_Code keycode;
@@ -1015,9 +1443,31 @@ char modifiers[MDFR_INDEX_COUNT];
};
+
Description
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.
Fields
+
keycode
+
This field is the raw keycode which is always non-zero in valid key events.
+
+
+
character
+
This field is the keycode after translation to a character, this is 0 if there is no translation.
+
+
+
character_no_caps_lock
+
This field is like the field character, except that the state of caps lock is ignored in the translation.
+
+
+
modifiers
+
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.
+
-
§2.4.19: Mouse_State
+
§3.4.24: Mouse_State
struct Mouse_State {
char l;
@@ -1033,9 +1483,51 @@ int y;
};
+
Description
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.
Fields
+
l
+
This field indicates that the left button is held.
+
+
+
r
+
This field indicates that the right button is held.
+
+
+
press_l
+
This field indicates that the left button was pressed this frame.
+
+
+
press_r
+
This field indicates that the right button was pressed this frame.
+
+
+
release_l
+
This field indicates that the left button was released this frame.
+
+
+
release_r
+
This field indicates that the right button was released this frame.
+
+
+
wheel
+
This field is 0 when the wheel has not moved, it is 1 for a downward motion and -1 for an upward motion.
+
+
+
out_of_window
+
This field indicates that the mouse is outside of the window.
+
+
+
x
+
This field contains the x position of the mouse relative to the window where the left side is 0.
+
+
+
y
+
This field contains the y position of the mouse relative to the window where the top side is 0.
+
-
§2.4.20: Range
+
§3.4.25: Range
union Range {
struct {
@@ -1053,9 +1545,29 @@ int end;
};
+
Description
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
Fields
+
min
+
This is the smaller value in the range, it is also the 'start'.
+
+
+
max
+
This is the larger value in the range, it is also the 'end'.
+
+
+
start
+
This is the start of the range, it is also the 'min'.
+
+
+
end
+
This is the end of the range, it is also the 'max'.
+
-
§2.4.21: File_Info
+
§3.4.26: File_Info
struct File_Info {
char * filename;
@@ -1064,9 +1576,21 @@ int folder;
};
-
+Description
File_Info describes the name and type of a file.
Fields
+
filename
+
This field is a null terminated string specifying the name of the file.
+
+
+
filename_len
+
This field specifies the length of the filename string not counting the null terminator.
+
+
+
folder
+
This field indicates that the description is for a folder not a file.
+
+See Also
-
§2.4.22: File_List
+
§3.4.27: File_List
struct File_List {
void * block;
@@ -1076,9 +1600,25 @@ int block_size;
};
+
Description
File_List is a list of File_Info structs.
Fields
+
block
+
This field is for inernal use.
+
+
+
infos
+
This field is an array of File_Info structs.
+
+
+
count
+
This field specifies the number of struts in the info array.
+
+
+
block_size
+
This field is for internal use.
+
-
§2.4.23: Buffer_Identifier
+
§3.4.28: Buffer_Identifier
struct Buffer_Identifier {
char * name;
@@ -1087,66 +1627,200 @@ int id;
};
+
Description
Buffer_Identifier acts as a loosely typed description of a buffer that
+can either be a name or an id. If the
Fields
+
name
+
This field is the name of the buffer, need not be null terminated.
+ If id is specified this should be NULL.
+
+
+
name_len
+
This field is specifies the length of the name string.
+
+
+
id
+
This field is the id of the buffer. If name is specified this should be 0.
+
-
§2.4.24: Buffer_Summary
+
§3.4.29: Buffer_Summary
struct Buffer_Summary {
-int exists;
-int ready;
-int buffer_id;
-unsigned int lock_flags;
-int size;
+bool32 exists;
+bool32 ready;
+int32_t buffer_id;
+Access_Flag lock_flags;
+int32_t size;
char * file_name;
-int file_name_len;
+int32_t file_name_len;
char * buffer_name;
-int buffer_name_len;
-int buffer_cursor_pos;
-int is_lexed;
-int map_id;
+int32_t buffer_name_len;
+int32_t buffer_cursor_pos;
+bool32 is_lexed;
+int32_t map_id;
};
+
Description
Buffer_Summary acts as a handle to a buffer and describes the state of the buffer.
Fields
+
exists
+
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".
+
+
+
ready
+
If this is not a null summary, this field indicates whether the buffer has finished loading.
+
+
+
buffer_id
+
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.
+
+
+
lock_flags
+
If this is not a null summary, this field contains flags describing the protection status of the buffer.
+
+
+
size
+
If this is not a null summary, this field specifies the size of the text in the buffer.
+
+
+
file_name
+
If this is not a null summary, this field specifies the file name associated to this buffer.
+
+
+
file_name_len
+
This field specifies the length of the file_name string.
+
+
+
buffer_name
+
If this is not a null summary, this field specifies the name of the buffer.
+
+
+
buffer_name_len
+
This field specifies the length of the buffer_name string.
+
+
+
buffer_cursor_pos
+
This is a hold over from an old system, consider it deprecated.
+
+
+
is_lexed
+
If this is not a null summary, this field indicates whether the buffer is set to lex tokens.
+
+
+
map_id
+
If this is not a null summary, this field specifies the id of the command map for this buffer.
+
-
§2.4.25: View_Summary
+
§3.4.30: View_Summary
struct View_Summary {
-int exists;
-int view_id;
-int buffer_id;
-unsigned int lock_flags;
+bool32 exists;
+int32_t view_id;
+int32_t buffer_id;
+Access_Flag lock_flags;
Full_Cursor cursor;
Full_Cursor mark;
float preferred_x;
float line_height;
-int unwrapped_lines;
-int show_whitespace;
+bool32 unwrapped_lines;
+bool32 show_whitespace;
i32_Rect file_region;
GUI_Scroll_Vars scroll_vars;
};
+
Description
View_Summary acts as a handle to a view and describes the state of the view.
Fields
+
exists
+
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".
+
+
+
view_id
+
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.
+
+
+
buffer_id
+
If this is not a null summary, and this view looks at a buffer, this is the id of the buffer.
+
+
+
lock_flags
+
If this is not a null summary, this field contains flags describing the protection status of the view.
+
+
+
cursor
+
If this is not a null summary, this describes the position of the cursor.
+
+
+
mark
+
If this is not a null summary, this describes the position of the mark.
+
+
+
preferred_x
+
If this is not a null summary, this is the x position that is maintained in vertical navigation.
+
+
+
line_height
+
If this is not a null summary, this specifies the height of a line rendered in the view.
+
+
+
unwrapped_lines
+
If this is not a null summary, this indicates that the view is set to render with unwrapped lines.
+
+
+
show_whitespace
+
If this is not a null summary, this indicates that the view is set to highlight white space.
+
+
+
file_region
+
This feature is not fully implemented yet.
+
+
+
scroll_vars
+
This feature is not fully implemented yet.
+
+Description
User_Input describes a user input event which can be either a key press or mouse event.
Fields
+
type
+
This field specifies whether the event was a key press or mouse event.
+
+
+
abort
+
This field indicates that an abort event has occurred and the command needs to shut down.
+
+
+
key
+
This field describes a key press event.
+
+
+
mouse
+
This field describes a mouse input event.
+
+
+
command
+
If this event would trigger a command, this field specifies what the command would be.
+
+See Also
-
§2.4.27: Query_Bar
+
§3.4.32: Query_Bar
struct Query_Bar {
String prompt;
@@ -1154,26 +1828,47 @@ String string;
};
+
Description
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.
Fields
+
prompt
+
This specifies the prompt portion of the drop down bar.
+
+
+
string
+
This specifies the main string portion of the drop down bar.
+
-
§2.4.28: Event_Message
+
§3.4.33: Event_Message
struct Event_Message {
int type;
};
+
Description
This feature is not implemented.
Fields
+
type
+
This feature is not implemented.
+
-
§2.4.29: Theme_Color
+
§3.4.34: Theme_Color
struct Theme_Color {
Style_Tag tag;
-uint32_t color;
+int_color color;
};
-
+Description
Theme_Color stores a style tag/color pair, for the purpose of setting and getting colors in the theme .
Fields
+
+See Also