Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KRFBDecoder Class Reference

#include </home/clem/local/src/opie/noncore/comm/keypebble/krfbdecoder.h>

Collaboration diagram for KRFBDecoder:

Collaboration graph
[legend]
List of all members.

Public Types

enum  State {
  AwaitingServerInit, AwaitingDesktopName, AwaitingUpdate, AwaitingRectHeader,
  AwaitingRawRectChunk, AwaitingCopyRectPos, AwaitingServerCutLength, AwaitingServerCutText,
  Idle, Error
}

Signals

void error (const QString &)
void status (const QString &)

Public Member Functions

 KRFBDecoder (KRFBConnection *con)
 ~KRFBDecoder ()
void setBuffer (KRFBBuffer *buf)
void start ()
int toKeySym (QKeyEvent *k)
void sendUpdateRequest (bool incremental)
void sendMouseEvent (QMouseEvent *e)
void sendKeyPressEvent (QKeyEvent *e)
void sendKeyReleaseEvent (QKeyEvent *e)
void sendCutEvent (const QString &text)

Protected Slots

void gotServerInit ()
void gotDesktopName ()
void gotUpdateHeader ()
void gotRectHeader ()
void gotRawRectChunk ()
void gotCopyRectPos ()
void gotServerCut ()
void gotServerCutLength ()
void gotServerCutText ()
void gotBell ()

Protected Member Functions

void decidePixelFormat ()
void sendPixelFormat ()
void sendClientInit ()
void sendAllowedEncodings ()
void handleRawRect ()
void handleCopyRect ()
void handleRRERect ()
void handleCoRRERect ()
void handleHexTileRect ()
void getRawRectChunk (int lines)

Protected Attributes

KRFBConnectioncon

Private Attributes

State currentState
State oldState
CARD16 noRects
CARD16 x
CARD16 y
CARD16 w
CARD16 h
int lines
CARD32 encoding
CARD32 serverCutTextLen
KRFBBufferbuf
KRFBServerInfoinfo
KRFBPixelFormatformat
CARD8 buttonMask

Friends

class KRFBBuffer

Detailed Description

Negotiates the pixel format to be used then decodes the resulting data stream.

Author:
Richard Moore, rich@kde.org

Definition at line 24 of file krfbdecoder.h.


Member Enumeration Documentation

enum KRFBDecoder::State
 

Enumeration values:
AwaitingServerInit 
AwaitingDesktopName 
AwaitingUpdate 
AwaitingRectHeader 
AwaitingRawRectChunk 
AwaitingCopyRectPos 
AwaitingServerCutLength 
AwaitingServerCutText 
Idle 
Error 

Definition at line 31 of file krfbdecoder.h.


Constructor & Destructor Documentation

KRFBDecoder::KRFBDecoder KRFBConnection con  ) 
 

Create a KRFBDecoder that reads data from a logged in KRFBConnection and sends its output to a KRFBBuffer.

Definition at line 111 of file krfbdecoder.cpp.

References assert, buf, buttonMask, KRFBConnection::Connected, currentState, format, Idle, info, and KRFBConnection::state().

KRFBDecoder::~KRFBDecoder  ) 
 

Definition at line 125 of file krfbdecoder.cpp.

References format, and info.


Member Function Documentation

void KRFBDecoder::decidePixelFormat  )  [protected]
 

Definition at line 244 of file krfbdecoder.cpp.

References assert, KRFBPixelFormat::blueMax, KRFBPixelFormat::blueShift, KRFBPixelFormat::bpp, con, KRFBPixelFormat::depth, format, KRFBPixelFormat::greenMax, KRFBPixelFormat::greenShift, info, oendl, KRFBConnection::options(), owarn, KRFBPixelFormat::redMax, KRFBPixelFormat::redShift, Swap16IfLE, and KRFBPixelFormat::trueColor.

Referenced by gotDesktopName().

void KRFBDecoder::error const QString  )  [signal]
 

Referenced by gotRectHeader(), and gotUpdateHeader().

void KRFBDecoder::getRawRectChunk int  lines  )  [protected]
 

Definition at line 507 of file krfbdecoder.cpp.

References AwaitingRawRectChunk, KRFBPixelFormat::bpp, con, currentState, format, gotRawRectChunk(), w, and KRFBConnection::waitForData().

Referenced by handleRawRect().

void KRFBDecoder::gotBell  )  [protected, slot]
 

Definition at line 747 of file krfbdecoder.cpp.

References AwaitingUpdate, buf, con, currentState, gotUpdateHeader(), Idle, oendl, oldState, owarn, KRFBBuffer::soundBell(), and UpdateHeaderLength.

