示例#1
0
文件: canvas.c 项目: Shoes3/shoes3
VALUE shoes_canvas_displace(VALUE self, VALUE dx, VALUE dy) {
    SETUP_CANVAS();
    ATTRSET(canvas->attr, displace_left, dx);
    ATTRSET(canvas->attr, displace_top, dy);
    shoes_canvas_repaint_all(canvas->parent);
    return self;
}
示例#2
0
文件: canvas.c 项目: Shoes3/shoes3
VALUE shoes_canvas_move(VALUE self, VALUE x, VALUE y) {
    SETUP_CANVAS();
    ATTRSET(canvas->attr, left, x);
    ATTRSET(canvas->attr, top, y);
    shoes_canvas_repaint_all(canvas->parent);
    return self;
}
示例#3
0
文件: canvas.c 项目: Sitekurfer/shoes
VALUE
shoes_canvas_style(int argc, VALUE *argv, VALUE self)
{
  VALUE klass, attr;
  SETUP();

  rb_scan_args(argc, argv, "02", &klass, &attr);
  if (!NIL_P(attr))
    shoes_app_style(canvas->app, klass, attr);
  else if (!NIL_P(klass))
  {
    if (NIL_P(canvas->attr)) canvas->attr = rb_hash_new();
    rb_funcall(canvas->attr, s_update, 1, klass);
    shoes_canvas_repaint_all(canvas->parent);
  }

  return canvas->attr;
}
示例#4
0
文件: canvas.c 项目: Shoes3/shoes3
VALUE shoes_canvas_style(int argc, VALUE *argv, VALUE self) {
    rb_arg_list args;
    SETUP_CANVAS();

    switch (rb_parse_args(argc, argv, "kh,h,", &args)) {
        case 1:
            shoes_app_style(canvas->app, args.a[0], args.a[1]);
            break;

        case 2:
            if (NIL_P(canvas->attr)) canvas->attr = rb_hash_new();
            rb_funcall(canvas->attr, s_update, 1, args.a[0]);
            shoes_canvas_repaint_all(canvas->parent);
            break;

        case 3:
            return rb_obj_freeze(rb_obj_dup(canvas->attr));
    }

    return self;
}
示例#5
0
文件: ruby.c 项目: Shoes3/shoes3
//
// shoes_basic routines
//
VALUE shoes_basic_remove(VALUE self) {
    GET_STRUCT(basic, self_t);
    shoes_canvas_remove_item(self_t->parent, self, 0, 0);
    shoes_canvas_repaint_all(self_t->parent);
    return self;
}