package TestCase::NativeAPI2 {

  use SPVM::Hash;
  use SPVM::StringList;

  has first : rw TestCase::NativeAPI2;
  has last : rw TestCase::NativeAPI2;
  has sibparent : rw TestCase::NativeAPI2;
  has moresib : rw byte;
  has tag : rw string;
  has id : rw string;
  has style : rw SPVM::Hash;
  has classes : rw string[];
  has text : rw string;
  has calcurated_style : rw SPVM::Hash;
  has color : rw int;
  has background_color : rw int;
  has draw_left : rw int;
  has draw_top : rw int;
  has draw_width : rw int;
  has draw_height : rw int;
  has execution_order_before_z_index_sort : rw int;
  has z_index : rw int;
  
  sub new : TestCase::NativeAPI2 () {
    return new TestCase::NativeAPI2;
  }
  
  sub spvm_extension2 : int () {
    my $total = mul(5, 3);
    
    if ($total == 15) {
      return 1;
    }
    
    return 0;
  }

  native sub mul : int ($num1 : int, $num2 : int);

  native sub src_foo : int ();

  native sub src_bar : int ();
  
  sub get_string_field : int () {
    my $na = new TestCase::NativeAPI2;

    $na->set_text("Hello");

    $na->set_draw_left(1);
    $na->set_draw_top(2);
    $na->set_draw_width(3);
    $na->set_draw_height(4);
    
    my $ret = $na->get_string_field_native;
    
    return $ret;
  }
  
  native sub get_string_field_native : int ($self : self);
}