Qt 4.8
Macros | Functions | Variables
qvncserver.cpp File Reference
#include "qvncserver.h"
#include <QtCore/qtimer.h>
#include <QtCore/qregexp.h>
#include <QtGui/qwidget.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qpainter.h>
#include <QtGui/qevent.h>
#include <QWindowSystemInterface>
#include <qplatformdefs.h>
#include <qdebug.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define QT_NO_QWS_CURSOR
 
#define QT_QWS_DEPTH16_RGB   565
 
#define QT_QWS_VNC_DEBUG
 

Functions

static bool buttonChange (Qt::MouseButtons before, Qt::MouseButtons after, Qt::MouseButton *button, bool *isPress)
 
QRgb qt_conv16ToRgb (ushort c)
 

Variables

struct {
   int   keycode
 
   int   keysym
 
keyMap []
 
static const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
 
static const int qt_blue_mask = (1<<qt_bbits)-1
 
static const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
 
static const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
 
static const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
 
static const int qt_green_rounding_shift = qt_green_shift + qt_gbits
 
static const int qt_green_shift = qt_bbits-(8-qt_gbits)
 
static const int qt_neg_blue_shift = 8-qt_bbits
 
static const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
 
static const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
 
static const int qt_red_rounding_shift = qt_red_shift + qt_rbits
 
static const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
 

Macro Definition Documentation

◆ QT_NO_QWS_CURSOR

#define QT_NO_QWS_CURSOR

Definition at line 61 of file qvncserver.cpp.

◆ QT_QWS_DEPTH16_RGB

#define QT_QWS_DEPTH16_RGB   565

Definition at line 70 of file qvncserver.cpp.

◆ QT_QWS_VNC_DEBUG

#define QT_QWS_VNC_DEBUG

Definition at line 60 of file qvncserver.cpp.

Function Documentation

◆ buttonChange()

static bool buttonChange ( Qt::MouseButtons  before,
Qt::MouseButtons  after,
Qt::MouseButton button,
bool *  isPress 
)
static

Definition at line 818 of file qvncserver.cpp.

819 {
820  if (before == after)
821  return false;
822  for (int b = Qt::LeftButton; b <= Qt::MidButton; b<<=1) {
823  if ((before & b) != (after & b)) {
824  *button = static_cast<Qt::MouseButton>(b);
825  *isPress = (after & b);
826  return true;
827  }
828  }
829  return false;
830 }
MouseButton
Definition: qnamespace.h:150

◆ qt_conv16ToRgb()

QRgb qt_conv16ToRgb ( ushort  c)
inline

Definition at line 87 of file qvncserver.cpp.

Referenced by buttonChange().

88 {
89  const int r=(c & qt_red_mask);
90  const int g=(c & qt_green_mask);
91  const int b=(c & qt_blue_mask);
92  const int tr = r >> qt_red_shift | r >> qt_red_rounding_shift;
93  const int tg = g >> qt_green_shift | g >> qt_green_rounding_shift;
94  const int tb = b << qt_neg_blue_shift | b >> qt_blue_rounding_shift;
95 
96  return qRgb(tr,tg,tb);
97 }
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_red_rounding_shift
Definition: qvncserver.cpp:82
static const int qt_red_shift
Definition: qvncserver.cpp:75
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
Definition: qrgb.h:69
static const int qt_red_mask
Definition: qvncserver.cpp:80
static const int qt_blue_mask
Definition: qvncserver.cpp:78
static const int qt_blue_rounding_shift
Definition: qvncserver.cpp:84
static const int qt_green_shift
Definition: qvncserver.cpp:76
static const int qt_green_mask
Definition: qvncserver.cpp:79
static const int qt_green_rounding_shift
Definition: qvncserver.cpp:83

Variable Documentation

◆ keycode

int keycode

Definition at line 105 of file qvncserver.cpp.

◆ keyMap

const { ... } keyMap[]

◆ keysym

int keysym

Definition at line 104 of file qvncserver.cpp.

◆ qt_bbits

const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
static

Definition at line 74 of file qvncserver.cpp.

◆ qt_blue_mask

const int qt_blue_mask = (1<<qt_bbits)-1
static

Definition at line 78 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_blue_rounding_shift

const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
static

Definition at line 84 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_gbits

const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
static

Definition at line 73 of file qvncserver.cpp.

◆ qt_green_mask

const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
static

Definition at line 79 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_green_rounding_shift

const int qt_green_rounding_shift = qt_green_shift + qt_gbits
static

Definition at line 83 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_green_shift

const int qt_green_shift = qt_bbits-(8-qt_gbits)
static

Definition at line 76 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_neg_blue_shift

const int qt_neg_blue_shift = 8-qt_bbits
static

Definition at line 77 of file qvncserver.cpp.

◆ qt_rbits

const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
static

Definition at line 72 of file qvncserver.cpp.

◆ qt_red_mask

const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
static

Definition at line 80 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_red_rounding_shift

const int qt_red_rounding_shift = qt_red_shift + qt_rbits
static

Definition at line 82 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_red_shift

const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
static

Definition at line 75 of file qvncserver.cpp.

Referenced by qt_conv16ToRgb().