Referenced by gotUpdateHeader().

void KRFBDecoder::gotCopyRectPos  )  [protected, slot]
 

Definition at line 576 of file krfbdecoder.cpp.

References AwaitingRectHeader, buf, con, KRFBBuffer::copyRect(), currentState, gotRectHeader(), h, Idle, noRects, KRFBConnection::read(), RectHeaderLength, Swap16IfLE, w, x, and y.

Referenced by handleCopyRect().

void KRFBDecoder::gotDesktopName  )  [protected, slot]
 

Definition at line 209 of file krfbdecoder.cpp.

References QString::arg(), assert, AwaitingDesktopName, buf, con, currentState, decidePixelFormat(), Idle, info, QString::latin1(), KRFBServerInfo::name, KRFBServerInfo::nameLength, oendl, owarn, KRFBConnection::read(), sendAllowedEncodings(), sendPixelFormat(), sendUpdateRequest(), status(), and tr.

Referenced by gotServerInit().

void KRFBDecoder::gotRawRectChunk  )  [protected, slot]
 

Definition at line 520 of file krfbdecoder.cpp.

References assert, AwaitingRawRectChunk, AwaitingRectHeader, KRFBPixelFormat::bpp, buf, con, currentState, KRFBBuffer::drawRawRectChunk(), format, gotRectHeader(), h, handleRawRect(), Idle, lines, noRects, KRFBConnection::read(), RectHeaderLength, sendUpdateRequest(), w, x, and y.

Referenced by getRawRectChunk().

void KRFBDecoder::gotRectHeader  )  [protected, slot]
 

Definition at line 418 of file krfbdecoder.cpp.

References assert, AwaitingRectHeader, con, CopyRectEncoding, CorreEncoding, currentState, encoding, error(), Error, h, handleCopyRect(), handleCoRRERect(), handleHexTileRect(), handleRawRect(), handleRRERect(), HexTileEncoding, oendl, owarn, RawEncoding, KRFBConnection::read(), RreEncoding, Swap16IfLE, Swap32IfLE, tr, w, x, and y.

Referenced by gotCopyRectPos(), gotRawRectChunk(), and gotUpdateHeader().

void KRFBDecoder::gotServerCut  )  [protected, slot]
 

Definition at line 675 of file krfbdecoder.cpp.

References AwaitingServerCutLength, con, currentState, gotServerCutLength(), oendl, owarn, ServerCutLenLength, and KRFBConnection::waitForData().

Referenced by gotUpdateHeader().

void KRFBDecoder::gotServerCutLength  )  [protected, slot]
 

Definition at line 684 of file krfbdecoder.cpp.

References assert, AwaitingServerCutLength, AwaitingServerCutText, con, currentState, gotServerCutText(), KRFBConnection::read(), serverCutTextLen, Swap32IfLE, and KRFBConnection::waitForData().

Referenced by gotServerCut().

void KRFBDecoder::gotServerCutText  )  [protected, slot]
 

Definition at line 701 of file krfbdecoder.cpp.

References assert, AwaitingServerCutText, AwaitingUpdate, con, currentState, gotUpdateHeader(), Idle, oendl, oldState, owarn, KRFBConnection::read(), serverCutTextLen, and UpdateHeaderLength.

Referenced by gotServerCutLength().

void KRFBDecoder::gotServerInit  )  [protected, slot]
 

Definition at line 153 of file krfbdecoder.cpp.

References AwaitingDesktopName, buf, con, currentState, gotDesktopName(), info, oendl, KRFBConnection::options(), owarn, KRFBConnection::read(), KRFBBuffer::resize(), status(), Swap16IfLE, Swap32IfLE, tr, and KRFBConnection::waitForData().

Referenced by sendClientInit().

void KRFBDecoder::gotUpdateHeader  )  [protected, slot]
 

Definition at line 371 of file krfbdecoder.cpp.

References assert, AwaitingRectHeader, AwaitingUpdate, BellId, con, currentState, error(), Error, gotBell(), gotRectHeader(), gotServerCut(), noRects, oldState, KRFBConnection::read(), RectHeaderLength, ServerCutId, Swap16IfLE, tr, UpdateId, and KRFBConnection::waitForData().

Referenced by gotBell(), gotServerCutText(), and sendUpdateRequest().

void KRFBDecoder::handleCopyRect  )  [protected]
 

Definition at line 569 of file krfbdecoder.cpp.

References AwaitingCopyRectPos, con, CopyRectPosLength, currentState, gotCopyRectPos(), and KRFBConnection::waitForData().

Referenced by gotRectHeader().

