<commit_before>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import "dart:math";
import 'dart:sky';

void main() {
  print("Hello, world");

  double width = view.width;
  double height = view.height;

  PictureRecorder recorder = new PictureRecorder(width, height);
  double radius = min(width, height) * 0.45;

  Paint paint = new Paint()..setARGB(255, 0, 255, 0);

  recorder.drawCircle(width / 2, height / 2, radius, paint);

  print("Storing picture");
  view.picture = recorder.endRecording();

  print("Scheduling paint");
  view.schedulePaint();
}<commit_msg>Plumb input events into SkyView<commit_after>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import "dart:math";
import 'dart:sky';

Picture draw(int a, int r, int g, int b) {
  double width = view.width;
  double height = view.height;

  PictureRecorder recorder = new PictureRecorder(width, height);
  double radius = min(width, height) * 0.45;

  Paint paint = new Paint()..setARGB(a, r, g, b);
  recorder.drawCircle(width / 2, height / 2, radius, paint);
  return recorder.endRecording();
}

bool handleEvent(Event event) {
  if (event.type == "pointerdown") {
    view.picture = draw(255, 0, 0, 255);
    view.schedulePaint();
    return true;
  }

  if (event.type == "pointerup") {
    view.picture = draw(255, 0, 255, 0);
    view.schedulePaint();
    return true;
  }

  return false;
}

void main() {
  print("Hello, world");
  view.picture = draw(255, 0, 255, 0);
  view.schedulePaint();

  view.setEventCallback(handleEvent);
}
{'fraction_non_alphanumeric': 0.1341743119266055, 'fraction_numerical': 0.028669724770642203, 'mean_word_length': 3.7547683923705724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1980050', 'n_tokens_mistral': 619, 'n_tokens_neox': 550, 'n_words': 186}