libkdegames/libkdegamesprivate/kgame
kgameio.cpp
Go to the documentation of this file.
393 void KGameProcessIO::sendSystemMessage(QDataStream &stream,int msgid, quint32 receiver, quint32 sender)
398 void KGameProcessIO::sendMessage(QDataStream &stream,int msgid, quint32 receiver, quint32 sender)
403 void KGameProcessIO::sendAllMessages(QDataStream &stream,int msgid, quint32 receiver, quint32 sender, bool usermsg)
414 kDebug(11001) << "=============* ProcessIO (" << msgid << "," << receiver << "," << sender << ") ===========";
424 kDebug(11001) << " Adding user data from pos="<< device->pos() <<" amount=" << data.size() << "byte";
432 //void KGameProcessIO::clientMessage(const QByteArray& receiveBuffer, quint32 clientID, const QValueList <quint32> &recv)
Definition: kgamemessage.h:166
Definition: kgamemessage.h:158
void signalKeyEvent(KGameIO *io, QDataStream &stream, QKeyEvent *m, bool *eatevent)
Signal handler for keyboard events.
void signalProcessQuery(QDataStream &stream, KGameProcessIO *me)
A computer query message is received.
Type type() const
void clear()
virtual qint64 size() const
Definition: kgamemessage.h:169
virtual void notifyTurn(bool b)
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition: kgameio.cpp:96
Definition: kgameio.h:85
QObject * sender() const
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:180
Definition: kgameio.h:85
QByteArray fromRawData(const char *data, int size)
Definition: kgamemessage.h:163
void sendSystemMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
Send a system message to the process.
Definition: kgameio.cpp:393
QByteArray & buffer()
void setAdvancePeriod(int ms)
Start a QTimer which calls advance every ms milli seconds.
Definition: kgameio.cpp:533
void sendMessage(QDataStream &stream, int msgid, quint32 receiver, quint32 sender)
Send a message to the process.
Definition: kgameio.cpp:398
KGameMouseIO(QWidget *parent, bool trackmouse=false)
Creates a mouse IO device.
Definition: kgameio.cpp:203
void signalReaction()
This signal is emitted when your computer player is meant to do something, or better is meant to be a...
static void createHeader(QDataStream &msg, quint32 sender, quint32 receiver, int msgid)
Creates a message header given cookie,sender,receiver,...
Definition: kgamemessage.cpp:60
Definition: kgameio.h:85
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:165
void installEventFilter(QObject *filterObj)
Definition: kgamemessage.h:162
virtual bool eventFilter(QObject *watched, QEvent *event)
virtual void initIO(KPlayer *p)
Init this device by setting the player and e.g.
Definition: kgameio.cpp:91
virtual qint64 pos() const
bool eventFilter(QObject *o, QEvent *e)
Internal method to process the events.
Definition: kgameio.cpp:169
KGameProcessIO(const QString &name)
Creates a computer player via a separate process.
Definition: kgameio.cpp:302
void setMouseTracking(bool b)
Manually activate or deactivate mouse tracking.
Definition: kgameio.cpp:239
virtual void notifyTurn(bool turn)
Notifies the IO device that the player's setTurn had been called Called by KPlayer.
Definition: kgameio.cpp:373
void signalReceivedStderr(QString msg)
Text is received by the process on STDERR.
void signalPrepareTurn(QDataStream &stream, bool turn, KGameIO *io, bool *send)
Signal generated when KPlayer::myTurn changes.
void signalIOAdded(KGameIO *game, QDataStream &stream, KPlayer *p, bool *send)
Signal generated when the computer player is added.
bool sendInput(QDataStream &stream, bool transmit=true, quint32 sender=0)
Send an input message using KPlayer::forwardInput.
Definition: kgameio.cpp:125
Definition: kgameio.h:85
bool removeGameIO(KGameIO *input=0, bool deleteit=true)
remove (and delete) a game IO device
Definition: kplayer.cpp:283
int writeRawData(const char *s, int len)
void setMouseTracking(bool enable)
char * data()
virtual bool forwardInput(QDataStream &msg, bool transmit=true, quint32 sender=0)
Forwards input to the game object..internal use only.
Definition: kplayer.cpp:194
QIODevice * device() const
void signalMouseEvent(KGameIO *io, QDataStream &stream, QMouseEvent *m, bool *eatevent)
Signal handler for mouse events.
void sendAllMessages(QDataStream &stream, int msgid, quint32 receiver, quint32 sender, bool usermsg)
Internal ~ombined function for all message handling.
Definition: kgameio.cpp:403
KPlayer * player() const
This function returns the player who owns this IO.
Definition: kgameio.cpp:81
virtual void reaction()
Default implementation simply emits signalReaction.
Definition: kgameio.cpp:579
void receivedMessage(const QByteArray &receiveBuffer)
Internal message handler to receive data from the process.
Definition: kgameio.cpp:433
int size() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
void setReactionPeriod(int advanceCalls)
The number of advance calls until the player (or rather: the IO) does something (default: 1)...
Definition: kgameio.cpp:523
static void extractHeader(QDataStream &msg, quint32 &sender, quint32 &receiver, int &msgid)
Retrieves the information like cookie,sender,receiver,...
Definition: kgamemessage.cpp:65
void removeEventFilter(QObject *obj)
Definition: kmessageio.h:349
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.