Example #1
0
gfx::Size convert_args_into_size(script::Context& ctx)
{
  gfx::Size result;
  Size_new(ctx.handle());
  auto sz = (gfx::Size*)ctx.toUserData(-1, kTag);
  if (sz)
    result = *sz;
  ctx.pop(1);
  return result;
}
Example #2
0
void register_size_class(script::index_t idx, script::Context& ctx)
{
  ctx.registerClass(idx, kTag,
                    Size_new, 3,
                    Size_methods,
                    Size_props);
}
Example #3
0
void register_console_object(script::Context& ctx)
{
  ctx.pushGlobalObject();
  ctx.registerObject(-1, "console", Console_methods, nullptr);
  ctx.pop();
}
Example #4
0
void push_new_size(script::Context& ctx, const gfx::Size& sz)
{
  ctx.newObject(kTag, new gfx::Size(sz), Size_finalize);
}