From 0a538f989da53970ddb3776778d87230c7929e6d Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 26 Jan 2018 11:12:10 +1100 Subject: Backport: Add documentOption argument to SCI_CREATELOADER. Backport of changeset 6441:92c8f0f1b3e6. --- doc/ScintillaDoc.html | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'doc/ScintillaDoc.html') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index df08b19da..a1d46b1fa 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -116,7 +116,7 @@

Scintilla Documentation

-

Last edited 11 August 2017 NH

+

Last edited 31 January 2018 NH

There is an overview of the internal design of Scintilla.
@@ -5688,7 +5688,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ SCI_GETDOCPOINTER → document *
SCI_SETDOCPOINTER(<unused>, document *doc)
- SCI_CREATEDOCUMENT → document *
+ SCI_CREATEDOCUMENT(int bytes, int documentOption) → document *
SCI_ADDREFDOCUMENT(<unused>, document *doc)
SCI_RELEASEDOCUMENT(<unused>, document @@ -5709,13 +5709,20 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ window.
6. If doc was not 0, its reference count is increased by 1.

-

SCI_CREATEDOCUMENT → document *
+

SCI_CREATEDOCUMENT(int bytes, int documentOption) → document *
This message creates a new, empty document and returns a pointer to it. This document is not - selected into the editor and starts with a reference count of 1. This means that you have - ownership of it and must either reduce its reference count by 1 after using + selected into the editor and starts with a reference count of 1. This means that you have + ownership of it and must either reduce its reference count by 1 after using SCI_SETDOCPOINTER so that the Scintilla window owns it or you must make sure that - you reduce the reference count by 1 with SCI_RELEASEDOCUMENT before you close the - application to avoid memory leaks.

+ you reduce the reference count by 1 with SCI_RELEASEDOCUMENT before you close the + application to avoid memory leaks. The bytes argument determines + the initial memory allocation for the document as it is more efficient + to allocate once rather than rely on the buffer growing as data is added. + If SCI_CREATEDOCUMENT fails then 0 is returned.

+ +

The documentOption argument may be used in future versions + to choose between different document capabilities which affect memory allocation and performance. + The only valid value for now is SC_DOCUMENTOPTION_DEFAULT (0).

SCI_ADDREFDOCUMENT(<unused>, document *doc)
This increases the reference count of a document by 1. If you want to replace the current @@ -5742,7 +5749,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){

Loading in the background

-
SCI_CREATELOADER(int bytes) → int
+ SCI_CREATELOADER(int bytes, int documentOption) → int

An application can load all of a file into a buffer it allocates on a background thread and then add the data in that buffer @@ -5751,13 +5758,17 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){

To avoid these issues, a loader object may be created and used to load the file. The loader object supports the ILoader interface.

-

SCI_CREATELOADER(int bytes) → int
+

SCI_CREATELOADER(int bytes, int documentOption) → int
Create an object that supports the ILoader interface which can be used to load data and then be turned into a Scintilla document object for attachment to a view object. The bytes argument determines the initial memory allocation for the document as it is more efficient to allocate once rather than rely on the buffer growing as data is added. If SCI_CREATELOADER fails then 0 is returned.

+

The documentOption argument may be used in future versions + to choose between different document capabilities which affect memory allocation and performance. + The only valid value for now is SC_DOCUMENTOPTION_DEFAULT (0).

+

ILoader

-- cgit v1.2.3