Beispiel #1
0
/*
 * This function is called by decoders after each rectangle
 * has been successfully decoded.
 */
void fbupdate_rect_done(void)
{
  if (cur_rect.w != 0 && cur_rect.h != 0) {
    log_write(LL_DEBUG, "Received rectangle ok");

    /* Cached data for this rectangle is not valid any more */
    invalidate_enc_cache(&cur_rect);

    /* Save data in a file if necessary */
    fbs_flush_data();

    /* Queue this rectangle for each client */
    aio_walk_slots(fn_host_add_client_rect, TYPE_CL_SLOT);
  }

  if (--rect_count) {
    aio_setread(rf_host_fbupdate_recthdr, NULL, 12);
  } else {
    /* Done with the whole update */
    aio_walk_slots(fn_client_send_rects, TYPE_CL_SLOT);
    log_write(LL_DEBUG, "Requesting incremental framebuffer update");
    request_update(1);
    aio_setread(rf_host_msg, NULL, 1);
  }
}
Beispiel #2
0
static void host_really_activate(AIO_SLOT *slot)
{
  AIO_SLOT *saved_slot = cur_slot;
  HOST_SLOT *hs = (HOST_SLOT *)slot;

  log_write(LL_MSG, "Activating new host connection");
  slot->type = TYPE_HOST_ACTIVE_SLOT;
  s_host_slot = slot;

  write_active_file();
  perform_action("host_activate");

  /* Allocate the framebuffer or extend its dimensions if necessary */
  if (!alloc_framebuffer(hs->fb_width, hs->fb_height)) {
    aio_close(1);
    return;
  }

  /* Set default desktop geometry for new client connections */
  g_screen_info.width = hs->fb_width;
  g_screen_info.height = hs->fb_height;

  /* If requested, open file to save this session and write the header */
  fbs_open_file(hs->fb_width, hs->fb_height);

  cur_slot = slot;

  /* Reset zlib streams in the Tight decoder */
  reset_tight_streams();

  /* Request initial screen contents */
  log_write(LL_DETAIL, "Requesting full framebuffer update");
  request_update(0);
  aio_setread(rf_host_msg, NULL, 1);

  /* Notify clients about desktop geometry change */
  aio_walk_slots(fn_host_pass_newfbsize, TYPE_CL_SLOT);

  cur_slot = saved_slot;
}
Beispiel #3
0
static void reset_framebuffer(void)
{
  HOST_SLOT *hs = (HOST_SLOT *)cur_slot;
  FB_RECT r;
#ifdef CHROMIUM
  CARD32 *g_framebuffer;
  CARD16 g_fb_width, g_fb_height;
  g_framebuffer = GetFrameBuffer(&g_fb_width, &g_fb_height);
#else
  log_write(LL_DETAIL, "Clearing framebuffer and cache");
  memset(g_framebuffer, 0, g_fb_width * g_fb_height * sizeof(CARD32));
#endif

  r.x = r.y = 0;
  r.w = g_fb_width;
  r.h = g_fb_height;

  invalidate_enc_cache(&r);

  /* Queue changed rectangle (the whole host screen) for each client */
  r.w = hs->fb_width;
  r.h = hs->fb_height;
  aio_walk_slots(fn_host_add_client_rect, TYPE_CL_SLOT);
}
Beispiel #4
0
static void rf_host_pointerpos(void)
{
  aio_walk_slots(fn_client_send_pointerpos, TYPE_CL_SLOT);
}
Beispiel #5
0
static void rf_host_cursor(void)
{
  aio_walk_slots(fn_client_send_xcursor, TYPE_CL_SLOT);
}
Beispiel #6
0
static void rf_host_cuttext_data(void)
{
  cut_text = cur_slot->readbuf;
  aio_walk_slots(fn_host_pass_cuttext, TYPE_CL_SLOT);
  aio_setread(rf_host_msg, NULL, 1);
}
Beispiel #7
0
void signal_new_clipping(const BoxPtr bounds)
{
   NewClip = 1;
   NewClipBounds = *bounds;
   aio_walk_slots(fn_new_clip, TYPE_CL_SLOT);
}