Exemplo n.º 1
0
SeedObject
seed_module_init(SeedEngine * local_eng)
{
  SeedObject db_constructor;
  seed_class_definition sqlite_class_def = seed_empty_class;

  eng = local_eng;

  namespace_ref = seed_make_object(eng->context, 0, 0);

  define_errors(eng);

  sqlite_class_def.class_name = "Database";
  sqlite_class_def.finalize = sqlite_database_finalize;
  sqlite_class_def.static_functions = database_funcs;

  sqlite_class = seed_create_class(&sqlite_class_def);

  db_constructor = seed_make_constructor(eng->context,
					 sqlite_class,
					 sqlite_construct_database);
  seed_object_set_property(eng->context,
			   namespace_ref, "Database", db_constructor);

  return namespace_ref;
}
Exemplo n.º 2
0
SeedObject
seed_module_init(SeedEngine *local_eng)
{
  SeedObject library_constructor;
  seed_class_definition ffi_library_def = seed_empty_class;
  seed_class_definition ffi_function_def = seed_empty_class;

  ffi_library_def.class_name = "FFILibrary";
  ffi_library_def.finalize = seed_ffi_library_finalize;
  ffi_library_def.get_property = seed_ffi_library_get_property;
  
  ffi_function_def.class_name = "FFIFunction";
  ffi_function_def.finalize = seed_ffi_function_finalize;
  ffi_function_def.static_values = ffi_function_values;
  ffi_function_def.call_as_function = seed_ffi_function_call;
  
  ffi_library_class = seed_create_class (&ffi_library_def);
  ffi_function_class = seed_create_class (&ffi_function_def);

  eng = local_eng;
  namespace_ref = seed_make_object (eng->context, NULL, NULL);
  
  library_constructor = seed_make_constructor (eng->context, ffi_library_class, seed_ffi_construct_library);
  seed_object_set_property (eng->context, namespace_ref, "Library", library_constructor);
  
  return namespace_ref;
}
Exemplo n.º 3
0
void
seed_define_cairo_pattern (SeedContext ctx,
			   SeedObject namespace_ref)
{
  SeedObject linear_constructor, radial_constructor;
  seed_class_definition pattern_def = seed_empty_class;

  pattern_def.class_name = "Pattern";
  pattern_def.finalize = seed_cairo_pattern_finalize;
  pattern_def.static_functions = pattern_funcs;

  seed_cairo_pattern_class = seed_create_class (&pattern_def);

  linear_constructor = seed_make_constructor (ctx, NULL, seed_cairo_construct_linear_gradient);
  seed_object_set_property(ctx, namespace_ref, "LinearGradient", linear_constructor);

  radial_constructor = seed_make_constructor (ctx, NULL, seed_cairo_construct_radial_gradient);
  seed_object_set_property(ctx, namespace_ref, "RadialGradient", radial_constructor);
}
Exemplo n.º 4
0
void
seed_define_cairo_pdf_surface (SeedContext ctx,
				 SeedObject namespace_ref)
{
  seed_class_definition pdf_def = seed_empty_class;

  pdf_def.class_name = "PDFSurface";
  pdf_def.static_values = pdf_surface_values;
  pdf_def.parent_class = seed_get_cairo_surface_class ();
  pdf_def.static_functions = pdf_surface_funcs;
  seed_cairo_pdf_surface_class = seed_create_class (&pdf_def);

  pdf_surface_constructor_ref = seed_make_constructor (ctx,
							 NULL,
							 //seed_cairo_pdf_surface_class,
							 seed_cairo_construct_pdf_surface);
  seed_object_set_property (ctx, namespace_ref, "PDFSurface", pdf_surface_constructor_ref);
}
Exemplo n.º 5
0
SeedObject
seed_module_init(SeedEngine * local_eng)
{
  SeedObject pipe_constructor;
  seed_class_definition pipe_class_def = seed_empty_class;
  eng = local_eng;

  namespace_ref = seed_make_object(eng->context, 0, 0);

  pipe_class_def.class_name = "Pipe";
  pipe_class_def.static_functions = pipe_funcs;
  pipe_class_def.finalize = pipe_finalize;

  pipe_class = seed_create_class(&pipe_class_def);

  pipe_constructor = seed_make_constructor(eng->context,
					   0, seed_construct_pipe);

  seed_object_set_property(eng->context,
			   namespace_ref, "Pipe", pipe_constructor);

  return namespace_ref;
}