void KRFBDecoder::handleCoRRERect  )  [protected]
 

Definition at line 610 of file krfbdecoder.cpp.

References oendl, and owarn.

Referenced by gotRectHeader().

void KRFBDecoder::handleHexTileRect  )  [protected]
 

Definition at line 615 of file krfbdecoder.cpp.

References oendl, and owarn.

Referenced by gotRectHeader().

void KRFBDecoder::handleRawRect  )  [protected]
 

Definition at line 484 of file krfbdecoder.cpp.

References getRawRectChunk(), h, and RectChunkSize.

Referenced by gotRawRectChunk(), and gotRectHeader().

void KRFBDecoder::handleRRERect  )  [protected]
 

Definition at line 605 of file krfbdecoder.cpp.

References oendl, and owarn.

Referenced by gotRectHeader().

void KRFBDecoder::sendAllowedEncodings  )  [protected]
 

Definition at line 326 of file krfbdecoder.cpp.

References con, CopyRectEncoding, CorreEncoding, HexTileEncoding, KRFBConnection::options(), RawEncoding, RreEncoding, SetEncodingsId, Swap16IfLE, and KRFBConnection::write().

Referenced by gotDesktopName().

void KRFBDecoder::sendClientInit  )  [protected]
 

Definition at line 138 of file krfbdecoder.cpp.

References AwaitingServerInit, con, currentState, gotServerInit(), oendl, KRFBConnection::options(), owarn, ServerInitLength, status(), tr, KRFBConnection::waitForData(), and KRFBConnection::write().

Referenced by start().

void KRFBDecoder::sendCutEvent const QString text  ) 
 

Definition at line 654 of file krfbdecoder.cpp.

References ClientCutTextId, con, QCString::length(), QString::local8Bit(), Swap32IfLE, text, and KRFBConnection::write().

Referenced by KRFBConnection::sendCutText().

void KRFBDecoder::sendKeyPressEvent QKeyEvent *  e  ) 
 

Definition at line 767 of file krfbdecoder.cpp.

References con, KeyEventId, Swap32IfLE, toKeySym(), and KRFBConnection::write().

Referenced by KRFBBuffer::keyPressEvent().

void KRFBDecoder::sendKeyReleaseEvent QKeyEvent *  e  ) 
 

Definition at line 784 of file krfbdecoder.cpp.

References con, KeyEventId, Swap32IfLE, toKeySym(), and KRFBConnection::write().

Referenced by KRFBBuffer::keyReleaseEvent().

void KRFBDecoder::sendMouseEvent QMouseEvent *  e  ) 
 

Definition at line 620 of file krfbdecoder.cpp.

References buttonMask, con, KRFBConnection::options(), PointerEventId, Swap16IfLE, KRFBConnection::write(), x, and y.

Referenced by KRFBBuffer::mouseEvent().

void KRFBDecoder::sendPixelFormat  )  [protected]
 

Definition at line 305 of file krfbdecoder.cpp.

References KRFBPixelFormat::bigEndian, KRFBPixelFormat::blueMax, KRFBPixelFormat::blueShift, KRFBPixelFormat::bpp, con, KRFBPixelFormat::depth, format, KRFBPixelFormat::greenMax, KRFBPixelFormat::greenShift, KRFBPixelFormat::padding, KRFBPixelFormat::redMax, KRFBPixelFormat::redShift, SetPixelFormatId, KRFBPixelFormat::trueColor, and KRFBConnection::write().

Referenced by gotDesktopName().

void KRFBDecoder::sendUpdateRequest bool  incremental  ) 
 

Definition at line 348 of file krfbdecoder.cpp.

References AwaitingUpdate, con, currentState, gotUpdateHeader(), h, KRFBServerInfo::height, Idle, info, Swap16IfLE, UpdateHeaderLength, UpdateRequestId, w, KRFBConnection::waitForData(), KRFBServerInfo::width, KRFBConnection::write(), x, and y.

Referenced by gotDesktopName(), gotRawRectChunk(), KRFBConnection::refresh(), and KRFBConnection::updateTimer().

void KRFBDecoder::setBuffer KRFBBuffer buf  )  [inline]
 

Definition at line 51 of file krfbdecoder.h.

Referenced by KRFBConnection::gotRFBConnection().

void KRFBDecoder::start  ) 
 

Definition at line 133 of file krfbdecoder.cpp.

References sendClientInit().

void KRFBDecoder::status const QString  )  [signal]
 

Referenced by gotDesktopName(), gotServerInit(), and sendClientInit().

int KRFBDecoder::toKeySym QKeyEvent *  k  ) 
 

Definition at line 811 of file krfbdecoder.cpp.

