diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-11 04:14:01 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-11 04:14:01 +0100 |
commit | 7206f6d1249da0dd8e879d0c0b26185fc6ef89d9 (patch) | |
tree | 9f570b266ee49c06290c048b600346ab8b0dbddd /src/document.cpp | |
parent | 0987ca8b5b1a6ff50bfc8c3b171fdaf6cfff3a2b (diff) | |
download | sciteco-7206f6d1249da0dd8e879d0c0b26185fc6ef89d9.tar.gz |
added all of SciTECO's declarations to the "SciTECO" namespace
normally, since SciTECO is not a library, this is not strictly
necessary since every library should use proper name prefixes
or namespaces for all global declarations to avoid name clashes.
However
* you cannot always rely on that
* Scintilla does violate the practice of using prefixes or namespaces.
The public APIs are OK, but it does define global functions/methods,
e.g. for "Document" that clashed with SciTECO's "TECODocument" class at
link-time.
Scintilla can put its definitions in a namespace, but this feature
cannot be easily enabled without patching Scintilla.
* a "SciTECO" namespace will be necessary if "SciTECO" is ever to be
turned into a library. Even if this library will have only a C-linkage
API, it must ensure it doesn't clutter the global namespace.
So the old "TECODocument" class was renamed back to "Document"
(SciTECO::Document).
Diffstat (limited to 'src/document.cpp')
-rw-r--r-- | src/document.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/document.cpp b/src/document.cpp index dd39a56..ff2ce2b 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -28,6 +28,8 @@ #include "undo.h" #include "document.h" +namespace SciTECO { + static inline void set_representations(void) { @@ -55,7 +57,7 @@ public: }; void -TECODocument::edit(void) +Document::edit(void) { if (!is_initialized()) doc = (SciDoc)interface.ssm(SCI_CREATEDOCUMENT); @@ -73,7 +75,7 @@ TECODocument::edit(void) } void -TECODocument::undo_edit(void) +Document::undo_edit(void) { if (!is_initialized()) doc = (SciDoc)interface.ssm(SCI_CREATEDOCUMENT); @@ -92,7 +94,7 @@ TECODocument::undo_edit(void) } void -TECODocument::update(void) +Document::update(void) { anchor = interface.ssm(SCI_GETANCHOR); dot = interface.ssm(SCI_GETCURRENTPOS); @@ -105,7 +107,7 @@ TECODocument::update(void) * exchanging of document data (without any deep copying) */ void -TECODocument::exchange(TECODocument &other) +Document::exchange(Document &other) { SciDoc temp_doc = doc; gint temp_anchor = anchor; @@ -125,3 +127,5 @@ TECODocument::exchange(TECODocument &other) other.first_line = temp_first_line; other.xoffset = temp_xoffset; } + +} /* namespace SciTECO */ |