KDEGames
kgameio.cpp
194 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "Mouse Event filter installed tracking=" << trackmouse;
224 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "KGameMouseIO" << this << QLatin1String( " " ) << e->type();
227 if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonRelease || e->type() == QEvent::MouseButtonDblClick
228 || e->type() == QEvent::Wheel || e->type() == QEvent::MouseMove || e->type() == QEvent::GraphicsSceneMousePress
229 || e->type() == QEvent::GraphicsSceneMouseRelease || e->type() == QEvent::GraphicsSceneMouseDoubleClick || e->type() == QEvent::GraphicsSceneWheel
265 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << ": this=" << this << ", sizeof(this)=" << sizeof(KGameProcessIO);
267 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssageServer ====================";
269 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssageClient ====================";
271 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssageProcessIO ====================";
273 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssage Add client ====================";
275 // qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssage SetSErver ====================";
277 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "================= KMEssage: Connect ====================";
284 connect(d->mProcessIO, &KMessageProcess::signalReceivedStderr, this, &KGameProcessIO::signalReceivedStderr);
346void KGameProcessIO::sendSystemMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
351void KGameProcessIO::sendMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
356void KGameProcessIO::sendAllMessages(QDataStream &stream, int msgid, quint32 receiver, quint32 sender, bool usermsg)
360 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "==============> KGameProcessIO::sendMessage (usermsg=" << usermsg << ")";
368 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "=============* ProcessIO (" << msgid << "," << receiver << "," << sender << ") ===========";
386// void KGameProcessIO::clientMessage(const QByteArray& receiveBuffer, quint32 clientID, const QValueList <quint32> &recv)
395 qCDebug(KDEGAMESPRIVATE_KGAME_LOG) << "************* Got process message sender =" << sender << "receiver=" << receiver << " msgid=" << msgid;
void signalReaction()
This signal is emitted when your computer player is meant to do something, or better is meant to be a...
void setAdvancePeriod(int ms)
Start a QTimer which calls advance every ms milli seconds.
Definition kgameio.cpp:474
void setReactionPeriod(int advanceCalls)
The number of advance calls until the player (or rather: the IO) does something (default: 1).
Definition kgameio.cpp:460
virtual void reaction()
Default implementation simply emits signalReaction.
Definition kgameio.cpp:523
void signalPrepareTurn(QDataStream &stream, bool turn, KGameIO *io, bool *send)
Signal generated when KPlayer::myTurn changes.
virtual void notifyTurn(bool b)
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition kgameio.cpp:82
virtual void initIO(KPlayer *p)
Init this device by setting the player and e.g.
Definition kgameio.cpp:77
bool sendInput(QDataStream &stream, bool transmit=true, quint32 sender=0)
Send an input message using KPlayer::forwardInput.
Definition kgameio.cpp:108
void signalKeyEvent(KGameIO *io, QDataStream &stream, QKeyEvent *m, bool *eatevent)
Signal handler for keyboard events.
bool eventFilter(QObject *o, QEvent *e) override
Internal method to process the events.
Definition kgameio.cpp:151
static void extractHeader(QDataStream &msg, quint32 &sender, quint32 &receiver, int &msgid)
Retrieves the information like cookie,sender,receiver,... from a message header.
Definition kgamemessage.cpp:53
static void createHeader(QDataStream &msg, quint32 sender, quint32 receiver, int msgid)
Creates a message header given cookie,sender,receiver,...
Definition kgamemessage.cpp:48
void signalMouseEvent(KGameIO *io, QDataStream &stream, QMouseEvent *m, bool *eatevent)
Signal handler for mouse events.
KGameMouseIO(QWidget *parent, bool trackmouse=false)
Creates a mouse IO device.
Definition kgameio.cpp:180
void setMouseTracking(bool b)
Manually activate or deactivate mouse tracking.
Definition kgameio.cpp:212
void notifyTurn(bool turn) override
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition kgameio.cpp:328
void receivedMessage(const QByteArray &receiveBuffer)
Internal message handler to receive data from the process.
Definition kgameio.cpp:387
void sendMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
Send a message to the process.
Definition kgameio.cpp:351
void sendSystemMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
Send a system message to the process.
Definition kgameio.cpp:346
void initIO(KPlayer *p) override
Init this device by setting the player and e.g.
Definition kgameio.cpp:308
void signalIOAdded(KGameIO *game, QDataStream &stream, KPlayer *p, bool *send)
Signal generated when the computer player is added.
void signalProcessQuery(QDataStream &stream, KGameProcessIO *me)
A computer query message is received.
void signalReceivedStderr(const QString &msg)
Text is received by the process on STDERR.
void sendAllMessages(QDataStream &stream, int msgid, quint32 receiver, quint32 sender, bool usermsg)
Internal combined function for all message handling.
Definition kgameio.cpp:356
KGameProcessIO(const QString &name)
Creates a computer player via a separate process.
Definition kgameio.cpp:260
void received(const QByteArray &msg)
This signal is emitted when /e send() on the connected KMessageIO object is called.
bool removeGameIO(KGameIO *input=nullptr, bool deleteit=true)
remove (and delete) a game IO device
Definition kplayer.cpp:278
virtual bool forwardInput(QDataStream &msg, bool transmit=true, quint32 sender=0)
Forwards input to the game object..internal use only.
Definition kplayer.cpp:173
int userId() const
Returns the user defined id of the player This value can be used arbitrary by you to have some user i...
Definition kplayer.cpp:145
virtual bool forwardMessage(QDataStream &msg, int msgid, quint32 receiver=0, quint32 sender=0)
Forwards Message to the game object..internal use only.
Definition kplayer.cpp:160
Q_SCRIPTABLE Q_NOREPLY void pause()
QByteArray & buffer()
virtual qint64 pos() const const override
virtual qint64 size() const const override
void clear()
char * data()
QByteArray fromRawData(const char *data, qsizetype size)
qsizetype size() const const
QIODevice * device() const const
int writeRawData(const char *s, int len)
KeyPress
Type type() const const
WriteOnly
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual bool eventFilter(QObject *watched, QEvent *event)
void installEventFilter(QObject *filterObj)
QObject * parent() const const
void removeEventFilter(QObject *obj)
QObject * sender() const const
void timeout()
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.