Extend Team's listener interface.
Add hooks for sending and listening for console output events.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -613,6 +614,18 @@ Team::NotifyImageDebugInfoChanged(Image* image)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Team::NotifyConsoleOutputReceived(int32 fd, const BString& output)
|
||||||
|
{
|
||||||
|
for (ListenerList::Iterator it = fListeners.GetIterator();
|
||||||
|
Listener* listener = it.Next();) {
|
||||||
|
listener->ConsoleOutputReceived(
|
||||||
|
ConsoleOutputEvent(TEAM_EVENT_CONSOLE_OUTPUT_RECEIVED, this,
|
||||||
|
fd, output));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Team::NotifyUserBreakpointChanged(UserBreakpoint* breakpoint)
|
Team::NotifyUserBreakpointChanged(UserBreakpoint* breakpoint)
|
||||||
{
|
{
|
||||||
@@ -731,6 +744,19 @@ Team::BreakpointEvent::BreakpointEvent(uint32 type, Team* team,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - ConsoleOutputEvent
|
||||||
|
|
||||||
|
|
||||||
|
Team::ConsoleOutputEvent::ConsoleOutputEvent(uint32 type, Team* team,
|
||||||
|
int32 fd, const BString& output)
|
||||||
|
:
|
||||||
|
Event(type, team),
|
||||||
|
fDescriptor(fd),
|
||||||
|
fOutput(output)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - DebugReportEvent
|
// #pragma mark - DebugReportEvent
|
||||||
|
|
||||||
|
|
||||||
@@ -823,6 +849,12 @@ Team::Listener::ImageDebugInfoChanged(const Team::ImageEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Team::Listener::ConsoleOutputReceived(const Team::ConsoleOutputEvent& event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Team::Listener::BreakpointAdded(const Team::BreakpointEvent& event)
|
Team::Listener::BreakpointAdded(const Team::BreakpointEvent& event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef TEAM_H
|
#ifndef TEAM_H
|
||||||
@@ -32,6 +33,8 @@ enum {
|
|||||||
|
|
||||||
TEAM_EVENT_IMAGE_DEBUG_INFO_CHANGED,
|
TEAM_EVENT_IMAGE_DEBUG_INFO_CHANGED,
|
||||||
|
|
||||||
|
TEAM_EVENT_CONSOLE_OUTPUT_RECEIVED,
|
||||||
|
|
||||||
TEAM_EVENT_BREAKPOINT_ADDED,
|
TEAM_EVENT_BREAKPOINT_ADDED,
|
||||||
TEAM_EVENT_BREAKPOINT_REMOVED,
|
TEAM_EVENT_BREAKPOINT_REMOVED,
|
||||||
TEAM_EVENT_USER_BREAKPOINT_CHANGED,
|
TEAM_EVENT_USER_BREAKPOINT_CHANGED,
|
||||||
@@ -41,6 +44,7 @@ enum {
|
|||||||
TEAM_EVENT_WATCHPOINT_CHANGED,
|
TEAM_EVENT_WATCHPOINT_CHANGED,
|
||||||
|
|
||||||
TEAM_EVENT_DEBUG_REPORT_CHANGED
|
TEAM_EVENT_DEBUG_REPORT_CHANGED
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +67,7 @@ class Team {
|
|||||||
public:
|
public:
|
||||||
class Event;
|
class Event;
|
||||||
class BreakpointEvent;
|
class BreakpointEvent;
|
||||||
|
class ConsoleOutputEvent;
|
||||||
class DebugReportEvent;
|
class DebugReportEvent;
|
||||||
class ImageEvent;
|
class ImageEvent;
|
||||||
class ThreadEvent;
|
class ThreadEvent;
|
||||||
@@ -178,6 +183,10 @@ public:
|
|||||||
// service methods for Image
|
// service methods for Image
|
||||||
void NotifyImageDebugInfoChanged(Image* image);
|
void NotifyImageDebugInfoChanged(Image* image);
|
||||||
|
|
||||||
|
// service methods for console output
|
||||||
|
void NotifyConsoleOutputReceived(
|
||||||
|
int32 fd, const BString& output);
|
||||||
|
|
||||||
// breakpoint related service methods
|
// breakpoint related service methods
|
||||||
void NotifyUserBreakpointChanged(
|
void NotifyUserBreakpointChanged(
|
||||||
UserBreakpoint* breakpoint);
|
UserBreakpoint* breakpoint);
|
||||||
@@ -268,6 +277,20 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Team::ConsoleOutputEvent : public Event {
|
||||||
|
public:
|
||||||
|
ConsoleOutputEvent(uint32 type, Team* team,
|
||||||
|
int32 fd, const BString& output);
|
||||||
|
|
||||||
|
int32 Descriptor() const { return fDescriptor; }
|
||||||
|
const BString& Output() const { return fOutput; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int32 fDescriptor;
|
||||||
|
BString fOutput;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Team::DebugReportEvent : public Event {
|
class Team::DebugReportEvent : public Event {
|
||||||
public:
|
public:
|
||||||
DebugReportEvent(uint32 type, Team* team,
|
DebugReportEvent(uint32 type, Team* team,
|
||||||
@@ -323,6 +346,9 @@ public:
|
|||||||
virtual void ImageDebugInfoChanged(
|
virtual void ImageDebugInfoChanged(
|
||||||
const Team::ImageEvent& event);
|
const Team::ImageEvent& event);
|
||||||
|
|
||||||
|
virtual void ConsoleOutputReceived(
|
||||||
|
const Team::ConsoleOutputEvent& event);
|
||||||
|
|
||||||
virtual void BreakpointAdded(
|
virtual void BreakpointAdded(
|
||||||
const Team::BreakpointEvent& event);
|
const Team::BreakpointEvent& event);
|
||||||
virtual void BreakpointRemoved(
|
virtual void BreakpointRemoved(
|
||||||
|
|||||||
Reference in New Issue
Block a user