예제 #1
0
static void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
{
    int i, j, w=14, h=12;
    rfbCursorPtr c = rfbScreen->cursor;
    char bitmap[]=
                "**    **    **"
                " **   **   ** "
                "  **  **  **  "
                "   ** ** **   "
                "     ****     "
                "**************"
                "**************"
                "     ****     "
                "   ** ** **   "
                "  **  **  **  "
                " **   **   ** "
                "**    **    **";

    c = rfbScreen->cursor = rfbMakeXCursor(w,h, bitmap, bitmap);
    c->xhot = w/2; c->yhot = h/2;

    c->richSource = (unsigned char*)malloc(w*h*bpp);
    memset(c->richSource, 0XFF, w*h*bpp);
    memset(c->richSource, 0X00, w*bpp);
    memset(&c->richSource[(h-1)*w*bpp], 0X00, w*bpp);
    for(int j=1; j<h-1; j++)
    {
        memset(&c->richSource[j*w*bpp], 0X00, bpp);
        memset(&c->richSource[j*w*bpp+(w-1)*bpp], 0X00, bpp);
    }
    c->cleanupRichSource = TRUE;

}
예제 #2
0
void ScreenToVnc::init_fingerPointers()
{
    pointerFingerPtr = rfbMakeXCursor(pointer_finger.width,
                                      pointer_finger.height,
                                      pointer_finger.bitmask,
                                      pointer_finger.bitmask);

    pointerFingerTouchPtr = rfbMakeXCursor(pointer_finger_touch.width,
                                           pointer_finger_touch.height,
                                           pointer_finger_touch.bitmask,
                                           pointer_finger_touch.bitmask);

    emptyMousePtr = rfbMakeXCursor(empty_mouse.width,
                                   empty_mouse.height,
                                   empty_mouse.bitmask,
                                   empty_mouse.bitmask);
}
예제 #3
0
파일: cursor.cpp 프로젝트: AlexWMF/Carberp
void SetXCursor(rfbScreenInfoPtr rfbScreen,pcursor_info_t lpCursor)
{
    if (!lpCursor->rfb)
    {
        rfbCursorPtr c;

        c=rfbMakeXCursor(lpCursor->wx,lpCursor->wy,lpCursor->data,lpCursor->mask);
        c->xhot=lpCursor->sx;c->yhot=lpCursor->sy;
        c->cleanup=FALSE;
        lpCursor->rfb=c;
    }
	rfbSetCursor(rfbScreen,lpCursor->rfb);
}
예제 #4
0
static void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
{
  int i,j,w=32,h=32;
  rfbCursorPtr c = rfbScreen->cursor;
  char bitmap[]=
    "                                "
    "              xxxxxx            "
    "       xxxxxxxxxxxxxxxxx        "
    "      xxxxxxxxxxxxxxxxxxxxxx    "
    "    xxxxx  xxxxxxxx  xxxxxxxx   "
    "   xxxxxxxxxxxxxxxxxxxxxxxxxxx  "
    "  xxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
    "  xxxxx   xxxxxxxxxxx   xxxxxxx "
    "  xxxx     xxxxxxxxx     xxxxxx "
    "  xxxxx   xxxxxxxxxxx   xxxxxxx "
    " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
    " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
    " xxxxxxxxxxxx  xxxxxxxxxxxxxxx  "
    " xxxxxxxxxxxxxxxxxxxxxxxxxxxx   "
    " xxxxxxxxxxxxxxxxxxxxxxxxxxxx   "
    " xxxxxxxxxxx   xxxxxxxxxxxxxx   "
    " xxxxxxxxxx     xxxxxxxxxxxx    "
    "  xxxxxxxxx      xxxxxxxxx      "
    "   xxxxxxxxxx   xxxxxxxxx       "
    "      xxxxxxxxxxxxxxxxxxx       "
    "       xxxxxxxxxxxxxxxxxxx      "
    "         xxxxxxxxxxxxxxxxxxx    "
    "             xxxxxxxxxxxxxxxxx  "
    "                xxxxxxxxxxxxxxx "
    "   xxxx           xxxxxxxxxxxxx "
    "  xx   x            xxxxxxxxxxx "
    "  xxx               xxxxxxxxxxx "
    "  xxxx             xxxxxxxxxxx  "
    "   xxxxxx       xxxxxxxxxxxx    "
    "    xxxxxxxxxxxxxxxxxxxxxx      "
    "      xxxxxxxxxxxxxxxx          "
    "                                ";
  c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap);
  c->xhot = 16; c->yhot = 24;

  c->richSource = (char*)malloc(w*h*bpp);
  c->cleanupRichSource = TRUE;
  for(j=0;j<h;j++) {
    for(i=0;i<w;i++) {
      c->richSource[j*w*bpp+i*bpp+0]=i*0xff/w;
      c->richSource[j*w*bpp+i*bpp+1]=(i+j)*0xff/(w+h);
      c->richSource[j*w*bpp+i*bpp+2]=j*0xff/h;
      c->richSource[j*w*bpp+i*bpp+3]=0;
    }
  }
}
void LibVNCServer::init( uint port )
{
    uint bpp = (m_screen->size/(m_screen->width()*m_screen->height()));

    m_screenInfo = rfbGetScreen( 0, 0, m_screen->width(), m_screen->height(), 8, 3, bpp );
    m_screenInfo->frameBuffer = new char[m_screen->size];

    m_screenInfo->ptrAddEvent = ptrAddEvent;
    m_screenInfo->kbdAddEvent = kbdAddEvent;
    m_screenInfo->displayHook = displayHook;

    m_screenInfo->screenData = this;
    m_screenInfo->port += port;

    m_screen->data = reinterpret_cast< uchar* >( m_screenInfo->frameBuffer );

    if( !myCursor ) {
        myCursor = rfbMakeXCursor( 19, 19, (char*) cur, (char*) mask );
    }
    m_screenInfo->cursor = myCursor;

    rfbInitServer( m_screenInfo );

    switch( m_screenInfo->depth ) {
    case 32: updateServerFormat( m_screenInfo, 8, 8, 8, 16, 8, 0 ); break;
    //case 24: updateServerFormat( m_screenInfo, 8, 8, 8, 16, 8, 0 ); break;
    case 16: updateServerFormat( m_screenInfo, 5, 6, 5, 11, 5, 0 ); break;
    default:
        qFatal( "Unsupported screen depth %d, %d", m_screenInfo->depth, m_screen->depth() );
    }

    // Effectively this limits updates to 20fps
    m_screenInfo->deferUpdateTime = 50;

    if( !qgetenv("TOKEN_PATH").isEmpty() ) {
        m_screenInfo->authPasswdData = (void*) &passwords;
        m_screenInfo->passwordCheck = LibVNCServerCheckPasswordByList;
    }

    m_timer = new QTimer( this );
    m_timer->start( 0 );
    connect( m_timer, SIGNAL( timeout() ), this, SLOT( processEvents() ) );

    m_timerIdle = new QTimer( this );
    m_timerIdle->setSingleShot( true );
    m_timerIdle->start( 30000 );
    connect( m_timerIdle, SIGNAL( timeout() ), this, SLOT( checkIdle() ) );
}