diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-16 19:31:29 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-16 23:34:25 +0100 |
commit | 38fcf6d15cdf09591e7d7a142ad724164875e433 (patch) | |
tree | bc6d81a5c3e33b6832cf0507fbf7e9e4a01a4358 /src/ring.cpp | |
parent | 7a0857515ad216325fc3021c7490df9d01a21c7c (diff) | |
download | sciteco-38fcf6d15cdf09591e7d7a142ad724164875e433.tar.gz |
rewritten View and Interface base classes using the Curiously Recurring Template Pattern.
* without the one-view-per-buffer designs, many Scintilla send message (SSM)
calls could be inlined
* with the new design, this was no longer possible using the abstract
base classes. the CRT pattern allows inlining again but introduces
a strange level of code obscurity.
* tests suggest that at high optimization levels, the one-view-per-buffer
design and the CRT pattern reduces typical macro runtimes by 30%
(e.g. for symbols-extract.tes).
* only updated the NCurses UI for the time being
Diffstat (limited to 'src/ring.cpp')
-rw-r--r-- | src/ring.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ring.cpp b/src/ring.cpp index 25a46ce..443b22d 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -264,18 +264,18 @@ Ring::edit(const gchar *filename) buffer->edit(); buffer->load(filename); - interface.msg(Interface::MSG_INFO, + interface.msg(InterfaceCurrent::MSG_INFO, "Added file \"%s\" to ring", filename); } else { buffer->edit(); buffer->set_filename(filename); if (filename) - interface.msg(Interface::MSG_INFO, + interface.msg(InterfaceCurrent::MSG_INFO, "Added new file \"%s\" to ring", filename); else - interface.msg(Interface::MSG_INFO, + interface.msg(InterfaceCurrent::MSG_INFO, "Added new unnamed file to ring."); } @@ -326,7 +326,7 @@ public: orig_attrs); #endif } else { - interface.msg(Interface::MSG_WARNING, + interface.msg(InterfaceCurrent::MSG_WARNING, "Unable to restore save point file \"%s\"", savepoint); } @@ -362,7 +362,7 @@ make_savepoint(Buffer *buffer) #endif undo.push(token); } else { - interface.msg(Interface::MSG_WARNING, + interface.msg(InterfaceCurrent::MSG_WARNING, "Unable to create save point file \"%s\"", savepoint); g_free(savepoint); @@ -475,11 +475,11 @@ Ring::close(Buffer *buffer) TAILQ_REMOVE(&head, buffer, buffers); if (buffer->filename) - interface.msg(Interface::MSG_INFO, + interface.msg(InterfaceCurrent::MSG_INFO, "Removed file \"%s\" from the ring", buffer->filename); else - interface.msg(Interface::MSG_INFO, + interface.msg(InterfaceCurrent::MSG_INFO, "Removed unnamed file from the ring."); } @@ -644,7 +644,7 @@ StateEditFile::initial(void) if (id == 0) { for (Buffer *cur = ring.first(); cur; cur = cur->next()) - interface.popup_add(Interface::POPUP_FILE, + interface.popup_add(InterfaceCurrent::POPUP_FILE, cur->filename ? : "(Unnamed)", cur == ring.current); |