Ejemplo n.º 1
0
static void
prepare_screenshot (void)
{
  AsyncExistenceJob *job;
  
  job = g_slice_new0 (AsyncExistenceJob);
  job->base_uris[0] = last_save_dir;
  /* we'll have to free these two */
  job->base_uris[1] = get_desktop_dir ();
  job->base_uris[2] = g_strconcat ("file://", g_get_tmp_dir (), NULL);
  job->iteration = 0;
  job->type = TEST_LAST_DIR;
  job->window = find_current_window (&window_title);
  job->rectangle = find_rectangle ();

  /* Check if the area selection was cancelled */
  if (job->rectangle &&
      (job->rectangle->width == 0 || job->rectangle->height == 0))
    {
      async_existence_job_free (job);
      gtk_main_quit ();
      return;
    }

  g_io_scheduler_push_job (try_check_file,
                           job,
                           NULL,
                           0, NULL);
                           
}
Ejemplo n.º 2
0
static gboolean
check_file_done (gpointer user_data)
{
  AsyncExistenceJob *job = user_data;

  finish_prepare_screenshot (job->retval, job->window, job->rectangle);

  async_existence_job_free (job);
  
  return FALSE;
}