Skip to content

Commit

Permalink
Cleanup|libcore: Systems do not handle events
Browse files Browse the repository at this point in the history
Events are window-specific, so subsystems do not handle them. Instead, event are dispatched to specific window root widgets.
  • Loading branch information
skyjake committed Sep 8, 2019
1 parent a80dd49 commit 2989621
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doomsday/libs/core/include/de/core/app.h
Expand Up @@ -411,11 +411,11 @@ class DE_PUBLIC App : DE_OBSERVES(Clock, TimeChange)
*/
void handleUncaughtException(const String& message);

/**
/*
* Events received from the operating system should be passed here; the
* application will make sure all subsystems get a chance to process them.
*/
virtual bool processEvent(const Event &);
// virtual bool processEvent(const Event &);

/**
* Informs all the subsystems about advancement of time. Subsystems will be
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libs/core/include/de/core/system.h
Expand Up @@ -40,7 +40,7 @@ class DE_PUBLIC System : DE_OBSERVES(Clock, TimeChange)
enum Flag
{
ObservesTime = 0x1, ///< System will observe clock time.
ReceivesInputEvents = 0x2, ///< System will be given input events.
// ReceivesInputEvents = 0x2, ///< System will be given input events.

DefaultBehavior = ObservesTime
};
Expand All @@ -52,7 +52,7 @@ class DE_PUBLIC System : DE_OBSERVES(Clock, TimeChange)

Flags behavior() const;

/**
/*
* Offers an event to be processed by the system. If the event is eaten
* by the system, it will not be offered to any other systems.
*
Expand All @@ -61,7 +61,7 @@ class DE_PUBLIC System : DE_OBSERVES(Clock, TimeChange)
* @return @c true, if the event was eaten and should not be processed by
* others. @c false, if event was not eaten.
*/
virtual bool processEvent(const Event &ev);
// virtual bool processEvent(const Event &ev);

// Observes TimeChange.
virtual void timeChanged(const Clock &);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/map.h
Expand Up @@ -97,7 +97,7 @@ class Map : public std::map<Key, Value, Compare>

void deleteAll()
{
for (const auto &i : *this) { delete i.second; }
for (auto &i : *this) { delete i.second; }
}
};

Expand Down
2 changes: 2 additions & 0 deletions doomsday/libs/core/src/core/app.cpp
Expand Up @@ -506,6 +506,7 @@ void App::handleUncaughtException(const String& message)
if (d->terminateFunc) d->terminateFunc(esc.plainText());
}

#if 0
bool App::processEvent(const Event &ev)
{
for (System *sys : d->systems)
Expand All @@ -518,6 +519,7 @@ bool App::processEvent(const Event &ev)
}
return false;
}
#endif

void App::timeChanged(const Clock &clock)
{
Expand Down
2 changes: 2 additions & 0 deletions doomsday/libs/core/src/core/system.cpp
Expand Up @@ -43,10 +43,12 @@ Flags System::behavior() const
return d->behavior;
}

#if 0
bool System::processEvent(const Event &)
{
return false;
}
#endif

void System::timeChanged(const Clock &)
{}
Expand Down

0 comments on commit 2989621

Please sign in to comment.