References i, Qt::Key_Escape, Qt::Key_F12, and keyMap.

Referenced by sendKeyPressEvent(), and sendKeyReleaseEvent().


Friends And Related Function Documentation

friend class KRFBBuffer [friend]
 

Definition at line 26 of file krfbdecoder.h.


Member Data Documentation

KRFBBuffer* KRFBDecoder::buf [private]
 

Where we draw the data (and the source of our events).

Definition at line 123 of file krfbdecoder.h.

Referenced by gotBell(), gotCopyRectPos(), gotDesktopName(), gotRawRectChunk(), gotServerInit(), and KRFBDecoder().

CARD8 KRFBDecoder::buttonMask [private]
 

Definition at line 130 of file krfbdecoder.h.

Referenced by KRFBDecoder(), and sendMouseEvent().

KRFBConnection* KRFBDecoder::con [protected]
 

The connection to the server.

Definition at line 103 of file krfbdecoder.h.

Referenced by decidePixelFormat(), KRFBBuffer::drawRawRectChunk(), getRawRectChunk(), gotBell(), gotCopyRectPos(), gotDesktopName(), gotRawRectChunk(), gotRectHeader(), gotServerCut(), gotServerCutLength(), gotServerCutText(), gotServerInit(), gotUpdateHeader(), handleCopyRect(), sendAllowedEncodings(), sendClientInit(), sendCutEvent(), sendKeyPressEvent(), sendKeyReleaseEvent(), sendMouseEvent(), sendPixelFormat(), and sendUpdateRequest().

State KRFBDecoder::currentState [private]
 

Definition at line 105 of file krfbdecoder.h.

Referenced by getRawRectChunk(), gotBell(), gotCopyRectPos(), gotDesktopName(), gotRawRectChunk(), gotRectHeader(), gotServerCut(), gotServerCutLength(), gotServerCutText(), gotServerInit(), gotUpdateHeader(), handleCopyRect(), KRFBDecoder(), sendClientInit(), and sendUpdateRequest().

CARD32 KRFBDecoder::encoding [private]
 

Definition at line 118 of file krfbdecoder.h.

Referenced by gotRectHeader().

KRFBPixelFormat* KRFBDecoder::format [private]
 

The pixel format we want.

Definition at line 128 of file krfbdecoder.h.

Referenced by decidePixelFormat(), KRFBBuffer::drawRawRectChunk(), getRawRectChunk(), gotRawRectChunk(), KRFBDecoder(), sendPixelFormat(), and ~KRFBDecoder().

CARD16 KRFBDecoder::h [private]
 

Definition at line 116 of file krfbdecoder.h.

Referenced by gotCopyRectPos(), gotRawRectChunk(), gotRectHeader(), handleRawRect(), and sendUpdateRequest().

KRFBServerInfo* KRFBDecoder::info [private]
 

Info about the RFB server.

Definition at line 126 of file krfbdecoder.h.

Referenced by decidePixelFormat(), gotDesktopName(), gotServerInit(), KRFBDecoder(), sendUpdateRequest(), and ~KRFBDecoder().

int KRFBDecoder::lines [private]
 

Definition at line 117 of file krfbdecoder.h.

Referenced by gotRawRectChunk().

CARD16 KRFBDecoder::noRects [private]
 

Definition at line 111 of file krfbdecoder.h.

Referenced by gotCopyRectPos(), gotRawRectChunk(), and gotUpdateHeader().

State KRFBDecoder::oldState [private]
 

Definition at line 108 of file krfbdecoder.h.

Referenced by gotBell(), gotServerCutText(), and gotUpdateHeader().

CARD32 KRFBDecoder::serverCutTextLen [private]
 

Definition at line 120 of file krfbdecoder.h.

Referenced by gotServerCutLength(), and gotServerCutText().

CARD16 KRFBDecoder::w [private]
 

Definition at line 116 of file krfbdecoder.h.

Referenced by getRawRectChunk(), gotCopyRectPos(), gotRawRectChunk(), gotRectHeader(), and sendUpdateRequest().

CARD16 KRFBDecoder::x [private]
 

Definition at line 116 of file krfbdecoder.h.

Referenced by gotCopyRectPos(), gotRawRectChunk(), gotRectHeader(), sendMouseEvent(), and sendUpdateRequest().

CARD16 KRFBDecoder::y [private]
 

Definition at line 116 of file krfbdecoder.h.

Referenced by gotCopyRectPos(), gotRawRectChunk(), gotRectHeader(), sendMouseEvent(), and sendUpdateRequest().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:38:03 2005 for OPIE by  doxygen 1.4.2