dropped the I infront of the journal view model interfaces

actorid
Nathan Jeffords 12 years ago
parent 36a6806faf
commit 7db6447a00

@ -56,7 +56,7 @@ namespace
{
}
void operator () (IJournalViewModel::IEntry const & Entry)
void operator () (JournalViewModel::Entry const & Entry)
{
typesetter->add_content (Entry.body ());
@ -77,7 +77,7 @@ namespace
{
}
void operator () (IJournalViewModel::IJournalEntry const & Entry)
void operator () (JournalViewModel::JournalEntry const & Entry)
{
if (add_header)
{
@ -102,7 +102,7 @@ namespace
{
}
void operator () (IJournalViewModel::ITopicEntry const & Entry)
void operator () (JournalViewModel::TopicEntry const & Entry)
{
typesetter->write (body_style, Entry.source ());
typesetter->write (body_style, 0, 3);// begin
@ -123,7 +123,7 @@ namespace
{
}
void operator () (IJournalViewModel::utf8_span topicName)
void operator () (JournalViewModel::utf8_span topicName)
{
typesetter->write (body_style, topicName);
typesetter->sectionBreak (10);
@ -137,7 +137,7 @@ namespace
{
}
void operator () (IJournalViewModel::utf8_span topicName)
void operator () (JournalViewModel::utf8_span topicName)
{
typesetter->write (body_style, topicName);
typesetter->sectionBreak (10);
@ -151,7 +151,7 @@ namespace
{
}
void operator () (IJournalViewModel::topic_id topicId, IJournalViewModel::utf8_span name)
void operator () (JournalViewModel::topic_id topicId, JournalViewModel::utf8_span name)
{
BookTypesetter::Style* link = typesetter->createHotStyle (body_style, MyGUI::Colour::Black, linkHot, linkActive, topicId);
@ -167,7 +167,7 @@ namespace
{
}
void operator () (IJournalViewModel::quest_id id, IJournalViewModel::utf8_span name)
void operator () (JournalViewModel::quest_id id, JournalViewModel::utf8_span name)
{
BookTypesetter::Style* style = typesetter->createHotStyle (body_style, MyGUI::Colour::Black, linkHot, linkActive, id);
@ -179,7 +179,7 @@ namespace
typedef TypesetBook::ptr book;
JournalBooks::JournalBooks (IJournalViewModel::ptr Model) :
JournalBooks::JournalBooks (JournalViewModel::ptr Model) :
Model (Model)
{
}

@ -9,9 +9,9 @@ namespace MWGui
struct JournalBooks
{
typedef TypesetBook::ptr book;
IJournalViewModel::ptr Model;
JournalViewModel::ptr Model;
JournalBooks (IJournalViewModel::ptr Model);
JournalBooks (JournalViewModel::ptr Model);
book createEmptyJournalBook ();
book createJournalBook ();

@ -15,7 +15,7 @@
using namespace MWGui;
namespace MWGui { struct JournalViewModel; }
namespace MWGui { struct JournalViewModelImpl; }
static void injectMonthName (std::ostream & os, int month);
@ -148,7 +148,7 @@ private:
std::locale mLocale;
};
struct MWGui::JournalViewModel : IJournalViewModel
struct MWGui::JournalViewModelImpl : JournalViewModel
{
typedef KeywordSearch <std::string, intptr_t> keyword_search_t;
@ -157,12 +157,12 @@ struct MWGui::JournalViewModel : IJournalViewModel
std::locale mLocale;
JournalViewModel ()
JournalViewModelImpl ()
{
mKeywordSearchLoaded = false;
}
virtual ~JournalViewModel ()
virtual ~JournalViewModelImpl ()
{
}
@ -214,10 +214,10 @@ struct MWGui::JournalViewModel : IJournalViewModel
{
typedef t_iterator iterator_t;
iterator_t itr;
JournalViewModel const * Model;
iterator_t itr;
JournalViewModelImpl const * Model;
BaseEntry (JournalViewModel const * Model, iterator_t itr) :
BaseEntry (JournalViewModelImpl const * Model, iterator_t itr) :
Model (Model), itr (itr), loaded (false)
{}
@ -292,14 +292,14 @@ struct MWGui::JournalViewModel : IJournalViewModel
}
template <typename iterator_t>
struct JournalEntry : BaseEntry <iterator_t, IJournalEntry>
struct JournalEntryImpl : BaseEntry <iterator_t, JournalEntry>
{
using BaseEntry <iterator_t, IJournalEntry>::itr;
using BaseEntry <iterator_t, JournalEntry>::itr;
mutable std::string timestamp_buffer;
JournalEntry (JournalViewModel const * Model, iterator_t itr) :
BaseEntry <iterator_t, IJournalEntry> (Model, itr)
JournalEntryImpl (JournalViewModelImpl const * Model, iterator_t itr) :
BaseEntry <iterator_t, JournalEntry> (Model, itr)
{}
std::string getText () const
@ -326,7 +326,7 @@ struct MWGui::JournalViewModel : IJournalViewModel
}
};
void visitJournalEntries (quest_id questId, boost::function <void (IJournalEntry const &)> visitor) const
void visitJournalEntries (quest_id questId, boost::function <void (JournalEntry const &)> visitor) const
{
MWBase::Journal * journal = MWBase::Environment::get().getJournal();
@ -339,14 +339,14 @@ struct MWGui::JournalViewModel : IJournalViewModel
for (MWDialogue::Topic::TEntryIter j = quest->begin (); j != quest->end (); ++j)
{
if (i->mInfoId == *j)
visitor (JournalEntry <MWBase::Journal::TEntryIter> (this, i));
visitor (JournalEntryImpl <MWBase::Journal::TEntryIter> (this, i));
}
}
}
else
{
for(MWBase::Journal::TEntryIter i = journal->begin(); i != journal->end (); ++i)
visitor (JournalEntry <MWBase::Journal::TEntryIter> (this, i));
visitor (JournalEntryImpl <MWBase::Journal::TEntryIter> (this, i));
}
}
@ -376,13 +376,13 @@ struct MWGui::JournalViewModel : IJournalViewModel
}
struct topicEntry : BaseEntry <MWDialogue::Topic::TEntryIter, ITopicEntry>
struct TopicEntryImpl : BaseEntry <MWDialogue::Topic::TEntryIter, TopicEntry>
{
MWDialogue::Topic const & Topic;
mutable std::string source_buffer;
topicEntry (JournalViewModel const * Model, MWDialogue::Topic const & Topic, iterator_t itr) :
TopicEntryImpl (JournalViewModelImpl const * Model, MWDialogue::Topic const & Topic, iterator_t itr) :
BaseEntry (Model, itr), Topic (Topic)
{}
@ -401,14 +401,14 @@ struct MWGui::JournalViewModel : IJournalViewModel
};
void visitTopicEntries (topic_id topicId, boost::function <void (ITopicEntry const &)> visitor) const
void visitTopicEntries (topic_id topicId, boost::function <void (TopicEntry const &)> visitor) const
{
typedef MWDialogue::Topic::TEntryIter iterator_t;
MWDialogue::Topic const & Topic = * reinterpret_cast <MWDialogue::Topic const *> (topicId);
for (iterator_t i = Topic.begin (); i != Topic.end (); ++i)
visitor (topicEntry (this, Topic, i));
visitor (TopicEntryImpl (this, Topic, i));
}
};
@ -466,7 +466,7 @@ static void injectMonthName (std::ostream & os, int month)
#endif
}
IJournalViewModel::ptr IJournalViewModel::create ()
JournalViewModel::ptr JournalViewModel::create ()
{
return boost::make_shared <JournalViewModel> ();
return boost::make_shared <JournalViewModelImpl> ();
}

@ -16,9 +16,9 @@ namespace MWGui
// specifically to the needs of the journal GUI. It isolates
/// the journal GUI from the implementation details of the
/// game data store.
struct IJournalViewModel
struct JournalViewModel
{
typedef boost::shared_ptr <IJournalViewModel> ptr;
typedef boost::shared_ptr <JournalViewModel> ptr;
typedef intptr_t quest_id;
typedef intptr_t topic_id;
@ -26,7 +26,7 @@ namespace MWGui
typedef std::pair <utf8_point, utf8_point> utf8_span;
/// The base interface for both journal entries and topics.
struct IEntry
struct Entry
{
/// returns the body text for the journal entry
///
@ -42,7 +42,7 @@ namespace MWGui
};
/// An interface to topic data.
struct ITopicEntry : IEntry
struct TopicEntry : Entry
{
/// Returns a pre-formatted span of UTF8 encoded text representing
/// the name of the NPC this portion of dialog was heard from.
@ -50,7 +50,7 @@ namespace MWGui
};
/// An interface to journal data.
struct IJournalEntry : IEntry
struct JournalEntry : Entry
{
/// Returns a pre-formatted span of UTF8 encoded text representing
/// the in-game date this entry was added to the journal.
@ -74,7 +74,7 @@ namespace MWGui
virtual void visitQuestNames (bool active_only, boost::function <void (quest_id, utf8_span)> visitor) const = 0;
/// walks over the journal entries related to the specified quest identified by its id
virtual void visitJournalEntries (quest_id questId, boost::function <void (IJournalEntry const &)> visitor) const = 0;
virtual void visitJournalEntries (quest_id questId, boost::function <void (JournalEntry const &)> visitor) const = 0;
/// provides the name of the topic specified by its id
virtual void visitTopicName (topic_id topicId, boost::function <void (utf8_span)> visitor) const = 0;
@ -83,7 +83,7 @@ namespace MWGui
virtual void visitTopicNamesStartingWith (int character, boost::function < void (topic_id , utf8_span) > visitor) const = 0;
/// walks over the topic entries for the topic specified by its identifier
virtual void visitTopicEntries (topic_id topicId, boost::function <void (ITopicEntry const &)> visitor) const = 0;
virtual void visitTopicEntries (topic_id topicId, boost::function <void (TopicEntry const &)> visitor) const = 0;
// create an instance of the default journal view model implementation
static ptr create ();

@ -94,7 +94,7 @@ namespace
return getWidget <MWGui::BookPage> (name);
}
JournalWindowImpl (IJournalViewModel::ptr Model)
JournalWindowImpl (JournalViewModel::ptr Model)
: WindowBase("openmw_journal.layout"), JournalBooks (Model)
{
mMainWidget->setVisible(false);
@ -420,7 +420,7 @@ namespace
}
// glue the implementation to the interface
IJournalWindow * MWGui::JournalWindow::create (IJournalViewModel::ptr Model)
JournalWindow * MWGui::JournalWindow::create (JournalViewModel::ptr Model)
{
return new JournalWindowImpl (Model);
}

@ -8,12 +8,12 @@ namespace MWBase { class WindowManager; }
namespace MWGui
{
struct IJournalViewModel;
struct JournalViewModel;
struct JournalWindow
{
/// construct a new instance of the one JournalWindow implementation
static JournalWindow * create (boost::shared_ptr <IJournalViewModel> Model);
static JournalWindow * create (boost::shared_ptr <JournalViewModel> Model);
/// destroy this instance of the JournalWindow implementation
virtual ~JournalWindow () {};

@ -148,7 +148,7 @@ namespace MWGui
mMap = new MapWindow(cacheDir);
mStatsWindow = new StatsWindow();
mConsole = new Console(w,h, consoleOnlyScripts);
mJournal = JournalWindow::create(IJournalViewModel::create ());
mJournal = JournalWindow::create(JournalViewModel::create ());
mMessageBoxManager = new MessageBoxManager();
mInventoryWindow = new InventoryWindow(mDragAndDrop);
mTradeWindow = new TradeWindow();

Loading…
Cancel
Save