[seed] Remove trailing whitespace all throughout examples/libseed, as it infuriates Git.
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Remove trailing whitespace all throughout examples/libseed, as it infuriates Git.
- Date: Wed, 1 Jul 2009 19:41:48 +0000 (UTC)
commit b3a3479cfd299097371eb7c451e4d4303e0b3910
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Wed Jul 1 10:49:09 2009 -0400
Remove trailing whitespace all throughout examples/libseed, as it infuriates Git.
examples/HACKING | 4 +-
examples/actions.js | 4 +-
examples/async-quine.js | 4 +-
examples/cairo.js | 8 +-
examples/calculator.js | 2 +-
examples/clutter-0.9.js | 30 +-
examples/clutter-cogl-0.8.js | 30 +-
examples/clutter-cogl-0.9.js | 30 +-
examples/n-oscillator.js | 26 +-
examples/pango-fontset.js | 4 +-
examples/pango.js | 134 ++++----
libseed/seed-api.c | 80 +++---
libseed/seed-builtins.c | 99 ++++---
libseed/seed-builtins.h | 20 +-
libseed/seed-closure.c | 50 ++--
libseed/seed-closure.h | 22 +-
libseed/seed-debug.h | 20 +-
libseed/seed-engine.c | 82 +++---
libseed/seed-engine.h | 22 +-
libseed/seed-exceptions.c | 24 +-
libseed/seed-exceptions.h | 22 +-
libseed/seed-gtype.c | 106 +++---
libseed/seed-gtype.h | 20 +-
libseed/seed-importer.c | 256 +++++++-------
libseed/seed-private.h | 20 +-
libseed/seed-signals.c | 50 ++--
libseed/seed-signals.h | 22 +-
libseed/seed-structs.c | 18 +-
libseed/seed-structs.h | 20 +-
libseed/seed-types.c | 86 +++---
libseed/seed-types.h | 20 +-
libseed/seed.h | 38 +-
modules/Multiprocessing/bi.js | 2 +-
modules/Multiprocessing/fork.js | 4 +-
modules/Multiprocessing/multi.c | 2 +-
modules/cairo/seed-cairo-enums.c | 10 +-
modules/cairo/seed-cairo-image-surface.c | 18 +-
modules/cairo/seed-cairo-matrix.c | 88 +++---
modules/cairo/seed-cairo-matrix.h | 4 +-
modules/cairo/seed-cairo-pattern.c | 34 +-
modules/cairo/seed-cairo-pdf-surface.c | 24 +-
modules/cairo/seed-cairo-surface.c | 48 ++--
modules/cairo/seed-cairo.c | 358 ++++++++++----------
modules/canvas/seed-canvas.c | 72 ++--
modules/dbus/dbus-exports.c | 106 +++---
modules/dbus/dbus-values.c | 54 ++--
modules/dbus/module.c | 52 ++--
modules/gettext/gettext.c | 12 +-
modules/gtkbuilder/gtkbuilder.c | 14 +-
modules/libxml/libxml.c | 68 ++--
modules/os/os.c | 242 +++++++-------
modules/readline/seed-readline.c | 16 +-
modules/sandbox/sandbox.c | 30 +-
modules/sqlite/seed-sqlite.c | 4 +-
src/main.c | 4 +-
tests/c/api-types.c | 4 +-
tests/javascript/enum.js | 2 +-
tests/javascript/gdk-event.js | 2 +-
.../gtypes/gtype-class-init-exception.js | 2 +-
tests/javascript/gtypes/gtype-extraprop.js | 2 +-
tests/javascript/gtypes/gtype-self.js | 2 +-
tests/javascript/gtypes/gtype.js | 2 +-
tests/javascript/introspect.js | 2 +-
tests/javascript/json.js | 2 +-
tests/javascript/type-conversion.js | 2 +-
tests/make-test.py | 2 +-
tests/run-tests.py | 10 +-
67 files changed, 1347 insertions(+), 1326 deletions(-)
---
diff --git a/examples/HACKING b/examples/HACKING
index 86286ce..f117da0 100644
--- a/examples/HACKING
+++ b/examples/HACKING
@@ -34,7 +34,7 @@ pong/
- An incomplete implementation of Pong in Clutter.
same-seed/
- - An in-progress Clutter port of Same Gnome. Makes heavy use of the new
+ - An in-progress Clutter port of Same Gnome. Makes heavy use of the new
Clutter 0.9 API, which is signficantly different from our older examples,
which all use Clutter 0.8.
@@ -58,7 +58,7 @@ async-quine.js: A Quine which loads itself asynchronouosly.
calculator.js: Simple Gtk widgets, packing, labels, signals. javascript eval.
clutter-cairo.js: Draws into a Clutter context using our Canvas extension.
clutter-cogl.js: Draw ripples from the mouse, using Clutter's COGL library.
-clutter-0.[8,9].js: Clutter, implementing custom Clutter animations, using
+clutter-0.[8,9].js: Clutter, implementing custom Clutter animations, using
Clutter effects (animations in 0.9), ClutterColor.
dbus-banshee.js: Plays the song specified as an argument in Banshee, over DBUS.
dbus-consolekit.js: Queries ConsoleKit over DBUS to determine if the invoking
diff --git a/examples/actions.js b/examples/actions.js
index a673ced..ebfbd2b 100755
--- a/examples/actions.js
+++ b/examples/actions.js
@@ -19,10 +19,10 @@ function make_action(def){
//Could pass string, but this makes it use default accelerator for STOCK_NEW
action.connect_accelerator();
action.signal.activate.connect(
- function (){
+ function (){
print(def.tooltip);
});
- return action;
+ return action;
}
window.add_accel_group(accels);
diff --git a/examples/async-quine.js b/examples/async-quine.js
index 28f344e..e4d9009 100755
--- a/examples/async-quine.js
+++ b/examples/async-quine.js
@@ -5,12 +5,12 @@ Gio = imports.gi.Gio;
var file = Gio.file_new_for_path("./async-quine.js");
-file.read_async(0, null,
+file.read_async(0, null,
function(source, result){
var stream = source.read_finish(result);
var dstream = new Gio.DataInputStream.c_new(stream);
var data = dstream.read_until("", 0);
-
+
print(data);
Seed.quit();
});
diff --git a/examples/cairo.js b/examples/cairo.js
index 7511838..2c1697c 100755
--- a/examples/cairo.js
+++ b/examples/cairo.js
@@ -8,20 +8,20 @@ const offset = -50.0;
function draw_arc(drawing_area){
var cr = new cairo.Context.from_drawable(drawing_area.window);
-
+
cr.scale(2, 2);
-
+
cr.operator = cairo.Operator.CLEAR;
cr.paint();
cr.operator = cairo.Operator.OVER;
-
+
var pat = new cairo.RadialGradient(115.2, 102.4, 25.6, 102.4, 102.4, 128);
pat.add_color_stop_rgba (0, 1, 1, 1, 1);
pat.add_color_stop_rgba (1, 0, 0, 0, 1);
cr.set_source (pat);
cr.arc(128, 128, 76.8, 0, 2*Math.PI);
cr.fill();
-
+
return false;
}
diff --git a/examples/calculator.js b/examples/calculator.js
index 3bc5cbe..41c9024 100755
--- a/examples/calculator.js
+++ b/examples/calculator.js
@@ -10,7 +10,7 @@ var calc_val = "";
function update_display(){
label.set_markup("<span size='30000'>" + calc_val + "</span>");
-
+
if(calc_val === ""){
label.set_markup("<span size='30000'>0</span>");
}
diff --git a/examples/clutter-0.9.js b/examples/clutter-0.9.js
index 4b9f174..1d7e707 100755
--- a/examples/clutter-0.9.js
+++ b/examples/clutter-0.9.js
@@ -7,10 +7,10 @@ GObject = imports.gi.GObject;
Clutter.init(Seed.argv);
-colors = [ "blanched almond",
- "OldLace",
- "MistyRose",
- "White",
+colors = [ "blanched almond",
+ "OldLace",
+ "MistyRose",
+ "White",
"LavenderBlush",
"CornflowerBlue",
"chartreuse",
@@ -24,24 +24,24 @@ function create_rectangles(rectangles, colors){
for (var i in colors){
var c = new Clutter.Color();
var r = new Clutter.Rectangle();
-
+
c.from_string(colors[i]);
-
+
r.width = r.height = stage.height / colors.length;
r.color = c;
r.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
r.y = i * r.height + r.height/2;
r.show();
-
+
stage.add_actor(r);
-
+
rectangles[i] = r;
}
}
function animate_rectangles(rectangles){
for (var i in rectangles){
- rectangles[i].anim =
+ rectangles[i].anim =
rectangles[i].animate(Clutter.AnimationMode.LINEAR, 5000,
{
x: stage.width / 2,
@@ -56,16 +56,16 @@ function animate_rectangles(rectangles){
blue:255,
green:255,
alpha:255});
-
+
var text = new Clutter.Text({text:"Congratulations!",
font_name:"Bitstream Vera Sans 40", color:white});
-
+
text.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
text.x = stage.width / 2;
text.y = -text.height; // Off-stage
stage.add_actor(text);
text.show();
- text.anim =
+ text.anim =
text.animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, 3000,
{
y: stage.height / 2
@@ -73,16 +73,16 @@ function animate_rectangles(rectangles){
text.anim.timeline.start();
for (var i in rectangles){
- rectangles[i].anim =
+ rectangles[i].anim =
rectangles[i].animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, 3000,
{
x: Math.random() * stage.width,
y: Math.random() * stage.height / 2 + stage.height / 2,
rotation_angle_z: rectangles[i].rotation_angle_z,
- opacity: 0
+ opacity: 0
});
//rotation_angle change makes it stop spinning. don't know why it's still
- //spinning here, it really should have stopped when the timeline did.
+ //spinning here, it really should have stopped when the timeline did.
rectangles[i].anim.timeline.start();
}
diff --git a/examples/clutter-cogl-0.8.js b/examples/clutter-cogl-0.8.js
index 101a8e8..bd6a7b0 100755
--- a/examples/clutter-cogl-0.8.js
+++ b/examples/clutter-cogl-0.8.js
@@ -26,11 +26,11 @@ function alpha_func(alpha){
var fps = timeline.fps;
var duration = n_frames/fps;
var time = frame/fps;
-
+
if ((time/=duration) < (1/2.75))
return Clutter.ALPHA_MAX_ALPHA*(7.5625*time*time);
else if (time < (2/2.75))
- return Clutter.ALPHA_MAX_ALPHA*(7.5625 *
+ return Clutter.ALPHA_MAX_ALPHA*(7.5625 *
(time-=(1.5/2.75))*time+0.75);
else if (time < (2.5/2.75))
return Clutter.ALPHA_MAX_ALPHA*(7.5625 *
@@ -50,45 +50,45 @@ function destroy_actor(actor){
function circle_paint (actor){
var radius = Clutter.double_to_fixed(actor.width/2);
-
+
actor.fill_color.alpha = actor.opacity;
-
+
Clutter.cogl_color(actor.fill_color);
Clutter.cogl_path_move_to(radius, radius);
Clutter.cogl_path_arc(radius, radius, radius, radius,
deg_to_rad(0),
deg_to_rad(360));
Clutter.cogl_path_line_to(radius - RIPPLE_WX/2, radius);
- Clutter.cogl_path_arc(radius, radius,
+ Clutter.cogl_path_arc(radius, radius,
radius-RIPPLE_WX/2, radius-RIPPLE_WX/2,
deg_to_rad(0),
deg_to_rad(360));
Clutter.cogl_path_close();
- Clutter.cogl_path_fill();
+ Clutter.cogl_path_fill();
}
function ripple(stage, x, y){
var transp = new Clutter.Color();
-
+
var n = parseInt(Math.random()*RIPPLE_N , 10) + 1;
-
+
for (i = 0; i < n; i++){
var actor = new Clutter.Rectangle({color: transp});
-
+
actor.fill_color = new Clutter.Color({red: 0xff,
green: 0xff,
blue: 0xff});
-
+
var size = ((RIPPLE_W * 2) * (i+1)) + (RIPPLE_G * i);
-
+
actor.width = actor.height = size;
actor.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
actor.x = x;
actor.y = y;
actor.opacity = 0x80;
-
+
stage.add_actor(actor);
-
+
actor.signal["paint"].connect(circle_paint);
Clutter.effect_scale(template,actor,
SCREEN_W / RIPPLE_W,
@@ -108,7 +108,7 @@ stage.color = {};
stage.signal["button_press_event"].connect(
function(stage, event){
ripple(stage, event.button.x, event.button.y);
-
+
return true;
});
@@ -117,7 +117,7 @@ stage.show();
function random_ripple(){
ripple(stage, Math.random()*SCREEN_W, Math.random()*SCREEN_H);
GLib.timeout_add(0, Math.random()*RIPPLE_MAXD+RIPPLE_MIND, random_ripple);
-
+
return false;
}
diff --git a/examples/clutter-cogl-0.9.js b/examples/clutter-cogl-0.9.js
index c7efe17..2809ce0 100755
--- a/examples/clutter-cogl-0.9.js
+++ b/examples/clutter-cogl-0.9.js
@@ -30,55 +30,55 @@ function destroy_actor(actor){
function circle_paint (actor){
var radius = actor.width/2;
-
+
actor.fill_color.alpha = actor.opacity;
-
+
Cogl.set_source_color(actor.fill_color);
Cogl.path_move_to(radius, radius);
Cogl.path_arc(radius, radius, radius, radius,
deg_to_rad(0),
deg_to_rad(360));
Cogl.path_line_to(radius - RIPPLE_WX/2, radius);
- Cogl.path_arc(radius, radius,
+ Cogl.path_arc(radius, radius,
radius-RIPPLE_WX/2, radius-RIPPLE_WX/2,
deg_to_rad(0),
deg_to_rad(360));
Cogl.path_close();
- Cogl.path_fill();
+ Cogl.path_fill();
}
function ripple(stage, x, y){
var transp = new Clutter.Color();
-
+
var n = parseInt(Math.random()*RIPPLE_N , 10) + 1;
-
+
for (i = 0; i < n; i++)
{
var actor = new Clutter.Rectangle({color: transp});
-
+
actor.fill_color = new Clutter.Color({red: 0xff,
green: 0xff,
blue: 0xff});
-
+
var size = ((RIPPLE_W * 2) * (i+1)) + (RIPPLE_G * i);
-
+
actor.width = actor.height = size;
actor.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
actor.x = x;
actor.y = y;
actor.opacity = 0x80;
-
+
stage.add_actor(actor);
-
+
actor.signal["paint"].connect(circle_paint);
-
+
actor.anim = actor.animate(Clutter.AnimationMode.EASE_OUT_BOUNCE, RIPPLE_S,
{
width: SCREEN_W / RIPPLE_W,
height: SCREEN_W / RIPPLE_W,
opacity: 0
});
-
+
actor.anim.timeline.start();
}
}
@@ -92,7 +92,7 @@ stage.color = {};
stage.signal["button_press_event"].connect(
function(stage, event){
ripple(stage, event.button.x, event.button.y);
-
+
return true;
});
@@ -101,7 +101,7 @@ stage.show();
function random_ripple(){
ripple(stage, Math.random()*SCREEN_W, Math.random()*SCREEN_H);
GLib.timeout_add(0, Math.random()*RIPPLE_MAXD+RIPPLE_MIND, random_ripple);
-
+
return false;
}
diff --git a/examples/n-oscillator.js b/examples/n-oscillator.js
index ec0d162..4241522 100755
--- a/examples/n-oscillator.js
+++ b/examples/n-oscillator.js
@@ -15,41 +15,41 @@ OscillatorWidget = new GType({
name: "OscillatorWidget",
class_init: function(klass, prototype)
{
- var flags = (GObject.ParamFlags.CONSTRUCT |
+ var flags = (GObject.ParamFlags.CONSTRUCT |
GObject.ParamFlags.READABLE |
GObject.ParamFlags.WRITABLE);
-
+
var ps = GObject.param_spec_float("frequency",
"Oscillator Frequency",
"The frequency of the audiotestsrc.",
0, 3000, 1000, flags);
-
+
klass.c_install_property(ps);
},
init: function()
{
// Private
-
+
var hbox = new Gtk.HBox();
var frequency_slider = new Gtk.VScale();
var volume_slider = new Gtk.VScale();
var button = new Gtk.ToggleButton({label: "Enabled"});
-
+
// No actual introspection data for audiotestsrc, so can not
// instantiate one with a constructor, have to use element_factory,
// likewise for the others.
var audiosrc = Gst.ElementFactory.make("audiotestsrc", "source" + unique_id);
var audiosink = Gst.ElementFactory.make("alsasink", "sink" + unique_id);
var volume = Gst.ElementFactory.make("volume", "volume" + unique_id);
-
+
unique_id++;
-
+
var toggle_enabled = function(button, that)
{
pipeline.set_state(Gst.State.PLAYING);
volume.volume = button.active ? volume_slider.get_value() : 0;
};
-
+
var set_frequency = function(range)
{
this.frequency = audiosrc.freq = range.get_value();
@@ -60,21 +60,21 @@ OscillatorWidget = new GType({
if(button.active)
volume.volume = range.get_value();
};
-
+
// Implementation
-
+
frequency_slider.adjustment.upper = 3000;
audiosrc.freq = frequency_slider.adjustment.value = this.frequency;
-
+
volume_slider.adjustment.upper = 10;
volume_slider.adjustment.value = 0.5;
volume.volume = 0;
-
+
pipeline.add(audiosrc);
pipeline.add(audiosink);
pipeline.add(volume);
audiosrc.link_many(volume, audiosink);
-
+
button.signal.toggled.connect(toggle_enabled);
frequency_slider.signal.value_changed.connect(set_frequency);
volume_slider.signal.value_changed.connect(set_volume);
diff --git a/examples/pango-fontset.js b/examples/pango-fontset.js
index 77ed4ce..1badebb 100755
--- a/examples/pango-fontset.js
+++ b/examples/pango-fontset.js
@@ -7,8 +7,8 @@ context = new Pango.Context();
description = new Pango.FontDescription.c_new();
description.set_family("");
fontmap = new PangoFT2.FontMap();
-fontset = fontmap.load_fontset(context,
- description,
+fontset = fontmap.load_fontset(context,
+ description,
Pango.language_get_default());
fontset.foreach(function(fontset, font){
description = font.describe();
diff --git a/examples/pango.js b/examples/pango.js
index abaec55..dec9333 100755
--- a/examples/pango.js
+++ b/examples/pango.js
@@ -22,7 +22,7 @@ var filename = GLib.build_filenamev([GLib.get_home_dir(),".pangojsrc"]);
var font_list = [];
selected_actor = null;
-// The PangoActor Clutter widget provides a draggable, in-place editable
+// The PangoActor Clutter widget provides a draggable, in-place editable
// text widget which provides evidence of its selection by pulsing.
PangoActor = new GType({
parent: Clutter.Text.type,
@@ -30,56 +30,56 @@ PangoActor = new GType({
init: function()
{
// Private
-
+
var dx, dy, dragging;
-
+
var actor_clicked = function (actor, event)
{
// Steal keyboard focus
gtkstage.has_focus = true;
-
+
// A double click allows the user to edit the text
if(event.button.click_count > 1)
{
actor.editable = true;
return true;
}
-
+
dx = event.button.x - actor.x;
dy = event.button.y - actor.y;
dragging = true;
-
+
actor.set_selected(true);
-
+
return false;
};
-
+
var actor_dragged = function (actor, event)
{
if(!dragging)
return false;
-
+
actor.x = event.motion.x - dx;
actor.y = event.motion.y - dy;
-
+
return false;
};
-
+
var actor_unclicked = function ()
{
dragging = false;
-
+
return false;
};
-
+
// Public
-
+
this.set_selected = function (selected)
{
if(selected)
{
var children = stage.get_children();
-
+
// Deselect all actors (except ourself)
for(var id in children)
if(children[id] != this)
@@ -90,19 +90,19 @@ PangoActor = new GType({
this.timeline.stop();
this.opacity = 255;
}
-
+
// Start a pulsing effect to indicate that this actor is selected
this.timeline = new Clutter.Timeline({fps:30, num_frames:628, loop:true});
this.timeline.signal.new_frame.connect(function(timeline, frame_num, ud)
{
ud.opacity = ((Math.sin(frame_num/7)+1) * 67) + 120;
}, this);
-
+
this.timeline.start();
-
+
// Raise selected actor to the top in z-order
stage.raise_child(this, null);
-
+
selected_actor = this;
properties.load_from_actor(this);
}
@@ -117,7 +117,7 @@ PangoActor = new GType({
}
}
};
-
+
this.serialize = function ()
{
var serobj = {};
@@ -125,21 +125,21 @@ PangoActor = new GType({
serobj.x = this.x;
serobj.y = this.y;
serobj.font_name = this.font_name;
-
+
//var icolor = this.get_color();
-
+
/*serobj.color = {red: icolor.red + 0,
green: icolor.green + 0,
blue: icolor.blue + 0,
alpha: 255};*/
-
+
//print(this.color.red);
-
+
return serobj;
}
-
+
// Implementation
-
+
this.text = "Hello, world!";
this.reactive = true;
this.signal.button_press_event.connect(actor_clicked);
@@ -157,112 +157,112 @@ PropertyEditor = new GType({
init: function()
{
// Private
-
+
var loading = false;
-
+
var new_button = new Gtk.ToolButton({stock_id:"gtk-add"});
var delete_button = new Gtk.ToolButton({stock_id:"gtk-delete"});
var clear_button = new Gtk.ToolButton({stock_id:"gtk-clear"});
-
+
var font_combo = new Gtk.ComboBox.text();
var size_scale = new Gtk.HScale();
var color_button = new Gtk.ColorButton();
-
+
var add_actor = function ()
{
stage.add_actor(new PangoActor({text: "Play with me!",
font_name: "DejaVu Sans 24"}));
stage.show_all();
};
-
+
var clear_actors = function ()
{
var children = stage.get_children();
-
+
for(var id in children)
stage.remove_actor(children[id]);
};
-
+
var delete_actor = function ()
{
stage.remove_actor(selected_actor);
selected_actor = null;
properties.load_from_actor(null);
};
-
+
var populate_font_selector = function (combo_box)
{
// List all of the fonts available to Pango, and populate the
- // font selection combo box with their names.
+ // font selection combo box with their names.
var context = new Pango.Context();
var description = new Pango.FontDescription.c_new();
description.set_family("");
var fontmap = new PangoFT2.FontMap();
- var fontset = fontmap.load_fontset(context,
- description,
+ var fontset = fontmap.load_fontset(context,
+ description,
Pango.language_get_default());
-
+
fontset.foreach(function(fontset, font)
{
font_list.push(font.describe().to_string().replace(" 0", ""));
});
font_list = font_list.sort();
-
+
for(var i in font_list)
combo_box.append_text(font_list[i]);
}
-
+
// Public
-
+
this.load_from_actor = function (actor)
{
- // If there is no selection, reset everything to defaults and
+ // If there is no selection, reset everything to defaults and
// prevent the user from editing the properties.
if(!actor)
{
delete_button.sensitive = size_scale.sensitive =
font_combo.sensitive = color_button.sensitive = false;
-
-
+
+
size_scale.set_value(0);
font_combo.set_active(-1);
color_button.color = {red: 0, green: 0, blue: 0};
-
+
return;
}
-
+
// Make all of the properties editable
delete_button.sensitive = size_scale.sensitive =
font_combo.sensitive = color_button.sensitive = true;
-
+
loading = true;
-
+
// Convert the actor's ClutterColor to a GdkColor
var aclr = new Clutter.Color();
actor.get_color(aclr);
color_button.set_color({red: (aclr.red / 255) * 65535,
green: (aclr.green / 255) * 65535,
blue: (aclr.blue / 255) * 65535});
-
+
// Parse and display the actor's font face and size
var pfd = Pango.Font.description_from_string(actor.get_font_name());
size_scale.set_value(parseFloat(pfd.to_string().match(new RegExp("[0-9\.]+$"),""), 10));
font_combo.set_active(font_list.indexOf(pfd.to_string().replace(new RegExp(" [0-9\.]+$"),"")));
-
+
loading = false;
};
-
+
this.commit_to_selected_actor = function ()
{
if(loading || !selected_actor)
return;
-
+
// Combine the selected font face and size, apply them to the actor
selected_actor.font_name = font_list[font_combo.get_active()] +
" " + size_scale.get_value();
-
+
// Convert ColorButton's GdkColor to a ClutterColor for the actor
var clr = new Gdk.Color();
color_button.get_color(clr);
@@ -271,31 +271,31 @@ PropertyEditor = new GType({
blue: (255*clr.blue) / 65535,
alpha: 255};
};
-
+
// Implementation
populate_font_selector(font_combo);
-
+
new_button.signal.clicked.connect(add_actor);
delete_button.signal.clicked.connect(delete_actor);
clear_button.signal.clicked.connect(clear_actors);
font_combo.signal.changed.connect(this.commit_to_selected_actor);
size_scale.signal.value_changed.connect(this.commit_to_selected_actor);
color_button.signal.color_set.connect(this.commit_to_selected_actor);
-
+
size_scale.adjustment.lower = 8;
size_scale.adjustment.upper = 200;
size_scale.adjustment.step_increment = 1;
size_scale.set_digits(0);
size_scale.set_draw_value(false);
-
+
this.pack_start(color_button);
this.pack_start(font_combo);
this.pack_start(size_scale, true, true);
this.pack_start(delete_button);
this.pack_start(clear_button);
this.pack_start(new_button);
-
+
// Initially display default values and prevent editing of properties
this.load_from_actor(null);
}
@@ -306,10 +306,10 @@ function clear_selected(actor, event)
// If the stage is clicked, deselect all actors
var children = stage.get_children();
-
+
for(var id in children)
children[id].set_selected(false);
-
+
selected_actor = null;
properties.load_from_actor(null);
@@ -319,7 +319,7 @@ function clear_selected(actor, event)
function create_default_actors()
{
// Add a few initial actors to explain the operation of the program
-
+
stage.add_actor(new PangoActor({text: "Welcome to the wild world of Seed+Clutter+Pango!",
font_name: "DejaVu Sans 16",
x: 20, y: 200}));
@@ -335,7 +335,7 @@ function create_default_actors()
stage.add_actor(new PangoActor({text: "styleable,",
font_name: "FreeMono 24",
x: 220, y: 335}));
-
+
stage.add_actor(new PangoActor({text: "and",
font_name: "DejaVu Sans 20",
x: 100, y: 370,
@@ -354,12 +354,12 @@ function save_and_quit()
{
var output = [];
var children = stage.get_children();
-
+
for(var id in children)
output.push(children[id].serialize());
-
+
Gio.simple_write(filename, JSON.stringify(output));
-
+
Gtk.main_quit();
}
@@ -369,7 +369,7 @@ function load_actors()
{
var file = Gio.file_new_for_path(filename);
var input = JSON.parse(file.read().get_contents());
-
+
for(var id in input)
stage.add_actor(new PangoActor(input[id]));
}
@@ -395,7 +395,7 @@ vbox.pack_start(properties);
window.resize(600, 600);
window.add(vbox);
window.show_all();
-
+
// Ask Clutter to return motion events at 60Hz to help make dragging smoother
Clutter.set_motion_events_frequency(60);
diff --git a/libseed/seed-api.c b/libseed/seed-api.c
index 63ebb74..bc080a6 100644
--- a/libseed/seed-api.c
+++ b/libseed/seed-api.c
@@ -1,17 +1,17 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -43,12 +43,12 @@ seed_value_protect (JSContextRef ctx,
* @ctx: A #SeedContext.
* @value: The #SeedValue to unprotect.
*
- * Decrements the "protection count" of @value, as explained in
+ * Decrements the "protection count" of @value, as explained in
* seed_value_protect().
*
*/
void
-seed_value_unprotect (JSContextRef ctx,
+seed_value_unprotect (JSContextRef ctx,
JSValueRef value)
{
JSValueUnprotect (ctx, value);
@@ -65,7 +65,7 @@ seed_value_unprotect (JSContextRef ctx,
*
*/
JSGlobalContextRef
-seed_context_create (JSContextGroupRef group,
+seed_context_create (JSContextGroupRef group,
JSClassRef global_class)
{
return JSGlobalContextCreateInGroup (group, global_class);
@@ -124,7 +124,7 @@ seed_make_null (JSContextRef ctx)
*/
JSObjectRef
seed_make_object (JSContextRef ctx,
- JSClassRef class,
+ JSClassRef class,
gpointer private)
{
return JSObjectMake (ctx, class, private);
@@ -167,7 +167,7 @@ seed_object_get_property_at_index (JSContextRef ctx,
* @this: The #SeedObject to use as the 'this' object inside the called function.
* @argument_count: The number of arguments in the @arguments array.
* @arguments: An array (@argument_count long) of #SeedValues to pass in as the
- * function's arguments.
+ * function's arguments.
* @exception: A reference to a #SeedValue in which to store any exceptions.
* Pass %NULL to ignore exceptions.
*
@@ -238,7 +238,7 @@ seed_make_script (JSContextRef ctx,
*
*/
SeedScript *
-seed_script_new_from_file (JSContextRef ctx,
+seed_script_new_from_file (JSContextRef ctx,
gchar * file)
{
SeedScript *script;
@@ -294,7 +294,7 @@ seed_evaluate (JSContextRef ctx,
*
*/
JSValueRef
-seed_simple_evaluate (JSContextRef ctx,
+seed_simple_evaluate (JSContextRef ctx,
const gchar * source,
JSValueRef *exception)
{
@@ -414,7 +414,7 @@ seed_string_unref (JSStringRef string)
* seed_create_class:
* @def: A #JSClassDefinition.
*
- * Return value: A #SeedClass, described by @def.
+ * Return value: A #SeedClass, described by @def.
*
*/
JSClassRef
@@ -423,7 +423,7 @@ seed_create_class (JSClassDefinition * def)
return JSClassCreate (def);
}
-/* TODO:FIXME: GtkDoc is choking on JSObjectCallAsConstructorCallback, and
+/* TODO:FIXME: GtkDoc is choking on JSObjectCallAsConstructorCallback, and
merging it into the parameter name...??! */
/**
@@ -563,7 +563,7 @@ seed_signal_connect_full (JSContextRef ctx,
GObject *object,
const gchar *signal,
JSObjectRef function,
- JSObjectRef user_data)
+ JSObjectRef user_data)
{
seed_gobject_signal_connect(ctx, signal, object, function,
NULL, user_data);
@@ -583,7 +583,7 @@ seed_signal_connect (JSContextRef ctx,
const gchar *script)
{
JSValueRef func;
-
+
func = seed_simple_evaluate(ctx, script, NULL);
seed_signal_connect_full(ctx, object, signal, (JSObjectRef)func,
NULL);
@@ -613,9 +613,9 @@ seed_context_get_global_object (JSGlobalContextRef ctx)
*/
JSObjectRef
-seed_make_array (JSContextRef ctx,
+seed_make_array (JSContextRef ctx,
const JSValueRef elements[],
- gsize num_elements,
+ gsize num_elements,
JSValueRef *exception)
{
return JSObjectMakeArray (ctx, num_elements, elements, exception);
@@ -625,7 +625,7 @@ seed_make_array (JSContextRef ctx,
* seed_make_undefined:
* @ctx: A valid #SeedContext
*
- * Note that this function returns a valid SeedValue,
+ * Note that this function returns a valid SeedValue,
* representing the undefined javascript value, and not an
* undefined SeedValue.
*
@@ -665,7 +665,7 @@ seed_object_copy_property_names(JSContextRef ctx,
JSPropertyNameArrayRef names;
guint i, length;
gchar **ret;
-
+
names = JSObjectCopyPropertyNames (ctx, object);
length = JSPropertyNameArrayGetCount (names);
ret = g_malloc((length+1)*sizeof(gchar *));
@@ -674,17 +674,17 @@ seed_object_copy_property_names(JSContextRef ctx,
JSStringRef name = JSPropertyNameArrayGetNameAtIndex (names, i);
guint max_length;
gchar *c_name;
-
+
max_length = JSStringGetMaximumUTF8CStringSize (name);
c_name = g_malloc (max_length * sizeof (gchar));
JSStringGetUTF8CString (name, c_name, length);
ret[i] = c_name;
-
+
}
ret[length] = NULL;
JSPropertyNameArrayRelease (names);
-
- return ret;
+
+ return ret;
}
/**
@@ -724,10 +724,10 @@ seed_make_function (JSContextRef ctx,
if (name)
jsname = JSStringCreateWithUTF8CString (name);
oref = JSObjectMakeFunctionWithCallback (ctx, NULL, func);
-
+
if (jsname)
JSStringRelease (jsname);
-
+
return oref;
}
@@ -737,7 +737,7 @@ seed_make_function (JSContextRef ctx,
* @format: Format string to use.
* @exception: Location to store an exception.
* @values: The values to convert.
- * @Varargs: A %NULL-terminated list of locations to store the results of conversion.
+ * @Varargs: A %NULL-terminated list of locations to store the results of conversion.
*
* A convenience API for converting multiple values at once, the format string
* is composed of single characters specifying types, for example:
@@ -748,11 +748,11 @@ seed_make_function (JSContextRef ctx,
* f: gdouble
* c: gchar
*
- * and a valid format string could be "iuo".
+ * and a valid format string could be "iuo".
*
- * This function may be in particular useful in converting arguments
+ * This function may be in particular useful in converting arguments
* in a #SeedFunctionCallback.
- * Return value: Whether conversion was successful.
+ * Return value: Whether conversion was successful.
*/
gboolean
seed_value_to_format (JSContextRef ctx,
@@ -764,16 +764,16 @@ seed_value_to_format (JSContextRef ctx,
va_list argp;
const gchar *c;
guint i = 0;
-
+
c = format;
-
+
va_start (argp, exception);
-
+
for (c = format; *c; c++)
{
JSValueRef val = values[i];
gpointer p = va_arg (argp, gpointer);
-
+
if (!val || !p)
{
va_end (argp);
@@ -814,8 +814,8 @@ seed_value_to_format (JSContextRef ctx,
}
i++;
}
-
+
va_end (argp);
return TRUE;
}
-
+
diff --git a/libseed/seed-builtins.c b/libseed/seed-builtins.c
index 1abf4e2..ea87929 100644
--- a/libseed/seed-builtins.c
+++ b/libseed/seed-builtins.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -30,18 +30,21 @@ seed_include (JSContextRef ctx,
JSObjectRef function,
JSObjectRef this_object,
size_t argumentCount,
- const JSValueRef arguments[],
- JSValueRef * exception)
+ const JSValueRef arguments[], JSValueRef * exception)
{
JSStringRef file_contents, file_name;
+
GDir *dir;
+
gchar *import_file, *abs_path;
+
gchar *buffer, *walk;
+
guint i;
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Seed.include expected 1 argument, "
"got %zd", argumentCount);
return JSValueMakeNull (ctx);
@@ -77,7 +80,7 @@ seed_include (JSContextRef ctx,
if (!buffer)
{
- seed_make_exception (ctx, exception, "FileNotFound",
+ seed_make_exception (ctx, exception, "FileNotFound",
"File not found: %s", import_file);
g_free (import_file);
@@ -115,20 +118,25 @@ seed_scoped_include (JSContextRef ctx,
JSObjectRef function,
JSObjectRef this_object,
size_t argumentCount,
- const JSValueRef arguments[],
- JSValueRef * exception)
+ const JSValueRef arguments[], JSValueRef * exception)
{
JSContextRef nctx;
+
JSObjectRef global;
+
JSStringRef file_contents, file_name;
+
GDir *dir;
+
gchar *import_file, *abs_path;
+
gchar *buffer, *walk;
+
guint i;
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Seed.include expected 1 argument, "
"got %zd", argumentCount);
return JSValueMakeNull (ctx);
@@ -139,7 +147,7 @@ seed_scoped_include (JSContextRef ctx,
/* just try current dir if no path set, or use the absolute path */
if (!eng->search_path || g_path_is_absolute (import_file))
g_file_get_contents (import_file, &buffer, 0, NULL);
- else /* A search path is set and path given is not absolute. */
+ else /* A search path is set and path given is not absolute. */
{
for (i = 0; i < g_strv_length (eng->search_path); ++i)
{
@@ -164,9 +172,9 @@ seed_scoped_include (JSContextRef ctx,
if (!buffer)
{
- seed_make_exception (ctx, exception, "FileNotFound",
+ seed_make_exception (ctx, exception, "FileNotFound",
"File not found: %s", import_file);
-
+
g_free (import_file);
g_free (buffer);
return JSValueMakeNull (ctx);
@@ -187,14 +195,14 @@ seed_scoped_include (JSContextRef ctx,
file_contents = JSStringCreateWithUTF8CString (walk);
file_name = JSStringCreateWithUTF8CString (import_file);
-
+
nctx = JSGlobalContextCreateInGroup (context_group, 0);
seed_prepare_global_context (nctx);
JSEvaluateScript (nctx, file_contents, NULL, file_name, 0, exception);
-
- global = JSContextGetGlobalObject(nctx);
-
+
+ global = JSContextGetGlobalObject (nctx);
+
JSGlobalContextRelease ((JSGlobalContextRef) nctx);
JSStringRelease (file_contents);
@@ -214,13 +222,14 @@ seed_print (JSContextRef ctx,
{
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
- "print expected 1 argument, got %zd",
+ seed_make_exception (ctx, exception, "ArgumentError",
+ "print expected 1 argument, got %zd",
argumentCount);
return JSValueMakeNull (ctx);
}
gchar *buf = seed_value_to_string (ctx, arguments[0], exception);
+
puts (buf);
g_free (buf);
@@ -237,6 +246,7 @@ seed_g_type_name_to_string (GITypeInfo * type)
if (type_tag == GI_TYPE_TAG_INTERFACE)
{
GIBaseInfo *interface = g_type_info_get_interface (type);
+
type_name = g_base_info_get_name (interface);
g_base_info_unref (interface);
}
@@ -258,12 +268,14 @@ seed_introspect (JSContextRef ctx,
// TODO: LEAKY!
GICallableInfo *info;
+
JSObjectRef data_obj, args_obj;
+
guint i;
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Seed.introspect expected 1 argument, "
"got %zd", argumentCount);
return JSValueMakeNull (ctx);
@@ -322,6 +334,7 @@ seed_check_syntax (JSContextRef ctx,
JSStringRef jsstr = JSValueToStringCopy (ctx,
arguments[0],
exception);
+
JSCheckScriptSyntax (ctx, jsstr, 0, 0, exception);
if (jsstr)
JSStringRelease (jsstr);
@@ -343,7 +356,9 @@ seed_spawn (JSContextRef ctx,
const JSValueRef arguments[], JSValueRef * exception)
{
gchar *line, *stdout, *stderr;
+
JSObjectRef ret;
+
GError *error = NULL;
if (argumentCount != 1)
@@ -391,7 +406,7 @@ seed_quit (JSContextRef ctx,
}
else if (argumentCount > 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Seed.quit expected " "1 argument, got %zd",
argumentCount);
}
@@ -406,35 +421,37 @@ seed_breakpoint (JSContextRef ctx,
size_t argumentCount,
const JSValueRef arguments[], JSValueRef * exception)
{
- G_BREAKPOINT();
+ G_BREAKPOINT ();
return JSValueMakeUndefined (ctx);
}
static JSValueRef
seed_argv_get_property (JSContextRef ctx,
- JSObjectRef object,
- JSStringRef property_name,
- JSValueRef * exception)
+ JSObjectRef object,
+ JSStringRef property_name, JSValueRef * exception)
{
SeedArgvPrivates *priv;
+
gchar *cproperty_name;
+
gint length;
+
gint index;
-
+
priv = JSObjectGetPrivate (object);
if (!priv->argc)
return JSValueMakeUndefined (ctx);
length = JSStringGetMaximumUTF8CStringSize (property_name);
cproperty_name = g_alloca (length * sizeof (gchar));
JSStringGetUTF8CString (property_name, cproperty_name, length);
-
+
if (!strcmp (cproperty_name, "length"))
{
return seed_value_from_int (ctx, priv->argc, exception);
}
index = atoi (cproperty_name);
- return seed_value_from_string (ctx, priv->argv[index], exception);
+ return seed_value_from_string (ctx, priv->argv[index], exception);
}
JSClassDefinition seed_argv_def = {
@@ -463,21 +480,25 @@ void
seed_init_builtins (SeedEngine * local_eng, gint * argc, gchar *** argv)
{
SeedArgvPrivates *priv;
+
JSObjectRef arrayObj;
+
JSObjectRef obj =
(JSObjectRef) seed_object_get_property (local_eng->context,
local_eng->global,
"Seed");
seed_create_function (local_eng->context, "include", &seed_include, obj);
- seed_create_function (local_eng->context, "scoped_include",
+ seed_create_function (local_eng->context, "scoped_include",
&seed_scoped_include, obj);
- seed_print_ref = JSObjectMakeFunctionWithCallback (local_eng->context, NULL, &seed_print);
+ seed_print_ref =
+ JSObjectMakeFunctionWithCallback (local_eng->context, NULL, &seed_print);
seed_object_set_property (local_eng->context, obj, "print", seed_print_ref);
- seed_object_set_property (local_eng->context, local_eng->global, "print", seed_print_ref);
+ seed_object_set_property (local_eng->context, local_eng->global, "print",
+ seed_print_ref);
JSValueProtect (local_eng->context, seed_print_ref);
-
+
seed_create_function (local_eng->context,
"check_syntax", &seed_check_syntax, obj);
seed_create_function (local_eng->context,
@@ -486,7 +507,7 @@ seed_init_builtins (SeedEngine * local_eng, gint * argc, gchar *** argv)
seed_create_function (local_eng->context, "quit", &seed_quit, obj);
seed_create_function (local_eng->context, "breakpoint",
&seed_breakpoint, obj);
-
+
priv = g_new0 (SeedArgvPrivates, 1);
priv->argv = argv ? *argv : 0;
priv->argc = argc ? *argc : 0;
@@ -495,5 +516,5 @@ seed_init_builtins (SeedEngine * local_eng, gint * argc, gchar *** argv)
arrayObj = JSObjectMake (local_eng->context, seed_argv_class, priv);
seed_object_set_property (local_eng->context, obj, "argv", arrayObj);
-
+
}
diff --git a/libseed/seed-builtins.h b/libseed/seed-builtins.h
index 259d9e7..d752fa6 100644
--- a/libseed/seed-builtins.h
+++ b/libseed/seed-builtins.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed-closure.c b/libseed/seed-closure.c
index 2ebdfd5..66313b0 100644
--- a/libseed/seed-closure.c
+++ b/libseed/seed-closure.c
@@ -1,17 +1,17 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
* along with Seed. If not, see <http://www.gnu.org/licenses/>.
-
+
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -35,7 +35,7 @@ seed_closure_finalize (JSObjectRef object)
g_callable_info_free_closure (privates->info, privates->closure);
g_base_info_unref ((GIBaseInfo *) privates->info);
g_base_info_unref ((GIBaseInfo *) privates->arg_info);
-
+
JSValueUnprotect (eng->context, object);
}
@@ -53,7 +53,7 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, void *userdata)
GArgument rarg;
GArgument return_arg;
JSContextRef ctx = JSGlobalContextCreateInGroup (context_group, 0);
-
+
seed_prepare_global_context (ctx);
SEED_NOTE (INVOCATION, "Invoking closure of type: %s \n",
@@ -182,7 +182,7 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, void *userdata)
exception = 0;
}
- seed_gi_make_argument (ctx, (JSValueRef) return_value, return_type, NULL,
+ seed_gi_make_argument (ctx, (JSValueRef) return_value, return_type, NULL,
&return_arg, 0);
switch (return_tag)
{
@@ -274,8 +274,8 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, void *userdata)
SeedNativeClosure *
seed_make_native_closure (JSContextRef ctx,
- GICallableInfo * info,
- GIArgInfo *arg_info,
+ GICallableInfo * info,
+ GIArgInfo *arg_info,
JSValueRef function)
{
ffi_cif *cif;
@@ -326,13 +326,13 @@ static void
closure_invalidated (gpointer data, GClosure * c)
{
SeedClosure *closure = (SeedClosure *) c;
-
+
SEED_NOTE (FINALIZATION, "Finalizing closure.");
if (closure->user_data && !JSValueIsUndefined(eng->context, closure->user_data))
JSValueUnprotect(eng->context, closure->user_data);
if (!JSValueIsUndefined (eng->context, closure->function))
JSValueUnprotect (eng->context, closure->function);
-
+
g_free (closure->description);
}
@@ -350,15 +350,15 @@ seed_closure_invoke (GClosure *closure, JSValueRef *args, guint argc, JSValueRef
JSValueRef *real_args = g_newa (JSValueRef, argc +1);
JSValueRef ret;
guint i;
-
+
seed_prepare_global_context (ctx);
for (i = 0; i < argc; i++)
real_args[i] = args[i];
args[argc] = ((SeedClosure *)closure)->user_data ? ((SeedClosure *)closure)->user_data : JSValueMakeNull (ctx);
-
+
ret = JSObjectCallAsFunction (ctx, ((SeedClosure *)closure)->function, NULL, argc+1, real_args, exception);
JSGlobalContextRelease ((JSGlobalContextRef) ctx);
-
+
return ret;
}
@@ -368,13 +368,13 @@ seed_closure_invoke_with_context (JSContextRef ctx, GClosure *closure, JSValueRe
JSValueRef *real_args = g_newa (JSValueRef, argc +1);
JSValueRef ret;
guint i;
-
+
for (i = 0; i < argc; i++)
real_args[i] = args[i];
args[argc] = ((SeedClosure *)closure)->user_data ? ((SeedClosure *)closure)->user_data : JSValueMakeNull (ctx);
-
+
ret = JSObjectCallAsFunction (ctx, ((SeedClosure *)closure)->function, NULL, argc+1, real_args, exception);
-
+
return ret;
}
@@ -394,7 +394,7 @@ seed_closure_new (JSContextRef ctx, JSObjectRef function, JSObjectRef user_data,
((SeedClosure *) closure)->user_data = user_data;
JSValueProtect(ctx, user_data);
}
-
+
if (description)
((SeedClosure *) closure)->description = g_strdup (description);
@@ -407,15 +407,15 @@ seed_closure_warn_exception (GClosure *c,
JSValueRef exception)
{
JSObjectRef callable = seed_closure_get_callable (c);
- gchar *name = seed_value_to_string (ctx,
+ gchar *name = seed_value_to_string (ctx,
seed_object_get_property (ctx, callable, "name"),
NULL);
gchar *mes = seed_exception_to_string (ctx, exception);
g_warning("Exception in closure (%p) for %s (handler %s). %s", c, ((SeedClosure *)c)->description, *name == '\0' ? "[anonymous]" : name, mes);
-
+
g_free (name);
- g_free (mes);
+ g_free (mes);
}
JSClassDefinition seed_native_callback_def = {
diff --git a/libseed/seed-closure.h b/libseed/seed-closure.h
index bd70d6c..58bac5a 100644
--- a/libseed/seed-closure.h
+++ b/libseed/seed-closure.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -52,7 +52,7 @@ SeedNativeClosure *seed_make_native_closure (JSContextRef ctx,
GIArgInfo *arg_info,
JSValueRef function);
GClosure *seed_closure_new (JSContextRef ctx,
- JSObjectRef function,
+ JSObjectRef function,
JSObjectRef user_data,
const gchar *description);
diff --git a/libseed/seed-debug.h b/libseed/seed-debug.h
index 2db38f9..8f804f1 100644
--- a/libseed/seed-debug.h
+++ b/libseed/seed-debug.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index 5f8d2dd..c06e143 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -64,7 +64,7 @@ void
seed_prepare_global_context (JSContextRef ctx)
{
JSObjectRef global = JSContextGetGlobalObject (ctx);
-
+
seed_object_set_property (ctx, global, "imports", importer);
seed_object_set_property (ctx, global, "GType", seed_gtype_constructor);
seed_object_set_property (ctx, global, "Seed", seed_obj_ref);
@@ -128,7 +128,7 @@ seed_gobject_constructor_invoked (JSContextRef ctx,
if (argumentCount > 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Constructor expects"
" 1 argument, got %zd", argumentCount);
@@ -203,12 +203,12 @@ seed_gobject_constructor_invoked (JSContextRef ctx,
if (jsprops)
JSPropertyNameArrayRelease (jsprops);
-
+
gobject = g_object_newv (type, ri, params);
- if (G_IS_INITIALLY_UNOWNED (gobject) &&
+ if (G_IS_INITIALLY_UNOWNED (gobject) &&
!g_object_is_floating(gobject))
g_object_ref(gobject);
else if (g_object_is_floating(gobject))
@@ -238,13 +238,13 @@ seed_gobject_property_type (JSContextRef ctx,
JSObjectRef function,
JSObjectRef this_object,
size_t argumentCount,
- const JSValueRef arguments[],
+ const JSValueRef arguments[],
JSValueRef * exception)
{
GParamSpec *spec;
gchar *name;
GObject *this;
-
+
if (argumentCount != 1)
{
seed_make_exception (ctx, exception, "ArgumentError",
@@ -252,13 +252,13 @@ seed_gobject_property_type (JSContextRef ctx,
"got %zd", argumentCount);
return JSValueMakeNull (ctx);
}
-
+
this = seed_value_to_object (ctx, this_object, exception);
name = seed_value_to_string (ctx, arguments[0], exception);
-
+
spec = g_object_class_find_property (G_OBJECT_GET_CLASS (this), name);
g_free (name);
-
+
return seed_value_from_long (ctx, spec->value_type, exception);
}
@@ -294,15 +294,15 @@ seed_gobject_init_build_argv (JSContextRef ctx,
{
guint i,length;
JSValueRef jsl;
-
+
jsl = seed_object_get_property (ctx, array, "length");
if (JSValueIsNull (ctx, jsl) || JSValueIsUndefined (ctx, jsl))
return FALSE;
-
+
length = seed_value_to_uint (ctx, jsl, exception);
priv->argv = g_new(gchar *, length);
priv->argc = length;
-
+
for (i = 0; i < length; i++)
{
priv->argv[i] = seed_value_to_string (ctx,
@@ -330,8 +330,8 @@ seed_gobject_init_method_invoked (JSContextRef ctx,
if (argumentCount != 1 && argumentCount != 2)
{
- seed_make_exception (ctx, exception,
- "ArgumentError", "init method expects 1 argument, got %zd",
+ seed_make_exception (ctx, exception,
+ "ArgumentError", "init method expects 1 argument, got %zd",
argumentCount);
return JSValueMakeUndefined (ctx);
}
@@ -339,7 +339,7 @@ seed_gobject_init_method_invoked (JSContextRef ctx,
if (argumentCount ==1)
{
if (JSValueIsNull (ctx, arguments[0]) || !JSValueIsObject (ctx, arguments[0]))
-
+
{
seed_make_exception (ctx, exception,
"ArgumentError", "init method expects an array object as argument");
@@ -361,11 +361,11 @@ seed_gobject_init_method_invoked (JSContextRef ctx,
"Init method expects an array as argument");
return JSValueMakeUndefined (ctx);
- }
+ }
allocated = TRUE;
}
}
-
+
info = JSObjectGetPrivate (function);
typelib = g_base_info_get_typelib (info);
g_typelib_symbol (typelib, g_function_info_get_symbol ((GIFunctionInfo *)info), (gpointer *)&c);
@@ -380,7 +380,7 @@ seed_gobject_init_method_invoked (JSContextRef ctx,
if (allocated)
g_free (priv->argv);
-
+
return JSValueMakeUndefined (ctx);
}
@@ -442,9 +442,9 @@ seed_gobject_method_invoked (JSContextRef ctx,
type_info, arg_info,
&in_args[n_in_args++], exception))
{
- seed_make_exception (ctx, exception,
- "ArgumentError",
- "Unable to make argument %d for"
+ seed_make_exception (ctx, exception,
+ "ArgumentError",
+ "Unable to make argument %d for"
" function: %s. \n",
i + 1,
g_base_info_get_name ((GIBaseInfo *) info));
@@ -892,7 +892,7 @@ seed_gobject_set_property (JSContextRef context,
if (seed_next_gobject_wrapper || JSValueIsNull (context, value))
return 0;
-
+
obj = seed_value_to_object (context, object, 0);
@@ -939,7 +939,7 @@ seed_gobject_set_property (JSContextRef context,
g_object_set_property (obj, cproperty_name, &gval);
if (glib_message != 0)
{
- seed_make_exception (context, exception, "PropertyError",
+ seed_make_exception (context, exception, "PropertyError",
glib_message, NULL);
return FALSE;
@@ -957,17 +957,17 @@ seed_gobject_constructor_convert_to_type (JSContextRef ctx,
JSValueRef *exception)
{
GType gtype;
-
+
if (type == kJSTypeString)
{
JSValueRef ret;
gchar *as_string;
gtype = (GType) JSObjectGetPrivate (object);
-
+
as_string = g_strdup_printf("[gobject_constructor %s]", g_type_name (gtype));
ret = seed_value_from_string (ctx, as_string, exception);
g_free (as_string);
-
+
return ret;
}
return FALSE;
@@ -986,7 +986,7 @@ JSClassDefinition gobject_def = {
NULL, /* Parent Class */
NULL, /* Static Values */
gobject_static_funcs, /* Static Functions */
- NULL,
+ NULL,
seed_gobject_finalize, /* Finalize */
NULL, /* Has Property */
seed_gobject_get_property, /* Get Property */
@@ -1121,8 +1121,8 @@ JSClassDefinition struct_constructor_def = {
void
seed_create_function (JSContextRef ctx,
- gchar * name,
- gpointer func,
+ gchar * name,
+ gpointer func,
JSObjectRef obj)
{
JSObjectRef oref;
@@ -1320,7 +1320,7 @@ seed_init (gint * argc, gchar *** argv)
g_irepository_require (g_irepository_get_default (), "GObject", NULL, 0, 0);
g_irepository_require (g_irepository_get_default (), "GIRepository",
NULL, 0, 0);
-
+
seed_initialize_importer (eng->context, eng->global);
seed_init_builtins (eng, argc, argv);
@@ -1338,14 +1338,14 @@ seed_init (gint * argc, gchar *** argv)
base_info_info =
g_irepository_find_by_name (0, "GIRepository", "IBaseInfo");
-
+
return eng;
}
SeedEngine *
-seed_init_with_context_group (gint * argc,
+seed_init_with_context_group (gint * argc,
gchar *** argv,
JSContextGroupRef group)
{
@@ -1417,6 +1417,6 @@ seed_init_with_context_group (gint * argc,
base_info_info =
g_irepository_find_by_name (0, "GIRepository", "IBaseInfo");
-
+
return eng;
}
diff --git a/libseed/seed-engine.h b/libseed/seed-engine.h
index 4030c1a..75dd87d 100644
--- a/libseed/seed-engine.h
+++ b/libseed/seed-engine.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -28,7 +28,7 @@ extern JSClassRef gobject_class;
extern JSClassRef gobject_method_class;
extern JSClassRef gobject_constructor_class;
extern JSClassRef gobject_named_constructor_class;
-extern JSClassRef seed_struct_constructor_class;
+extern JSClassRef seed_struct_constructor_class;
extern JSClassRef gobject_init_method_class;
extern __thread JSObjectRef seed_next_gobject_wrapper;
diff --git a/libseed/seed-exceptions.c b/libseed/seed-exceptions.c
index dae3729..341346f 100644
--- a/libseed/seed-exceptions.c
+++ b/libseed/seed-exceptions.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -35,7 +35,7 @@
void
seed_make_exception (JSContextRef ctx,
JSValueRef * exception,
- const gchar * name,
+ const gchar * name,
const gchar * message,
...)
{
@@ -44,10 +44,10 @@ seed_make_exception (JSContextRef ctx,
JSValueRef js_name_ref = 0, js_message_ref = 0;
JSObjectRef exception_obj;
va_list args;
-
+
if (!exception)
return;
-
+
va_start (args, message);
if (name)
@@ -71,7 +71,7 @@ seed_make_exception (JSContextRef ctx,
JSStringRelease (js_name);
JSStringRelease (js_message);
-
+
va_end (args);
}
diff --git a/libseed/seed-exceptions.h b/libseed/seed-exceptions.h
index 8ce9977..11a445a 100644
--- a/libseed/seed-exceptions.h
+++ b/libseed/seed-exceptions.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -34,7 +34,7 @@ void seed_make_exception (JSContextRef ctx, JSValueRef * exception,
const gchar * name, const gchar * message, ...) G_GNUC_PRINTF(4,5);
void seed_make_exception_from_gerror (JSContextRef ctx,
- JSValueRef * exception,
+ JSValueRef * exception,
GError * e);
gchar *seed_exception_get_name (JSContextRef ctx, JSValueRef e);
diff --git a/libseed/seed-gtype.c b/libseed/seed-gtype.c
index 02760d5..6cb37e6 100644
--- a/libseed/seed-gtype.c
+++ b/libseed/seed-gtype.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -33,7 +33,7 @@ GQuark qcinit;
typedef struct _SeedGClassPrivates {
JSObjectRef constructor;
JSObjectRef func;
-
+
JSObjectRef definition;
} SeedGClassPrivates;
@@ -52,7 +52,7 @@ seed_property_method_invoked (JSContextRef ctx,
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Property installation expected 1 argument"
" got %zd \n", argumentCount);
@@ -103,7 +103,7 @@ seed_gsignal_method_invoked (JSContextRef ctx,
/* Sanity check */
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Signal constructor expected 1 argument"
" got %zd \n", argumentCount);
return (JSObjectRef) JSValueMakeNull (ctx);
@@ -200,7 +200,7 @@ seed_gtype_builtin_set_property (GObject * object,
JSContextRef ctx = JSGlobalContextCreateInGroup (context_group, 0);
gchar *name = g_strjoin (NULL, "_", spec->name, NULL);
JSObjectRef jsobj = (JSObjectRef) seed_value_from_object (ctx, object, 0);
-
+
seed_prepare_global_context (ctx);
seed_object_set_property (ctx,
@@ -264,14 +264,14 @@ static GIBaseInfo *
seed_get_class_info_for_type (GType type)
{
GIBaseInfo *object_info;
-
+
while ((type = g_type_parent (type)))
{
object_info = g_irepository_find_by_gtype (NULL, type);
if (object_info)
{
return
- (GIBaseInfo *)g_object_info_get_class_struct
+ (GIBaseInfo *)g_object_info_get_class_struct
((GIObjectInfo *)object_info);
}
g_base_info_unref (object_info);
@@ -279,7 +279,7 @@ seed_get_class_info_for_type (GType type)
return NULL;
}
-static void
+static void
seed_attach_methods_to_class_object (JSContextRef ctx,
JSObjectRef object,
JSValueRef *exception)
@@ -301,25 +301,25 @@ seed_gtype_construct (GType type,
GObject *object;
GType parent;
GObjectClass *parent_class;
-
+
parent = g_type_parent (type);
parent_class = g_type_class_ref (parent);
-
+
object = parent_class->constructor (type, n_construct_params, construct_params);
-
+
g_type_class_unref (parent_class);
-
+
func = g_type_get_qdata (type, qiinit);
if (func)
{
ctx = JSGlobalContextCreateInGroup (context_group, 0);
seed_prepare_global_context (ctx);
-
+
SEED_NOTE (GTYPE, "Handling constructor for: %p with type: %s",
object, g_type_name (type));
this_object = (JSObjectRef) seed_value_from_object (ctx, object, NULL);
args[0] = this_object;
-
+
JSObjectCallAsFunction (ctx, func, this_object, 1, args, &exception);
if (exception)
{
@@ -329,7 +329,7 @@ seed_gtype_construct (GType type,
}
JSGlobalContextRelease ((JSGlobalContextRef) ctx);
}
-
+
return object;
}
@@ -341,15 +341,15 @@ seed_gtype_install_signals (JSContextRef ctx,
JSObjectRef signals;
JSValueRef jslength;
guint i, length;
-
+
signals = (JSObjectRef) seed_object_get_property (ctx, definition, "signals");
if (JSValueIsNull(ctx, signals) || !JSValueIsObject (ctx, signals))
return;
-
+
jslength = seed_object_get_property (ctx, signals, "length");
if (JSValueIsNull (ctx, jslength))
return;
-
+
length = seed_value_to_uint (ctx, jslength, NULL);
for (i = 0; i < length; i++)
{
@@ -360,41 +360,41 @@ seed_gtype_install_signals (JSContextRef ctx,
JSValueRef jsname, jsflags, jsreturn_type, jsparams;
gchar *name;
JSObjectRef signal_def = (JSObjectRef)JSObjectGetPropertyAtIndex (ctx,
- (JSObjectRef) signals,
+ (JSObjectRef) signals,
i,
NULL);
-
+
if (JSValueIsNull (ctx, signal_def) || !JSValueIsObject(ctx, signal_def))
continue;
// TODO: Error checking
jsname = seed_object_get_property (ctx, signal_def, "name");
name = seed_value_to_string (ctx, jsname, NULL);
-
+
SEED_NOTE(GTYPE, "Installing signal with name: %s on type: %s",
name, g_type_name (type));
-
+
jsflags = seed_object_get_property (ctx, (JSObjectRef) signal_def, "flags");
if (JSValueIsNull (ctx, jsflags) || !JSValueIsNumber (ctx, jsflags))
flags = G_SIGNAL_RUN_LAST;
else
flags = seed_value_to_long (ctx, jsflags, NULL);
-
+
jsreturn_type = seed_object_get_property (ctx, signal_def, "return_type");
if (JSValueIsNull (ctx, jsreturn_type) || !JSValueIsNumber (ctx, jsreturn_type))
return_type = G_TYPE_NONE;
else
return_type = seed_value_to_long (ctx, jsreturn_type, NULL);
-
+
jsparams = seed_object_get_property (ctx, signal_def, "parameters");
-
+
if (!JSValueIsNull (ctx, jsparams) && JSValueIsObject (ctx, jsparams))
{
n_params = seed_value_to_int (ctx, seed_object_get_property (ctx, (JSObjectRef) jsparams, "length"), NULL);
if (n_params > 0)
{
guint i;
-
+
param_types = g_alloca (sizeof (GType)*n_params);
for (i = 0; i < n_params; i++)
{
@@ -412,10 +412,10 @@ seed_gtype_install_signals (JSContextRef ctx,
flags, 0, 0, 0,
gi_cclosure_marshal_generic,
return_type, n_params, param_types);
- g_free (name);
-
+ g_free (name);
+
}
-
+
}
static void
@@ -428,7 +428,7 @@ seed_gtype_class_init (gpointer g_class,
JSValueRef jsargs[2];
GType type;
JSValueRef exception = 0;
-
+
priv = (SeedGClassPrivates *)class_data;
((GObjectClass *)g_class)->get_property = seed_gtype_get_property;
@@ -445,20 +445,20 @@ seed_gtype_class_init (gpointer g_class,
JSGlobalContextRelease ((JSGlobalContextRef) ctx);
return;
}
-
+
seed_prepare_global_context (ctx);
-
-
+
+
class_info = seed_get_class_info_for_type (type);
-
+
jsargs[0] = seed_make_struct (ctx, g_class, class_info);
jsargs[1] = seed_gobject_get_prototype_for_gtype (type);
-
+
seed_attach_methods_to_class_object (ctx, (JSObjectRef) jsargs[0], &exception);
-
+
g_base_info_unref ((GIBaseInfo *) class_info);
-
+
SEED_NOTE (GTYPE, "Marshalling class init for type: %s",
g_type_name (type));
@@ -476,7 +476,7 @@ seed_gtype_class_init (gpointer g_class,
g_free (mes);
}
- JSGlobalContextRelease ((JSGlobalContextRef) ctx);
+ JSGlobalContextRelease ((JSGlobalContextRef) ctx);
}
@@ -508,7 +508,7 @@ seed_gtype_constructor_invoked (JSContextRef ctx,
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"GType constructor expected 1 "
"argument, got %zd \n", argumentCount);
return (JSObjectRef) JSValueMakeNull (ctx);
@@ -549,7 +549,7 @@ seed_gtype_constructor_invoked (JSContextRef ctx,
type_info.class_size = query.class_size;
type_info.instance_size = query.instance_size;
type_info.class_init = seed_gtype_class_init;
-
+
priv = g_slice_alloc (sizeof (SeedGClassPrivates));
if (!JSValueIsNull (ctx, class_init) &&
@@ -566,20 +566,20 @@ seed_gtype_constructor_invoked (JSContextRef ctx,
JSValueProtect (ctx, constructor_ref);
priv->constructor = constructor_ref;
-
+
JSValueProtect (ctx, arguments[0]);
priv->definition = (JSObjectRef) arguments[0];
-
+
type_info.class_data = priv;
new_type = g_type_register_static (parent_type, new_name, &type_info, 0);
seed_gobject_get_class_for_gtype (ctx, new_type);
JSObjectSetPrivate (constructor_ref, (gpointer) new_type);
-
+
seed_object_set_property (ctx, constructor_ref,
"type", seed_value_from_int (ctx, new_type,
exception));
-
+
if (!JSValueIsNull (ctx, instance_init) &&
JSValueIsObject (ctx, instance_init) &&
JSObjectIsFunction (ctx, (JSObjectRef) instance_init))
@@ -604,7 +604,7 @@ seed_param_getter_invoked (JSContextRef ctx,
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"ParamSpec.get expected "
"1 argument, got %zd", argumentCount);
@@ -637,7 +637,7 @@ seed_param_setter_invoked (JSContextRef ctx,
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"ParamSpec.set expected "
"1 argument, got %zd", argumentCount);
diff --git a/libseed/seed-gtype.h b/libseed/seed-gtype.h
index 5146bee..6cdf66a 100644
--- a/libseed/seed-gtype.h
+++ b/libseed/seed-gtype.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index e866006..ad8a88b 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -49,10 +49,10 @@ GHashTable *file_imports;
* native module and return the module object.
* - If it is a file and does not end in G_MODULE_SUFFIX, evaluate it as a
* JavaScript file in a NEW global context, and return the global object
- * for that context.
+ * for that context.
*/
-/*
+/*
* Handle definition of toplevel functions in a namespace.
* i.e. Gtk.main
*/
@@ -66,7 +66,7 @@ seed_gi_importer_is_init (GIFunctionInfo *info)
}
if (g_callable_info_get_n_args ((GICallableInfo *)info) != 2)
return FALSE;
-
+
return TRUE;
}
@@ -77,14 +77,14 @@ seed_gi_importer_handle_function (JSContextRef ctx,
JSValueRef *exception)
{
if (!seed_gi_importer_is_init (info))
- seed_gobject_define_property_from_function_info (ctx,
+ seed_gobject_define_property_from_function_info (ctx,
(GIFunctionInfo *) info,
namespace_ref, FALSE);
else
{
JSObjectRef init_method;
-
- init_method = JSObjectMake(ctx, gobject_init_method_class,
+
+ init_method = JSObjectMake(ctx, gobject_init_method_class,
g_base_info_ref ((GIBaseInfo *)info));
seed_object_set_property (ctx, namespace_ref, "init", init_method);
}
@@ -104,11 +104,11 @@ seed_gi_importer_handle_enum (JSContextRef ctx,
{
JSObjectRef enum_class;
gint num_vals, j;
-
+
enum_class = JSObjectMake (ctx, 0, 0);
num_vals = g_enum_info_get_n_values (info);
- seed_object_set_property (ctx, namespace_ref,
- g_base_info_get_name ((GIBaseInfo *)info),
+ seed_object_set_property (ctx, namespace_ref,
+ g_base_info_get_name ((GIBaseInfo *)info),
enum_class);
for (j = 0; j < num_vals; j++)
@@ -121,22 +121,22 @@ seed_gi_importer_handle_enum (JSContextRef ctx,
gint name_len = strlen (name);
gint j;
JSValueRef value_ref;
-
+
value_ref = JSValueMakeNumber (ctx, value);
JSValueProtect (ctx, (JSValueRef) value_ref);
-
+
for (j = 0; j < name_len; j++)
{
if (name[j] == '-')
name[j] = '_';
name[j] = g_ascii_toupper (name[j]);
}
-
+
seed_object_set_property (ctx, enum_class, name, value_ref);
-
+
g_free (name);
g_base_info_unref ((GIBaseInfo *) val);
-
+
}
}
@@ -153,24 +153,24 @@ seed_gi_importer_handle_object (JSContextRef ctx,
{
GType type;
JSClassRef class_ref;
-
- type =
+
+ type =
g_registered_type_info_get_g_type ((GIRegisteredTypeInfo *) info);
-
+
if (type != 0)
{
GIFunctionInfo *finfo;
GIFunctionInfoFlags flags;
JSObjectRef constructor_ref;
guint i, n_methods;
-
+
class_ref = seed_gobject_get_class_for_gtype (ctx, type);
-
+
constructor_ref =
JSObjectMake (ctx,
- gobject_constructor_class,
+ gobject_constructor_class,
(gpointer) type);
-
+
seed_object_set_property (ctx, constructor_ref,
"type",
seed_value_from_long (ctx, type, exception));
@@ -190,7 +190,7 @@ seed_gi_importer_handle_object (JSContextRef ctx,
fname += 4;
else if (!strcmp (fname, "new"))
fname = "c_new";
-
+
seed_object_set_property (ctx,
constructor_ref,
fname, constructor);
@@ -207,7 +207,7 @@ seed_gi_importer_handle_object (JSContextRef ctx,
}
seed_object_set_property (ctx, namespace_ref,
- g_base_info_get_name ((GIBaseInfo *) info),
+ g_base_info_get_name ((GIBaseInfo *) info),
constructor_ref);
seed_object_set_property (ctx, constructor_ref,
"prototype",
@@ -229,31 +229,31 @@ seed_gi_importer_handle_struct (JSContextRef ctx,
JSObjectRef proto;
gint i, n_methods;
GIFunctionInfo *finfo;
-
+
struct_ref =
JSObjectMake (ctx, seed_struct_constructor_class, info);
-
+
n_methods = g_struct_info_get_n_methods (info);
-
+
for (i = 0; i < n_methods; i++)
{
GIFunctionInfoFlags flags;
finfo = g_struct_info_get_method (info, i);
-
+
flags = g_function_info_get_flags (finfo);
-
+
if (flags & GI_FUNCTION_IS_CONSTRUCTOR)
{
JSObjectRef constructor = JSObjectMake (ctx,
gobject_named_constructor_class,
finfo);
- const gchar *fname =
+ const gchar *fname =
g_base_info_get_name ((GIBaseInfo *) finfo);
if (g_str_has_prefix (fname, "new_"))
fname += 4;
else if (!strcmp (fname, "new"))
fname = "c_new";
-
+
seed_object_set_property (ctx, struct_ref, fname, constructor);
}
else if (flags & GI_FUNCTION_IS_METHOD)
@@ -262,10 +262,10 @@ seed_gi_importer_handle_struct (JSContextRef ctx,
seed_gobject_define_property_from_function_info
(ctx, finfo, struct_ref, FALSE);
}
-
+
proto = seed_struct_prototype (ctx, (GIBaseInfo *)info);
seed_object_set_property (ctx, struct_ref, "prototype", proto);
-
+
seed_object_set_property (ctx, namespace_ref, g_base_info_get_name ((GIBaseInfo *)info), struct_ref);
}
@@ -279,29 +279,29 @@ seed_gi_importer_handle_union (JSContextRef ctx,
JSObjectRef proto;
gint i, n_methods;
GIFunctionInfo *finfo;
-
+
union_ref =
JSObjectMake (ctx, seed_struct_constructor_class, info);
-
+
n_methods = g_union_info_get_n_methods (info);
-
+
for (i = 0; i < n_methods; i++)
{
GIFunctionInfoFlags flags;
finfo = g_union_info_get_method (info, i);
-
+
flags = g_function_info_get_flags (finfo);
-
+
if (flags & GI_FUNCTION_IS_METHOD)
g_base_info_unref ((GIBaseInfo *) finfo);
else
seed_gobject_define_property_from_function_info
(ctx, finfo, union_ref, FALSE);
}
-
+
proto = seed_union_prototype (ctx, (GIBaseInfo *)info);
seed_object_set_property (ctx, union_ref, "prototype", proto);
-
+
seed_object_set_property (ctx, namespace_ref, g_base_info_get_name ((GIBaseInfo *)info), union_ref);
}
@@ -311,7 +311,7 @@ seed_gi_importer_handle_callback (JSContextRef ctx,
GICallbackInfo *info,
JSValueRef *exception)
{
- JSObjectRef callback_ref = JSObjectMake (ctx,
+ JSObjectRef callback_ref = JSObjectMake (ctx,
seed_callback_class,
info);
seed_object_set_property (ctx, namespace_ref,
@@ -319,7 +319,7 @@ seed_gi_importer_handle_callback (JSContextRef ctx,
(JSValueRef) callback_ref);
}
-/*
+/*
* Define constants toplevel. Uses the casing as in the typelib
*/
static void
@@ -332,7 +332,7 @@ seed_gi_importer_handle_constant (JSContextRef ctx,
GITypeInfo *constant_type =
g_constant_info_get_type (info);
JSValueRef constant_value;
-
+
g_constant_info_get_value (info, &argument);
constant_value =
seed_gi_argument_make_js (ctx, &argument,
@@ -340,7 +340,7 @@ seed_gi_importer_handle_constant (JSContextRef ctx,
seed_object_set_property (ctx, namespace_ref,
g_base_info_get_name ((GIBaseInfo *) info),
constant_value);
-
+
g_base_info_unref ((GIBaseInfo *) constant_type);
}
@@ -351,12 +351,12 @@ seed_gi_importer_get_version (JSContextRef ctx,
{
JSValueRef version_ref;
gchar *version = NULL;
-
+
version_ref = seed_object_get_property (ctx, gi_importer_versions, namespace);
if (!JSValueIsUndefined(ctx, version_ref))
version = seed_value_to_string (ctx, version_ref, exception);
-
- return version;
+
+ return version;
}
static JSObjectRef
@@ -371,14 +371,14 @@ seed_gi_importer_do_namespace (JSContextRef ctx,
gchar *version;
gchar *jsextension;
JSStringRef extension_script;
-
+
if ((namespace_ref = g_hash_table_lookup (gi_imports, namespace)))
{
SEED_NOTE (IMPORTER, "Using existing namespace ref (%p) for %s",
namespace_ref, namespace);
return namespace_ref;
}
-
+
version = seed_gi_importer_get_version (ctx, namespace, exception);
if (!g_irepository_require (NULL, namespace,
version, 0, &e))
@@ -388,22 +388,22 @@ seed_gi_importer_do_namespace (JSContextRef ctx,
return NULL;
}
g_free (version);
-
+
n = g_irepository_get_n_infos (NULL, namespace);
-
+
namespace_ref = JSObjectMake (ctx, NULL, NULL);
SEED_NOTE (IMPORTER, "Constructing namespace ref (%p) for %s",
namespace_ref, namespace);
JSValueProtect (ctx, namespace_ref);
-
+
for (i = 0; i < n; i++)
{
GIInfoType info_type;
info = g_irepository_get_info (NULL, namespace, i);
info_type = g_base_info_get_type (info);
-
+
switch (info_type)
{
case GI_INFO_TYPE_FUNCTION:
@@ -427,15 +427,15 @@ seed_gi_importer_do_namespace (JSContextRef ctx,
break;
case GI_INFO_TYPE_CONSTANT:
seed_gi_importer_handle_constant (ctx, namespace_ref, (GIConstantInfo *) info, exception);
- break;
+ break;
default:
break;
}
g_base_info_unref (info);
}
-
+
g_hash_table_insert (gi_imports, g_strdup(namespace), namespace_ref);
-
+
jsextension = g_strdup_printf ("imports.extensions.%s",
namespace);
extension_script = JSStringCreateWithUTF8CString (jsextension);
@@ -443,27 +443,27 @@ seed_gi_importer_do_namespace (JSContextRef ctx,
JSStringRelease (extension_script);
g_free (jsextension);
-
+
return namespace_ref;
-
-}
+
+}
static JSValueRef
seed_gi_importer_get_property (JSContextRef ctx,
JSObjectRef object,
- JSStringRef property_name,
+ JSStringRef property_name,
JSValueRef *exception)
{
JSObjectRef ret;
guint len;
gchar *prop;
-
+
len = JSStringGetMaximumUTF8CStringSize (property_name);
prop = g_alloca (len * sizeof (gchar));
JSStringGetUTF8CString (property_name, prop, len);
-
+
SEED_NOTE (IMPORTER, "seed_gi_importer_get_property with %s", prop);
-
+
if (!strcmp(prop, "versions"))
return gi_importer_versions;
// Nasty hack
@@ -477,20 +477,20 @@ seed_gi_importer_get_property (JSContextRef ctx,
SEED_NOTE (IMPORTER, "Result (%p) from attempting to import %s: %s",
ret, prop, seed_value_to_string (ctx, ret, exception));
- return ret;
+ return ret;
}
static void
seed_importer_free_search_path (GSList *path)
{
GSList *walk = path;
-
+
while (walk)
{
g_free (walk->data);
walk = walk->next;
}
-
+
g_slist_free (path);
}
@@ -502,28 +502,28 @@ seed_importer_get_search_path (JSContextRef ctx,
GSList *path = NULL;
JSValueRef search_path_ref, length_ref;
guint length, i;
-
+
search_path_ref = seed_object_get_property (ctx, importer, "searchPath");
if (!JSValueIsObject(ctx, search_path_ref))
{
seed_make_exception (ctx, exception, "ArgumentError", "Importer searchPath object is not an array");
return NULL;
}
-
+
length_ref = seed_object_get_property (ctx, (JSObjectRef) search_path_ref, "length");
length = seed_value_to_uint (ctx, length_ref, exception);
-
+
for (i = 0; i < length; i++)
{
JSValueRef entry_ref;
gchar *entry;
-
+
entry_ref = JSObjectGetPropertyAtIndex (ctx, (JSObjectRef) search_path_ref, i, exception);
entry = seed_value_to_string (ctx, entry_ref, exception);
-
+
path = g_slist_append (path, entry);
}
-
+
return path;
}
@@ -538,7 +538,7 @@ seed_importer_handle_native_module (JSContextRef ctx,
JSObjectRef module_obj;
SeedModuleInitCallback init;
gchar *file_path = g_strconcat (dir, "/", file, NULL);
-
+
SEED_NOTE (IMPORTER, "Trying native module: %s", file_path);
if ((module_obj = g_hash_table_lookup (file_imports, file_path)))
@@ -546,9 +546,9 @@ seed_importer_handle_native_module (JSContextRef ctx,
g_free (file_path);
return module_obj;
}
-
+
module = g_module_open (file_path, 0);
-
+
if (!module)
{
// Could be a better exception
@@ -557,16 +557,16 @@ seed_importer_handle_native_module (JSContextRef ctx,
file_path,
g_module_error());
g_free (file_path);
-
+
return NULL;
}
g_module_symbol (module, "seed_module_init", (gpointer *) &init);
module_obj = (*init) (eng);
g_hash_table_insert (file_imports, file_path, module_obj);
SEED_NOTE (IMPORTER, "Loaded native module");
-
+
g_free (file_path);
-
+
return module_obj;
}
@@ -575,11 +575,11 @@ seed_importer_canonicalize_path (gchar *path)
{
GFile *file;
gchar *absolute_path;
-
+
file = g_file_new_for_path (path);
absolute_path = g_file_get_path (file);
g_object_unref (file);
-
+
return absolute_path;
}
@@ -593,11 +593,11 @@ seed_importer_handle_file (JSContextRef ctx,
JSObjectRef global, c_global;
JSStringRef file_contents, file_name;
gchar *contents, *walk, *file_path, *canonical;
-
+
file_path = g_strconcat (dir, "/", file, NULL);
canonical = seed_importer_canonicalize_path (file_path);
SEED_NOTE (IMPORTER, "Trying to import file: %s", file_path);
-
+
if ((global = g_hash_table_lookup (file_imports, canonical)))
{
SEED_NOTE (IMPORTER, "Using existing global");
@@ -616,7 +616,7 @@ seed_importer_handle_file (JSContextRef ctx,
}
return NULL;
}
-
+
g_file_get_contents (file_path, &contents, 0, NULL);
walk = contents;
if (*walk == '#')
@@ -630,29 +630,29 @@ seed_importer_handle_file (JSContextRef ctx,
file_contents = JSStringCreateWithUTF8CString (walk);
file_name = JSStringCreateWithUTF8CString (file);
-
+
nctx = JSGlobalContextCreateInGroup (context_group, 0);
seed_prepare_global_context (nctx);
-
+
global = JSContextGetGlobalObject (nctx);
c_global = JSContextGetGlobalObject (ctx);
JSValueProtect (eng->context, global);
-
+
g_hash_table_insert (file_imports, canonical, global);
g_free (file_path);
JSEvaluateScript (nctx, file_contents, NULL, file_name, 0, exception);
// Does leak...but it's a debug statement.
- SEED_NOTE (IMPORTER, "Evaluated file, exception: %s",
+ SEED_NOTE (IMPORTER, "Evaluated file, exception: %s",
*exception ? seed_exception_to_string (ctx, *exception) : "(null)");
-
+
JSGlobalContextRelease ((JSGlobalContextRef) nctx);
-
+
JSStringRelease (file_contents);
JSStringRelease (file_name);
g_free (walk);
-
+
return global;
}
@@ -663,9 +663,9 @@ seed_importer_search (JSContextRef ctx,
{
GSList *path, *walk;
gchar *prop_as_lib = g_strconcat ("lib", prop, ".", G_MODULE_SUFFIX, NULL);
-
+
path = seed_importer_get_search_path (ctx, exception);
-
+
walk = path;
while (walk)
{
@@ -677,7 +677,7 @@ seed_importer_search (JSContextRef ctx,
if (e)
{
g_error_free (e);
-
+
walk = walk->next;
continue;
}
@@ -694,7 +694,7 @@ seed_importer_search (JSContextRef ctx,
if (!strcmp (mentry, prop))
{
JSObjectRef ret;
-
+
ret = seed_importer_handle_file (ctx, walk->data, entry, exception);
g_dir_close (dir);
@@ -707,7 +707,7 @@ seed_importer_search (JSContextRef ctx,
else if (!strcmp(entry, prop_as_lib))
{
JSObjectRef ret;
-
+
ret = seed_importer_handle_native_module (ctx, walk->data, entry, exception);
g_dir_close (dir);
g_free (mentry);
@@ -716,14 +716,14 @@ seed_importer_search (JSContextRef ctx,
return ret;
}
-
+
g_free (mentry);
}
g_dir_close (dir);
-
+
walk = walk->next;
}
-
+
seed_importer_free_search_path (path);
g_free (prop_as_lib);
return NULL;
@@ -732,33 +732,33 @@ seed_importer_search (JSContextRef ctx,
static JSValueRef
seed_importer_get_property (JSContextRef ctx,
JSObjectRef object,
- JSStringRef property_name,
+ JSStringRef property_name,
JSValueRef *exception)
{
JSValueRef ret;
guint len;
gchar *prop;
-
+
len = JSStringGetMaximumUTF8CStringSize (property_name);
prop = g_alloca (len * sizeof (gchar));
JSStringGetUTF8CString (property_name, prop, len);
-
+
if (!strcmp (prop, "gi"))
return gi_importer;
if (!strcmp (prop, "searchPath"))
return NULL;
if (!strcmp (prop, "toString")) // HACK
return NULL;
-
+
ret = seed_importer_search (ctx, prop, exception);
-
+
return ret;
}
static JSValueRef
seed_importer_dir_get_property (JSContextRef ctx,
JSObjectRef object,
- JSStringRef property_name,
+ JSStringRef property_name,
JSValueRef *exception)
{
GError *e = NULL;
@@ -767,27 +767,27 @@ seed_importer_dir_get_property (JSContextRef ctx,
const gchar *entry;
gchar *dir_path, *prop;
-
+
dir_path = JSObjectGetPrivate (object);
-
+
len = JSStringGetMaximumUTF8CStringSize (property_name);
prop = g_alloca (len * sizeof (gchar));
JSStringGetUTF8CString (property_name, prop, len);
-
+
// TODO: GError
dir = g_dir_open (dir_path, 0, &e);
if (e)
{
seed_make_exception_from_gerror (ctx, exception, e);
g_error_free (e);
-
+
return NULL;
}
while ((entry = g_dir_read_name (dir)))
{
gchar *mentry = g_strdup (entry);
guint i;
-
+
for (i = 0; i < strlen (mentry); i++)
{
if (mentry[i] == '.')
@@ -797,17 +797,17 @@ seed_importer_dir_get_property (JSContextRef ctx,
if (!strcmp (mentry, prop))
{
JSObjectRef ret;
-
+
ret = seed_importer_handle_file (ctx, dir_path, entry, exception);
g_dir_close (dir);
g_free (mentry);
-
+
return ret;
}
g_free (mentry);
}
g_dir_close (dir);
-
+
return NULL;
}
@@ -837,7 +837,7 @@ seed_importer_dir_enumerate_properties (JSContextRef ctx,
GError *e = NULL;
gchar *path = JSObjectGetPrivate (object);
-
+
dir = g_dir_open (path, 0, &e);
if (e)
{
@@ -846,11 +846,11 @@ seed_importer_dir_enumerate_properties (JSContextRef ctx,
// Not much we can do here.
return;
}
-
+
while ((entry = g_dir_read_name (dir)))
{
JSStringRef jname;
-
+
jname = JSStringCreateWithUTF8CString (entry);
JSPropertyNameAccumulatorAddName (propertyNames, jname);
JSStringRelease (jname);
@@ -873,7 +873,7 @@ seed_importer_construct_dir (JSContextRef ctx,
return (JSObjectRef)JSValueMakeUndefined (ctx);
}
path = seed_value_to_string (ctx, arguments[0], exception);
-
+
if (!g_file_test (path, G_FILE_TEST_IS_DIR))
{
seed_make_exception (ctx, exception, "ArgumentError",
@@ -881,29 +881,29 @@ seed_importer_construct_dir (JSContextRef ctx,
g_free (path);
return (JSObjectRef)JSValueMakeUndefined (ctx);
}
-
+
return JSObjectMake (ctx, importer_dir_class, path);
}
-void
+void
seed_importer_set_search_path(JSContextRef ctx,
gchar **search_path)
{
JSObjectRef imports, array;
JSValueRef *array_elem;
guint length = g_strv_length (search_path), i;
-
+
array_elem = g_alloca (length * sizeof (array_elem));
imports = (JSObjectRef) seed_object_get_property (ctx, JSContextGetGlobalObject (ctx), "imports");
-
+
for (i = 0; i < length; i++)
{
array_elem[i] = seed_value_from_string (ctx, search_path[i], NULL);
}
-
+
array = JSObjectMakeArray (ctx, length, array_elem, NULL);
- seed_object_set_property (ctx, imports, "searchPath", array);
-
+ seed_object_set_property (ctx, imports, "searchPath", array);
+
}
JSClassDefinition importer_class_def = {
@@ -973,23 +973,23 @@ void seed_initialize_importer(JSContextRef ctx,
importer_class = JSClassCreate (&importer_class_def);
importer = JSObjectMake (ctx, importer_class, NULL);
-
+
gi_importer_class = JSClassCreate (&gi_importer_class_def);
gi_importer = JSObjectMake (ctx, gi_importer_class, NULL);
gi_importer_versions = JSObjectMake (ctx, NULL, NULL);
-
+
JSValueProtect (ctx, gi_importer);
JSValueProtect (ctx, gi_importer_versions);
-
+
importer_dir_class = JSClassCreate (&importer_dir_class_def);
-
+
gi_imports = g_hash_table_new (g_str_hash, g_str_equal);
file_imports = g_hash_table_new (g_str_hash, g_str_equal);
-
+
/* Passing nonnull for class requires a webkit fix that most people wont have yet. It also has minimal benefit */
// dir_constructor = JSObjectMakeConstructor (ctx, importer_dir_class, seed_importer_construct_dir);
dir_constructor = JSObjectMakeConstructor (ctx, NULL, seed_importer_construct_dir);
seed_object_set_property (ctx, importer, "Directory", dir_constructor);
-
+
seed_object_set_property (ctx, global, "imports", importer);
}
diff --git a/libseed/seed-private.h b/libseed/seed-private.h
index 2d163cb..e83b815 100644
--- a/libseed/seed-private.h
+++ b/libseed/seed-private.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed-signals.c b/libseed/seed-signals.c
index 8d43bda..749f3ad 100644
--- a/libseed/seed-signals.c
+++ b/libseed/seed-signals.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -42,7 +42,7 @@ seed_gobject_signal_connect (JSContextRef ctx,
const gchar * signal_name,
GObject * on_obj,
JSObjectRef func,
- JSObjectRef this_obj,
+ JSObjectRef this_obj,
JSObjectRef user_data)
{
GSignalQuery query;
@@ -52,7 +52,7 @@ seed_gobject_signal_connect (JSContextRef ctx,
&query);
#ifdef SEED_ENABLE_DEBUG
{
- guint function_arity =
+ guint function_arity =
seed_value_to_uint (ctx,
seed_object_get_property(ctx, func, "length"),
NULL);
@@ -87,7 +87,7 @@ seed_gobject_signal_connect_by_name (JSContextRef ctx,
if (argumentCount < 2 || argumentCount > 3)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Signal connection expected"
" 2 or 3 arguments. Got " "%zd",
argumentCount);
@@ -95,8 +95,8 @@ seed_gobject_signal_connect_by_name (JSContextRef ctx,
return JSValueMakeNull (ctx);
}
- if (JSValueIsNull (ctx, arguments[1]) ||
- !JSValueIsObject (ctx, arguments[1]) ||
+ if (JSValueIsNull (ctx, arguments[1]) ||
+ !JSValueIsObject (ctx, arguments[1]) ||
!JSObjectIsFunction (ctx, (JSObjectRef) arguments[1]))
{
seed_make_exception (ctx, exception, "ArgumentError",
@@ -223,12 +223,12 @@ seed_gobject_signal_emit (JSContextRef ctx,
signal_id = g_signal_lookup (privates->signal_name,
G_OBJECT_TYPE (privates->object));
-
+
g_signal_query (signal_id, &query);
if (argumentCount != query.n_params)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Signal: %s for type %s expected %u "
"arguments, got %zd",
query.signal_name,
@@ -283,7 +283,7 @@ seed_gobject_signal_disconnect (JSContextRef ctx,
}
id = seed_value_to_ulong (ctx, arguments[0], exception);
g_signal_handler_disconnect (JSObjectGetPrivate (thisObject), id);
-
+
return JSValueMakeUndefined(ctx);
}
@@ -316,9 +316,9 @@ seed_gobject_signal_connect_on_property (JSContextRef ctx,
return JSValueMakeNull (ctx);
}
-
- if (JSValueIsNull (ctx, arguments[0]) ||
- !JSValueIsObject (ctx, arguments[0]) ||
+
+ if (JSValueIsNull (ctx, arguments[0]) ||
+ !JSValueIsObject (ctx, arguments[0]) ||
!JSObjectIsFunction (ctx, (JSObjectRef) arguments[0]))
{
seed_make_exception (ctx, exception, "ArgumentError",
@@ -343,7 +343,7 @@ seed_gobject_signal_connect_on_property (JSContextRef ctx,
return seed_value_from_ulong (ctx, id, exception);
}
-JSStaticFunction signal_static_functions[] = {
+JSStaticFunction signal_static_functions[] = {
{"connect", seed_gobject_signal_connect_on_property, 0},
{"emit", seed_gobject_signal_emit, 0},
{0, 0, 0}
@@ -388,26 +388,26 @@ seed_signal_holder_get_property (JSContextRef ctx,
JSObjectRef signal_ref;
JSStringGetUTF8CString (property_name, signal_name, length);
-
+
if (!strcmp (signal_name, "connect") || !strcmp (signal_name, "disconnect"))
{
g_free (signal_name);
return NULL;
}
-
+
if (!g_signal_lookup (signal_name, G_OBJECT_TYPE (gobj)))
{
g_free (signal_name);
return NULL;
}
-
+
priv = g_slice_alloc (sizeof (signal_privates));
priv->object = gobj;
priv->signal_name = signal_name;
-
+
signal_ref = JSObjectMake (ctx, gobject_signal_class, priv);
-
+
return signal_ref;
}
diff --git a/libseed/seed-signals.h b/libseed/seed-signals.h
index ad1135a..ed41d6b 100644
--- a/libseed/seed-signals.h
+++ b/libseed/seed-signals.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -38,7 +38,7 @@ gulong seed_gobject_signal_connect (JSContextRef ctx,
const gchar * signal_name,
GObject * on_obj,
JSObjectRef func,
- JSObjectRef this_obj,
+ JSObjectRef this_obj,
JSObjectRef user_data);
diff --git a/libseed/seed-structs.c b/libseed/seed-structs.c
index c70c537..363c90f 100644
--- a/libseed/seed-structs.c
+++ b/libseed/seed-structs.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
*Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -726,7 +726,7 @@ seed_construct_struct_type_with_parameters (JSContextRef ctx,
field = seed_union_find_field ((GIUnionInfo *) info, prop_name);
if (!field)
{
- seed_make_exception (ctx, exception, "PropertyError",
+ seed_make_exception (ctx, exception, "PropertyError",
"Invalid property for construction: %s",
prop_name);
diff --git a/libseed/seed-structs.h b/libseed/seed-structs.h
index 9cf25e8..43ad797 100644
--- a/libseed/seed-structs.h
+++ b/libseed/seed-structs.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed-types.c b/libseed/seed-types.c
index f8c5ff1..33dd38b 100644
--- a/libseed/seed-types.c
+++ b/libseed/seed-types.c
@@ -1,16 +1,16 @@
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -65,19 +65,19 @@ seed_make_wrapper_for_type (JSContextRef ctx, GType type)
JSClassRef class;
JSObjectRef ret;
JSValueRef prototype;
-
+
class = seed_gobject_get_class_for_gtype (ctx, type);
-
+
while (!class && (type = g_type_parent (type)))
class = seed_gobject_get_class_for_gtype (ctx, type);
-
+
prototype = seed_gobject_get_prototype_for_gtype (type);
ret = JSObjectMake (ctx, class, NULL);
if (prototype)
JSObjectSetPrototype (ctx, ret, prototype);
else
g_assert_not_reached();
-
+
return ret;
}
@@ -107,9 +107,9 @@ seed_wrap_object (JSContextRef ctx, GObject * object)
JSValueProtect (eng->context, js_ref);
g_object_add_toggle_ref (object, seed_toggle_ref, (gpointer) js_ref);
-
+
seed_add_signals_to_object (ctx, js_ref, object);
-
+
seed_next_gobject_wrapper = NULL;
return js_ref;
@@ -220,7 +220,7 @@ seed_gi_release_arg (GITransfer transfer,
gboolean
seed_gi_release_in_arg (GITransfer transfer,
- GITypeInfo * type_info,
+ GITypeInfo * type_info,
GArgument * arg)
{
GITypeTag type_tag;
@@ -356,9 +356,9 @@ seed_gi_make_array (JSContextRef ctx,
{
gdouble *result;
guint i;
-
+
result = g_new0 (gdouble, length + 1);
-
+
for (i = 0; i < length; i++)
{
JSValueRef elem = JSObjectGetPropertyAtIndex (ctx,
@@ -367,7 +367,7 @@ seed_gi_make_array (JSContextRef ctx,
exception);
result[i] = seed_value_to_double (ctx, elem, exception);
}
-
+
*array_p = result;
}
break;
@@ -375,9 +375,9 @@ seed_gi_make_array (JSContextRef ctx,
{
gint *result;
guint i;
-
+
result = g_new0 (gint, length + 1);
-
+
for (i = 0; i < length; i++)
{
JSValueRef elem = JSObjectGetPropertyAtIndex (ctx,
@@ -386,7 +386,7 @@ seed_gi_make_array (JSContextRef ctx,
exception);
result[i] = seed_value_to_int (ctx, elem, exception);
}
-
+
*array_p = result;
}
break;
@@ -460,7 +460,7 @@ seed_gi_make_array (JSContextRef ctx,
gboolean
seed_gi_make_argument (JSContextRef ctx,
JSValueRef value,
- GITypeInfo * type_info,
+ GITypeInfo * type_info,
GIArgInfo *arg_info,
GArgument * arg,
JSValueRef * exception)
@@ -578,13 +578,13 @@ seed_gi_make_argument (JSContextRef ctx,
if (!(interface_type == GI_INFO_TYPE_FLAGS) && !seed_validate_enum ((GIEnumInfo *)interface, arg->v_long))
{
seed_make_exception (ctx, exception, "EnumRange",
- "Enum value: %ld is out of range",
+ "Enum value: %ld is out of range",
arg->v_long);
g_base_info_unref (interface);
-
+
return FALSE;
}
-
+
g_base_info_unref (interface);
break;
}
@@ -614,7 +614,7 @@ seed_gi_make_argument (JSContextRef ctx,
g_base_info_unref (interface);
break;
}
- // Automatically convert between functions and
+ // Automatically convert between functions and
// GClosures where expected.
else if (g_type_is_a (type, G_TYPE_CLOSURE))
{
@@ -645,7 +645,7 @@ seed_gi_make_argument (JSContextRef ctx,
g_base_info_unref (interface);
break;
}
- // Someone passes in a wrapper around a method where a
+ // Someone passes in a wrapper around a method where a
// callback is expected, i.e Clutter.sine_inc_func, as an alpha
// Have to dlsym the symbol to be able to do this.
// NOTE: Some cases where dlsym(NULL, symbol) doesn't work depending
@@ -685,8 +685,8 @@ seed_gi_make_argument (JSContextRef ctx,
g_base_info_unref (interface);
break;
}
- // Automagically create closure around function passed in as
- // callback.
+ // Automagically create closure around function passed in as
+ // callback.
else if (JSObjectIsFunction (ctx, (JSObjectRef) value))
{
SeedNativeClosure *privates = seed_make_native_closure (ctx,
@@ -1092,7 +1092,7 @@ seed_gvalue_from_seed_value (JSContextRef ctx,
if (type == 0 && JSValueIsObject (ctx, val))
{
// TODO: FIXME: Better array test like the cool one on reddit.
- guint length =
+ guint length =
seed_value_to_int (ctx,
seed_object_get_property (ctx,
(JSObjectRef) val,
@@ -1101,7 +1101,7 @@ seed_gvalue_from_seed_value (JSContextRef ctx,
if (length)
{
- type =
+ type =
seed_value_to_int (ctx,
JSObjectGetPropertyAtIndex (ctx,
(JSObjectRef)
@@ -1864,9 +1864,9 @@ seed_value_from_binary_string (JSContextRef ctx,
gchar *nstr = g_alloca ((n_bytes +1)*sizeof(gchar));
strncpy (nstr, bytes, n_bytes);
nstr[n_bytes] = '\0';
-
+
ret = seed_value_from_string (ctx, nstr, exception);
-
+
return ret;
}
@@ -1922,11 +1922,11 @@ seed_value_to_object (JSContextRef ctx,
{
GObject *gobject;
- /*
- * Worth investigating if this is the best way to handle null. Some of
- * the existing code depends on null Objects not throwing an exception
- * however, needs testing at higher level if value can be null
- * (through GI)
+ /*
+ * Worth investigating if this is the best way to handle null. Some of
+ * the existing code depends on null Objects not throwing an exception
+ * however, needs testing at higher level if value can be null
+ * (through GI)
*/
if (JSValueIsNull (ctx, val))
@@ -1960,7 +1960,7 @@ seed_validate_enum (GIEnumInfo *info,
long val)
{
gint n, i;
-
+
n = g_enum_info_get_n_values (info);
for (i = 0; i < n; i++)
{
@@ -1971,7 +1971,7 @@ seed_validate_enum (GIEnumInfo *info,
if (value == val)
return TRUE;
}
-
+
return FALSE;
}
@@ -1981,7 +1981,7 @@ seed_value_from_time_t (JSContextRef ctx,
JSValueRef *exception)
{
JSValueRef args[1];
-
+
args[0] = seed_value_from_double (ctx, ((gdouble)time)*1000, exception);
return JSObjectMakeDate(ctx, 1, args, exception);
}
@@ -2000,7 +2000,7 @@ seed_value_to_time_t (JSContextRef ctx,
JSValueRef get_time_method;
JSValueRef jstime;
gdouble time;
-
+
get_time_method = seed_object_get_property (ctx, (JSObjectRef)value,
"getTime");
if (JSValueIsNull(ctx, get_time_method) ||
@@ -2008,7 +2008,7 @@ seed_value_to_time_t (JSContextRef ctx,
{
goto out;
}
- jstime = JSObjectCallAsFunction (ctx,
+ jstime = JSObjectCallAsFunction (ctx,
(JSObjectRef)get_time_method,
(JSObjectRef)value,
0, NULL,
diff --git a/libseed/seed-types.h b/libseed/seed-types.h
index 91b3d8e..835b005 100644
--- a/libseed/seed-types.h
+++ b/libseed/seed-types.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
diff --git a/libseed/seed.h b/libseed/seed.h
index bacb37e..80ac694 100644
--- a/libseed/seed.h
+++ b/libseed/seed.h
@@ -1,21 +1,21 @@
/*
- * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
+ * -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
*/
/*
* This file is part of Seed, the GObject Introspection<->Javascript bindings.
*
- * Seed is free software: you can redistribute it and/or modify
+ * Seed is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- * Seed is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with Seed. If not, see <http://www.gnu.org/licenses/>.
- *
+ * the License, or (at your option) any later version.
+ * Seed is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Seed. If not, see <http://www.gnu.org/licenses/>.
+ *
* Copyright (C) Robert Carr 2008 <carrr rpi edu>
*/
@@ -72,18 +72,18 @@ typedef struct _SeedEngine
} SeedEngine;
/*
- * seed-engine.c
+ * seed-engine.c
*/
SeedEngine *seed_init (gint *argc, gchar ***argv);
SeedEngine *seed_init_with_context_group (gint *argc, gchar ***argv,
SeedContextGroup group);
-SeedValue seed_simple_evaluate (SeedContext ctx,
- gchar * source,
+SeedValue seed_simple_evaluate (SeedContext ctx,
+ gchar * source,
SeedException *exception);
SeedScript *seed_make_script (SeedContext ctx,
- const gchar * js,
+ const gchar * js,
const gchar * source_url,
gint line_number);
SeedScript *seed_script_new_from_file (SeedContext ctx, gchar * file);
@@ -141,7 +141,7 @@ SeedValue seed_object_call (SeedContext ctx,
void seed_value_unprotect (SeedContext ctx, SeedValue value);
void seed_value_protect (SeedContext ctx, SeedValue value);
/*
- * seed-types.c
+ * seed-types.c
*/
gboolean seed_object_set_property (SeedContext ctx,
SeedObject object,
@@ -256,7 +256,7 @@ typedef SeedObject (*SeedModuleInitCallback) (SeedEngine * eng);
typedef void (*SeedObjectInitializeCallback) (SeedContext ctx,
SeedObject object);
-/* Using any functions that require a context from
+/* Using any functions that require a context from
*this callback has undefined results */
typedef void (*SeedObjectFinalizeCallback) (SeedObject object);
@@ -374,7 +374,7 @@ seed_signal_connect_value (SeedContext ctx,
GObject *object,
const gchar *signal,
SeedValue function,
- SeedValue user_data);
+ SeedValue user_data);
SeedObject seed_context_get_global_object (SeedContext ctx);
@@ -387,7 +387,7 @@ void seed_prepare_global_context (SeedContext ctx);
SeedType seed_value_get_type (SeedContext ctx, SeedValue type);
-gchar **seed_object_copy_property_names(SeedContext ctx, SeedObject object);
+gchar **seed_object_copy_property_names(SeedContext ctx, SeedObject object);
SeedValue
seed_value_from_binary_string (SeedContext ctx,
@@ -396,7 +396,7 @@ seed_value_from_binary_string (SeedContext ctx,
SeedException *exception);
GClosure *seed_closure_new (SeedContext ctx,
- SeedObject function,
+ SeedObject function,
SeedObject user_data,
const gchar *description);
diff --git a/modules/Multiprocessing/bi.js b/modules/Multiprocessing/bi.js
index cb3cc5b..949ec52 100755
--- a/modules/Multiprocessing/bi.js
+++ b/modules/Multiprocessing/bi.js
@@ -9,7 +9,7 @@ child_pid = Seed.fork();
if (child_pid == 0)
{
mine = pipes[0];
- mine.add_watch(1,
+ mine.add_watch(1,
function()
{
var message = {type: "PING",
diff --git a/modules/Multiprocessing/fork.js b/modules/Multiprocessing/fork.js
index 6af3f30..269e3c3 100755
--- a/modules/Multiprocessing/fork.js
+++ b/modules/Multiprocessing/fork.js
@@ -15,9 +15,9 @@ if (child_pid == 0)
w = new Gtk.Window();
l = new Gtk.Label();
w.add(l);
-
+
w.show_all();
- childs.add_watch(1,
+ childs.add_watch(1,
function(source, condition, label)
{
label.label = source.read();
diff --git a/modules/Multiprocessing/multi.c b/modules/Multiprocessing/multi.c
index 5585ee5..ad24366 100644
--- a/modules/Multiprocessing/multi.c
+++ b/modules/Multiprocessing/multi.c
@@ -182,6 +182,6 @@ seed_module_init(SeedEngine * local_eng)
seed_object_set_property(eng->context,
namespace_ref, "Pipe", pipe_constructor);
-
+
return namespace_ref;
}
diff --git a/modules/cairo/seed-cairo-enums.c b/modules/cairo/seed-cairo-enums.c
index 08f9619..869d02e 100644
--- a/modules/cairo/seed-cairo-enums.c
+++ b/modules/cairo/seed-cairo-enums.c
@@ -14,13 +14,13 @@ seed_cairo_status_to_string (SeedContext ctx,
SeedException *exception)
{
cairo_status_t status;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("status_to_string", "1 argument");
}
status = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_string (ctx, cairo_status_to_string (status), exception);
}
@@ -30,7 +30,7 @@ seed_define_cairo_enums (SeedContext ctx,
{
SeedObject content_holder, format_holder, antialias_holder, fillrule_holder,
linecap_holder, linejoin_holder, operator_holder, status_holder;
-
+
content_holder = seed_make_object (ctx, NULL, NULL);
seed_object_set_property (ctx, namespace_ref, "Content", content_holder);
ENUM_MEMBER(content_holder, "COLOR", CAIRO_CONTENT_COLOR);
@@ -85,7 +85,7 @@ seed_define_cairo_enums (SeedContext ctx,
ENUM_MEMBER(operator_holder, "XOR", CAIRO_OPERATOR_XOR);
ENUM_MEMBER(operator_holder, "ADD", CAIRO_OPERATOR_ADD);
ENUM_MEMBER(operator_holder, "SATURATE", CAIRO_OPERATOR_SATURATE);
-
+
status_holder = seed_make_object (ctx, NULL, NULL);
seed_object_set_property (ctx, namespace_ref, "Status", status_holder);
ENUM_MEMBER(status_holder, "SUCCESS", CAIRO_STATUS_SUCCESS);
@@ -120,6 +120,6 @@ seed_define_cairo_enums (SeedContext ctx,
ENUM_MEMBER(status_holder, "INVALID_CLUSTERS", CAIRO_STATUS_INVALID_CLUSTERS);
ENUM_MEMBER(status_holder, "INVALID_SLANT", CAIRO_STATUS_INVALID_SLANT);
ENUM_MEMBER(status_holder, "INVALID_WEIGHT", CAIRO_STATUS_INVALID_WEIGHT);
-
+
seed_create_function (ctx, "to_string", seed_cairo_status_to_string, status_holder);
}
diff --git a/modules/cairo/seed-cairo-image-surface.c b/modules/cairo/seed-cairo-image-surface.c
index 1f51cbb..7e49af6 100644
--- a/modules/cairo/seed-cairo-image-surface.c
+++ b/modules/cairo/seed-cairo-image-surface.c
@@ -27,11 +27,11 @@ static SeedObject
seed_object_from_cairo_image_surface (SeedContext ctx, cairo_surface_t *surf)
{
SeedObject jsobj;
-
+
jsobj = cairo_surface_get_user_data (surf, seed_get_cairo_key());
if (jsobj)
return jsobj;
-
+
jsobj = seed_make_object (ctx, seed_cairo_image_surface_class, surf);
cairo_surface_set_user_data (surf, seed_get_cairo_key(), jsobj, seed_cairo_destroy_func);
return jsobj;
@@ -91,12 +91,12 @@ seed_cairo_construct_image_surface (SeedContext ctx,
{
EXPECTED_EXCEPTION("ImageSurface", "3 arguments");
}
-
+
format = seed_value_to_long (ctx, arguments[0], exception);
width = seed_value_to_int (ctx, arguments[1], exception);
height = seed_value_to_int (ctx, arguments[2], exception);
ret = cairo_image_surface_create (format, width, height);
-
+
return seed_object_from_cairo_image_surface (ctx, ret);
}
@@ -107,9 +107,9 @@ seed_static_value image_surface_values[] = {
{"stride", seed_cairo_image_surface_get_stride, 0, SEED_PROPERTY_ATTRIBUTE_READ_ONLY | SEED_PROPERTY_ATTRIBUTE_DONT_DELETE},
{0, 0, 0, 0}
};
-
-
-
+
+
+
void
seed_define_cairo_image_surface (SeedContext ctx,
@@ -118,14 +118,14 @@ seed_define_cairo_image_surface (SeedContext ctx,
seed_class_definition image_def = seed_empty_class;
// TODO: FIX
seed_static_function webkit_fail = {0,0,0};
-
+
image_def.class_name = "ImageSurface";
image_def.static_values = image_surface_values;
image_def.parent_class = seed_get_cairo_surface_class ();
// FAIL
image_def.static_functions = &webkit_fail;
seed_cairo_image_surface_class = seed_create_class (&image_def);
-
+
image_surface_constructor_ref = seed_make_constructor (ctx,
NULL,
//seed_cairo_image_surface_class,
diff --git a/modules/cairo/seed-cairo-matrix.c b/modules/cairo/seed-cairo-matrix.c
index 1e9076d..6bc5d00 100644
--- a/modules/cairo/seed-cairo-matrix.c
+++ b/modules/cairo/seed-cairo-matrix.c
@@ -10,14 +10,14 @@ seed_value_from_cairo_matrix (SeedContext ctx,
SeedException *exception)
{
SeedValue elems[6];
-
+
elems[0] = seed_value_from_double(ctx, matrix->xx, exception);
elems[1] = seed_value_from_double(ctx, matrix->yx, exception);
elems[2] = seed_value_from_double(ctx, matrix->xy, exception);
elems[3] = seed_value_from_double(ctx, matrix->yy, exception);
elems[4] = seed_value_from_double(ctx, matrix->x0, exception);
elems[5] = seed_value_from_double(ctx, matrix->y0, exception);
-
+
return seed_make_array (ctx, elems, 6, exception);
}
@@ -29,14 +29,14 @@ seed_value_to_cairo_matrix (SeedContext ctx,
{
if (!seed_value_is_object (ctx, value))
return FALSE;
-
+
matrix->xx = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 0, exception), exception);
matrix->yx = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 1, exception), exception);
matrix->xy = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 2, exception), exception);
matrix->yy = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 3, exception), exception);
matrix->x0 = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 4, exception), exception);
matrix->y0 = seed_value_to_double (ctx, seed_object_get_property_at_index (ctx, (SeedObject) value, 5, exception), exception);
-
+
return TRUE;
}
@@ -50,7 +50,7 @@ seed_cairo_matrix_init_identity (SeedContext ctx,
SeedException *exception)
{
cairo_matrix_t m;
-
+
cairo_matrix_init_identity (&m);
return seed_value_from_cairo_matrix (ctx, &m, exception);
}
@@ -65,18 +65,18 @@ seed_cairo_matrix_init_translate (SeedContext ctx,
{
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("init_translate", "2 arguments");
}
-
+
x = seed_value_to_double (ctx, arguments[0], exception);
y = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_matrix_init_translate (&m, x, y);
-
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
static SeedValue
@@ -89,22 +89,22 @@ seed_cairo_matrix_translate (SeedContext ctx,
{
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 3)
{
EXPECTED_EXCEPTION("translate", "3 arguments");
}
-
+
if (!seed_value_to_cairo_matrix (ctx, arguments[0], &m, exception))
{
seed_make_exception (ctx, exception, "ArgumentError", "translate needs an array [xx, yx, xy, yy, x0, y0]");
}
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
-
+
cairo_matrix_translate (&m, x, y);
-
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
static SeedValue
@@ -117,18 +117,18 @@ seed_cairo_matrix_init_scale (SeedContext ctx,
{
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("init_scale", "2 arguments");
}
-
+
x = seed_value_to_double (ctx, arguments[0], exception);
y = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_matrix_init_scale (&m, x, y);
-
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
static SeedValue
@@ -141,22 +141,22 @@ seed_cairo_matrix_scale (SeedContext ctx,
{
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 3)
{
EXPECTED_EXCEPTION("scale", "3 arguments");
}
-
+
if (!seed_value_to_cairo_matrix (ctx, arguments[0], &m, exception))
{
seed_make_exception (ctx, exception, "ArgumentError", "scale needs an array [xx, yx, xy, yy, x0, y0]");
}
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
-
+
cairo_matrix_scale (&m, x, y);
-
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
static SeedValue
@@ -169,16 +169,16 @@ seed_cairo_matrix_init_rotate (SeedContext ctx,
{
gdouble angle;
cairo_matrix_t m;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("init_rotate", "1 arguments");
}
-
+
angle = seed_value_to_double (ctx, arguments[0], exception);
cairo_matrix_init_rotate (&m, angle);
-
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
static SeedValue
@@ -191,12 +191,12 @@ seed_cairo_matrix_rotate (SeedContext ctx,
{
gdouble angle;
cairo_matrix_t m;
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("rotate", "2 arguments");
}
-
+
if (!seed_value_to_cairo_matrix (ctx, arguments[0], &m, exception))
{
seed_make_exception (ctx, exception, "ArgumentError", "rotate needs an array [xx, yx, xy, yy, x0, y0]");
@@ -205,7 +205,7 @@ seed_cairo_matrix_rotate (SeedContext ctx,
cairo_matrix_rotate (&m, angle);
- return seed_value_from_cairo_matrix (ctx, &m, exception);
+ return seed_value_from_cairo_matrix (ctx, &m, exception);
}
@@ -220,24 +220,24 @@ seed_cairo_matrix_transform_distance (SeedContext ctx,
SeedValue ret[2];
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 3)
{
EXPECTED_EXCEPTION("transform_distance", "3 arguments");
}
-
+
if (!seed_value_to_cairo_matrix (ctx, arguments[0], &m, exception))
{
seed_make_exception (ctx, exception, "ArgumentError", "transform_distance needs an array [xx, yx, xy, yy, x0, y0]");
}
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
-
+
cairo_matrix_transform_distance (&m, &x, &y);
-
+
ret[0] = seed_value_from_double (ctx, x, exception);
ret[1] = seed_value_from_double (ctx, y, exception);
-
+
return seed_make_array (ctx, ret, 2, exception);
}
@@ -252,24 +252,24 @@ seed_cairo_matrix_transform_point (SeedContext ctx,
SeedValue ret[2];
gdouble x, y;
cairo_matrix_t m;
-
+
if (argument_count != 3)
{
EXPECTED_EXCEPTION("transform_point", "3 arguments");
}
-
+
if (!seed_value_to_cairo_matrix (ctx, arguments[0], &m, exception))
{
seed_make_exception (ctx, exception, "ArgumentError", "transform_point needs an array [xx, yx, xy, yy, x0, y0]");
}
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
-
+
cairo_matrix_transform_point (&m, &x, &y);
-
+
ret[0] = seed_value_from_double (ctx, x, exception);
ret[1] = seed_value_from_double (ctx, y, exception);
-
+
return seed_make_array (ctx, ret, 2, exception);
}
@@ -291,10 +291,10 @@ seed_define_cairo_matrix (SeedContext ctx,
SeedObject namespace_ref)
{
seed_class_definition matrix_def = seed_empty_class;
-
+
matrix_def.class_name = "Matrix";
matrix_def.static_functions = matrix_funcs;
seed_matrix_class = seed_create_class (&matrix_def);
-
+
seed_object_set_property (ctx, namespace_ref, "Matrix", seed_make_object (ctx, seed_matrix_class, NULL));
}
diff --git a/modules/cairo/seed-cairo-matrix.h b/modules/cairo/seed-cairo-matrix.h
index ffcf7f7..4fa23d3 100644
--- a/modules/cairo/seed-cairo-matrix.h
+++ b/modules/cairo/seed-cairo-matrix.h
@@ -5,10 +5,10 @@
void seed_define_cairo_matrix (SeedContext ctx, SeedObject namespace_ref);
-gboolean seed_value_to_cairo_matrix (SeedContext ctx, SeedValue value,
+gboolean seed_value_to_cairo_matrix (SeedContext ctx, SeedValue value,
cairo_matrix_t *matrix, SeedException *exception);
-SeedValue seed_value_from_cairo_matrix (SeedContext ctx, const cairo_matrix_t *matrix,
+SeedValue seed_value_from_cairo_matrix (SeedContext ctx, const cairo_matrix_t *matrix,
SeedException *exception);
#endif
diff --git a/modules/cairo/seed-cairo-pattern.c b/modules/cairo/seed-cairo-pattern.c
index fa6c991..5049b81 100644
--- a/modules/cairo/seed-cairo-pattern.c
+++ b/modules/cairo/seed-cairo-pattern.c
@@ -20,10 +20,10 @@
return seed_make_undefined (ctx);}
#define CHECK_THIS_BOOL(res) if (!seed_object_get_private (this_object)){ \
- seed_make_exception (ctx, exception, "ArgumentError", "Cairo pattern has been destroyed"); return FALSE;}
+ seed_make_exception (ctx, exception, "ArgumentError", "Cairo pattern has been destroyed"); return FALSE;}
+
-
SeedClass seed_cairo_pattern_class;
@@ -57,11 +57,11 @@ SeedObject
seed_object_from_cairo_pattern (SeedContext ctx, cairo_pattern_t *pat)
{
SeedObject jsobj;
-
+
jsobj = cairo_pattern_get_user_data (pat, seed_get_cairo_key());
if (jsobj)
return jsobj;
-
+
jsobj = seed_make_object (ctx, seed_cairo_pattern_class, pat);
cairo_pattern_set_user_data (pat, seed_get_cairo_key(), jsobj, seed_cairo_destroy_func);
return jsobj;
@@ -80,12 +80,12 @@ seed_cairo_construct_linear_gradient (SeedContext ctx,
{
EXPECTED_EXCEPTION("LinearGradient constructor", "4 arguments");
}
-
+
x0 = seed_value_to_double (ctx, arguments[0], exception);
y0 = seed_value_to_double (ctx, arguments[1], exception);
x1 = seed_value_to_double (ctx, arguments[2], exception);
y1 = seed_value_to_double (ctx, arguments[3], exception);
-
+
return seed_object_from_cairo_pattern (ctx, cairo_pattern_create_linear (x0, y0, x1, y1));
}
@@ -102,7 +102,7 @@ seed_cairo_construct_radial_gradient (SeedContext ctx,
{
EXPECTED_EXCEPTION("RadialGradient constructor", "6 arguments");
}
-
+
cx0 = seed_value_to_double (ctx, arguments[0], exception);
cy0 = seed_value_to_double (ctx, arguments[1], exception);
r0 = seed_value_to_double (ctx, arguments[2], exception);
@@ -110,7 +110,7 @@ seed_cairo_construct_radial_gradient (SeedContext ctx,
cy1 = seed_value_to_double (ctx, arguments[4], exception);
r1 = seed_value_to_double (ctx, arguments[5], exception);
-
+
return seed_object_from_cairo_pattern (ctx, cairo_pattern_create_radial (cx0, cy0, r0, cx1, cy1, r1));
}
@@ -129,15 +129,15 @@ seed_cairo_pattern_add_color_stop_rgb (SeedContext ctx,
{
EXPECTED_EXCEPTION("add_color_stop_rgb", "4 arguments");
}
-
+
pat = seed_object_get_private (this_object);
offset = seed_value_to_double (ctx, arguments[0], exception);
r = seed_value_to_double (ctx, arguments[1], exception);
g = seed_value_to_double (ctx, arguments[2], exception);
b = seed_value_to_double (ctx, arguments[3], exception);
-
+
cairo_pattern_add_color_stop_rgb (pat, offset, r, g, b);
-
+
return seed_make_undefined (ctx);
}
@@ -156,16 +156,16 @@ seed_cairo_pattern_add_color_stop_rgba (SeedContext ctx,
{
EXPECTED_EXCEPTION("add_color_stop_rgba", "5 arguments");
}
-
+
pat = seed_object_get_private (this_object);
offset = seed_value_to_double (ctx, arguments[0], exception);
r = seed_value_to_double (ctx, arguments[1], exception);
g = seed_value_to_double (ctx, arguments[2], exception);
b = seed_value_to_double (ctx, arguments[3], exception);
a = seed_value_to_double (ctx, arguments[4], exception);
-
+
cairo_pattern_add_color_stop_rgba (pat, offset, r, g, b, a);
-
+
return seed_make_undefined (ctx);
}
@@ -181,13 +181,13 @@ seed_define_cairo_pattern (SeedContext ctx,
{
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);
diff --git a/modules/cairo/seed-cairo-pdf-surface.c b/modules/cairo/seed-cairo-pdf-surface.c
index 15c49e3..bb0bb7d 100644
--- a/modules/cairo/seed-cairo-pdf-surface.c
+++ b/modules/cairo/seed-cairo-pdf-surface.c
@@ -28,11 +28,11 @@ static SeedObject
seed_object_from_cairo_pdf_surface (SeedContext ctx, cairo_surface_t *surf)
{
SeedObject jsobj;
-
+
jsobj = cairo_surface_get_user_data (surf, seed_get_cairo_key());
if (jsobj)
return jsobj;
-
+
jsobj = seed_make_object (ctx, seed_cairo_pdf_surface_class, surf);
cairo_surface_set_user_data (surf, seed_get_cairo_key(), jsobj, seed_cairo_destroy_func);
return jsobj;
@@ -48,7 +48,7 @@ seed_cairo_pdf_surface_set_size (SeedContext ctx,
{
cairo_surface_t *surf;
gdouble x, y;
-
+
CHECK_THIS();
if (argument_count != 2)
{
@@ -57,9 +57,9 @@ seed_cairo_pdf_surface_set_size (SeedContext ctx,
surf = seed_object_get_private (this_object);
x = seed_value_to_double (ctx, arguments[0], exception);
y = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_pdf_surface_set_size (surf, x, y);
-
+
return seed_make_undefined (ctx);
}
@@ -78,13 +78,13 @@ seed_cairo_construct_pdf_surface (SeedContext ctx,
{
EXPECTED_EXCEPTION("PDFSurface", "3 arguments");
}
-
+
if (!seed_value_is_null (ctx, arguments[0]))
filename = seed_value_to_string (ctx, arguments[0], exception);
width = seed_value_to_double (ctx, arguments[1], exception);
height = seed_value_to_double (ctx, arguments[2], exception);
ret = cairo_pdf_surface_create (filename, width, height);
-
+
return seed_object_from_cairo_pdf_surface (ctx, ret);
}
@@ -96,22 +96,22 @@ seed_static_function pdf_surface_funcs[] = {
{"set_size", seed_cairo_pdf_surface_set_size, 0},
{0, 0, 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,
diff --git a/modules/cairo/seed-cairo-surface.c b/modules/cairo/seed-cairo-surface.c
index cfafab1..6a852c9 100644
--- a/modules/cairo/seed-cairo-surface.c
+++ b/modules/cairo/seed-cairo-surface.c
@@ -21,10 +21,10 @@
return seed_make_undefined (ctx);}
#define CHECK_THIS_BOOL(res) if (!seed_object_get_private (this_object)){ \
- seed_make_exception (ctx, exception, "ArgumentError", "Cairo surface has been destroyed"); return FALSE;}
+ seed_make_exception (ctx, exception, "ArgumentError", "Cairo surface has been destroyed"); return FALSE;}
+
-
SeedClass seed_cairo_surface_class;
@@ -58,11 +58,11 @@ SeedObject
seed_object_from_cairo_surface (SeedContext ctx, cairo_surface_t *surf)
{
SeedObject jsobj;
-
+
jsobj = cairo_surface_get_user_data (surf, seed_get_cairo_key());
if (jsobj)
return jsobj;
-
+
jsobj = seed_make_object (ctx, seed_cairo_surface_class, surf);
cairo_surface_set_user_data (surf, seed_get_cairo_key(), jsobj, seed_cairo_destroy_func);
return jsobj;
@@ -84,14 +84,14 @@ seed_cairo_surface_create_similar (SeedContext ctx,
{
EXPECTED_EXCEPTION("create_similar", "3 arguments");
}
-
+
surface = seed_object_to_cairo_surface (ctx, this_object, exception);
if (!surface)
return seed_make_undefined (ctx);
content = seed_value_to_long (ctx, arguments[0], exception);
width = seed_value_to_int (ctx, arguments[1], exception);
height = seed_value_to_int (ctx, arguments[2], exception);
-
+
ret = cairo_surface_create_similar (surface, content, width, height);
return seed_object_from_cairo_surface (ctx, ret);
}
@@ -162,7 +162,7 @@ seed_cairo_surface_mark_dirty_rectangle(SeedContext ctx,
y = seed_value_to_int (ctx, arguments[1], exception);
width = seed_value_to_int (ctx, arguments[2], exception);
height = seed_value_to_int (ctx, arguments[3], exception);
-
+
cairo_surface_mark_dirty_rectangle (surf, x, y, width, height);
return seed_make_undefined (ctx);
@@ -192,20 +192,20 @@ seed_cairo_surface_set_device_offset(SeedContext ctx,
gdouble x, y;
SeedValue jsx, jsy;
CHECK_THIS_BOOL();
-
+
if (!seed_value_is_object (ctx, value))
{
seed_make_exception(ctx, exception, "ArgumentError", "Cairo.Surface.device_offset must be an array [x,y]");
return FALSE;
}
-
+
jsx = seed_object_get_property_at_index (ctx, (SeedObject) value, 0, exception);
- jsy = seed_object_get_property_at_index (ctx, (SeedObject) value, 1, exception);
+ jsy = seed_object_get_property_at_index (ctx, (SeedObject) value, 1, exception);
surf = seed_object_to_cairo_surface (ctx, this_object, exception);
x = seed_value_to_double (ctx, jsx, exception);
y = seed_value_to_double (ctx, jsy, exception);
-
+
cairo_surface_set_device_offset (surf, x, y);
return TRUE;
}
@@ -223,7 +223,7 @@ seed_cairo_surface_get_device_offset(SeedContext ctx,
surf = seed_object_to_cairo_surface (ctx, this_object, exception);
cairo_surface_get_device_offset (surf, &x, &y);
-
+
offsets[0] = seed_value_from_double (ctx, x, exception);
offsets[1] = seed_value_from_double (ctx, y, exception);
@@ -241,20 +241,20 @@ seed_cairo_surface_set_fallback_resolution(SeedContext ctx,
gdouble x, y;
SeedValue jsx, jsy;
CHECK_THIS_BOOL();
-
+
if (!seed_value_is_object (ctx, value))
{
seed_make_exception(ctx, exception, "ArgumentError", "Cairo.Surface.fallback_resolution must be an array [x,y]");
return FALSE;
}
-
+
jsx = seed_object_get_property_at_index (ctx, (SeedObject) value, 0, exception);
jsy = seed_object_get_property_at_index (ctx, (SeedObject) value, 1, exception);
surf = seed_object_to_cairo_surface (ctx, this_object, exception);
x = seed_value_to_double (ctx, jsx, exception);
y = seed_value_to_double (ctx, jsy, exception);
-
+
cairo_surface_set_fallback_resolution (surf, x, y);
return TRUE;
}
@@ -262,7 +262,7 @@ seed_cairo_surface_set_fallback_resolution(SeedContext ctx,
static SeedValue
seed_cairo_surface_get_fallback_resolution(SeedContext ctx,
SeedObject this_object,
- SeedString property_name,
+ SeedString property_name,
SeedException *exception)
{
SeedValue offsets[2];
@@ -272,7 +272,7 @@ seed_cairo_surface_get_fallback_resolution(SeedContext ctx,
surf = seed_object_to_cairo_surface (ctx, this_object, exception);
cairo_surface_get_fallback_resolution (surf, &x, &y);
-
+
offsets[0] = seed_value_from_double (ctx, x, exception);
offsets[1] = seed_value_from_double (ctx, y, exception);
@@ -324,7 +324,7 @@ seed_cairo_surface_has_show_text_glyphs(SeedContext ctx,
SeedException *exception)
{
CHECK_THIS();
- return seed_value_from_boolean (ctx,
+ return seed_value_from_boolean (ctx,
cairo_surface_has_show_text_glyphs (seed_object_to_cairo_surface(ctx, this_object, exception)), exception);
}
@@ -340,18 +340,18 @@ seed_cairo_surface_write_to_png (SeedContext ctx,
cairo_surface_t *surf;
gchar *filename;
CHECK_THIS();
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("write_to_png", "1 argument");
}
-
+
surf = seed_object_get_private (this_object);
filename = seed_value_to_string (ctx, arguments[0], exception);
-
+
ret = cairo_surface_write_to_png (surf, filename);
g_free (filename);
-
+
return seed_value_from_long (ctx, ret, exception);
}
@@ -384,14 +384,14 @@ seed_define_cairo_surface (SeedContext ctx,
SeedObject namespace_ref)
{
seed_class_definition surface_def = seed_empty_class;
-
+
surface_def.class_name = "Surface";
surface_def.finalize = seed_cairo_surface_finalize;
surface_def.static_functions = surface_funcs;
surface_def.static_values = surface_values;
seed_cairo_surface_class = seed_create_class (&surface_def);
-
+
seed_define_cairo_image_surface (ctx, namespace_ref);
seed_define_cairo_pdf_surface (ctx, namespace_ref);
}
diff --git a/modules/cairo/seed-cairo.c b/modules/cairo/seed-cairo.c
index d1c5a3b..c3fb263 100644
--- a/modules/cairo/seed-cairo.c
+++ b/modules/cairo/seed-cairo.c
@@ -35,7 +35,7 @@ cairo_user_data_key_t *
seed_get_cairo_key ()
{
static cairo_user_data_key_t foobaz;
-
+
return &foobaz;
}
@@ -59,11 +59,11 @@ SeedObject
seed_object_from_cairo_context (SeedContext ctx, cairo_t *cr)
{
SeedObject jsobj;
-
+
jsobj = cairo_get_user_data (cr, seed_get_cairo_key());
if (jsobj)
return jsobj;
-
+
jsobj = seed_make_object (ctx, seed_cairo_context_class, cr);
cairo_set_user_data (cr, seed_get_cairo_key(), jsobj, seed_cairo_destroy_func);
return jsobj;
@@ -139,7 +139,7 @@ seed_cairo_construct_context_steal (SeedContext ctx,
return seed_object_from_cairo_context (ctx, cr);
}
-static SeedValue
+static SeedValue
seed_cairo_save (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -149,12 +149,12 @@ seed_cairo_save (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_save(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_restore (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -164,12 +164,12 @@ seed_cairo_restore (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_restore(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_get_target (SeedContext ctx,
SeedObject this_object,
SeedString property_name,
@@ -177,11 +177,11 @@ seed_cairo_get_target (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
return seed_object_from_cairo_surface (ctx, cairo_get_target (cr));
}
-static SeedValue
+static SeedValue
seed_cairo_push_group (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -191,12 +191,12 @@ seed_cairo_push_group (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_push_group(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_push_group_with_content (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -210,8 +210,8 @@ seed_cairo_push_group_with_content (SeedContext ctx,
{
EXPECTED_EXCEPTION("push_group_with_content", "1 argument");
}
-
- CHECK_THIS();
+
+ CHECK_THIS();
cr = seed_object_get_private (this_object);
content = seed_value_to_long (ctx, arguments[0], exception);
cairo_push_group_with_content(cr, content);
@@ -219,7 +219,7 @@ seed_cairo_push_group_with_content (SeedContext ctx,
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_pop_group_to_source (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -229,12 +229,12 @@ seed_cairo_pop_group_to_source (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_pop_group_to_source(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_get_group_target (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -244,7 +244,7 @@ seed_cairo_get_group_target (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
return seed_object_from_cairo_surface (ctx, cairo_get_group_target (cr));
}
@@ -261,7 +261,7 @@ seed_cairo_set_source_rgb(SeedContext ctx,
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 3)
{
EXPECTED_EXCEPTION("set_source_rgb", "3 arguments");
@@ -270,8 +270,8 @@ seed_cairo_set_source_rgb(SeedContext ctx,
g = seed_value_to_double (ctx, arguments[1], exception);
b = seed_value_to_double (ctx, arguments[2], exception);
cairo_set_source_rgb (cr, r, g, b);
-
- return seed_make_undefined (ctx);
+
+ return seed_make_undefined (ctx);
}
static SeedValue
@@ -287,7 +287,7 @@ seed_cairo_set_source_rgba(SeedContext ctx,
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION("set_source_rgba", "4 arguments");
@@ -297,8 +297,8 @@ seed_cairo_set_source_rgba(SeedContext ctx,
b = seed_value_to_double (ctx, arguments[2], exception);
a = seed_value_to_double (ctx, arguments[3], exception);
cairo_set_source_rgba (cr, r, g, b, a);
-
- return seed_make_undefined (ctx);
+
+ return seed_make_undefined (ctx);
}
static SeedValue
@@ -312,17 +312,17 @@ seed_cairo_set_source_surface (SeedContext ctx,
gdouble x,y;
cairo_surface_t *surface;
cairo_t *cr;
-
+
CHECK_THIS();
cr = seed_object_get_private (this_object);
surface = seed_object_to_cairo_surface (ctx, arguments[0], exception);
if (!surface)
return seed_make_undefined (ctx);
-
+
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
cairo_set_source_surface (cr, surface, x, y);
-
+
return seed_make_undefined (ctx);
}
@@ -335,7 +335,7 @@ seed_cairo_set_antialias (SeedContext ctx,
{
cairo_t *cr;
cairo_antialias_t antialias;
-
+
CHECK_THIS_BOOL();
cr = seed_object_get_private (this_object);
antialias = seed_value_to_long (ctx, value, exception);
@@ -352,11 +352,11 @@ seed_cairo_get_antialias (SeedContext ctx,
{
cairo_antialias_t antialias;
cairo_t *cr;
-
+
CHECK_THIS();
cr = seed_object_get_private (this_object);
antialias = cairo_get_antialias (cr);
-
+
return seed_value_from_long (ctx, antialias, exception);
}
@@ -375,7 +375,7 @@ seed_cairo_set_dash(SeedContext ctx,
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("set_dash", "2 arguments");
@@ -395,7 +395,7 @@ seed_cairo_set_dash(SeedContext ctx,
}
offset = seed_value_to_double (ctx, arguments[1], exception);
cairo_set_dash (cr, dashes, num_dashes, offset);
-
+
return seed_make_undefined (ctx);
}
@@ -409,9 +409,9 @@ seed_cairo_pop_group (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
-
+
return seed_object_from_cairo_pattern (ctx, cairo_pop_group (cr));
}
@@ -426,10 +426,10 @@ seed_cairo_get_dash_count (SeedContext ctx,
cairo_t *cr;
gint dash_count;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
dash_count = cairo_get_dash_count (cr);
-
+
return seed_value_from_int (ctx, dash_count, exception);
}
@@ -445,13 +445,13 @@ seed_cairo_get_dash (SeedContext ctx,
cairo_t *cr;
gint dash_count, i;
gdouble *dashes, offset;
-
+
CHECK_THIS();
cr = seed_object_get_private (this_object);
dash_count = cairo_get_dash_count (cr);
dashes = g_alloca (dash_count * sizeof(gdouble));
jsdashes = g_alloca (dash_count * sizeof(SeedValue));
-
+
cairo_get_dash (cr, dashes, &offset);
for (i = 0; i < dash_count; i++)
{
@@ -459,7 +459,7 @@ seed_cairo_get_dash (SeedContext ctx,
}
ret[0] = seed_make_array (ctx, jsdashes, dash_count, exception);
ret[1] = seed_value_from_double (ctx, offset, exception);
-
+
return seed_make_array (ctx, ret, 2, exception);
}
@@ -471,7 +471,7 @@ seed_cairo_get_fill_rule (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_long (ctx, cairo_get_fill_rule (cr), exception);
}
@@ -485,7 +485,7 @@ seed_cairo_set_fill_rule (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_fill_rule (cr, seed_value_to_long (ctx, value, exception));
@@ -501,7 +501,7 @@ seed_cairo_get_line_cap (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_long (ctx, cairo_get_line_cap (cr), exception);
}
@@ -515,7 +515,7 @@ seed_cairo_set_line_cap (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_line_cap (cr, seed_value_to_long (ctx, value, exception));
@@ -530,7 +530,7 @@ seed_cairo_get_line_join (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_long (ctx, cairo_get_line_join (cr), exception);
}
@@ -544,10 +544,10 @@ seed_cairo_set_line_join (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_line_join (cr, seed_value_to_long (ctx, value, exception));
-
+
return TRUE;
}
@@ -560,7 +560,7 @@ seed_cairo_get_line_width (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_double (ctx, cairo_get_line_width (cr), exception);
}
@@ -574,10 +574,10 @@ seed_cairo_set_line_width (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_line_width (cr, seed_value_to_double (ctx, value, exception));
-
+
return TRUE;
}
@@ -589,7 +589,7 @@ seed_cairo_get_miter_limit (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_double (ctx, cairo_get_miter_limit (cr), exception);
}
@@ -603,10 +603,10 @@ seed_cairo_set_miter_limit (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_miter_limit (cr, seed_value_to_double (ctx, value, exception));
-
+
return TRUE;
}
@@ -618,7 +618,7 @@ seed_cairo_get_operator (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_long (ctx, cairo_get_operator (cr), exception);
}
@@ -632,10 +632,10 @@ seed_cairo_set_operator (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_operator (cr, seed_value_to_long (ctx, value, exception));
-
+
return TRUE;
}
@@ -647,7 +647,7 @@ seed_cairo_get_tolerance (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
return seed_value_from_double (ctx, cairo_get_tolerance (cr), exception);
}
@@ -661,14 +661,14 @@ seed_cairo_set_tolerance (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
cairo_set_tolerance (cr, seed_value_to_double (ctx, value, exception));
-
+
return TRUE;
}
-static SeedValue
+static SeedValue
seed_cairo_clip (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -678,13 +678,13 @@ seed_cairo_clip (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_clip(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_clip_preserve (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -694,12 +694,12 @@ seed_cairo_clip_preserve (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_clip_preserve(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_reset_clip (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -709,13 +709,13 @@ seed_cairo_reset_clip (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_reset_clip(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_clip_extents (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -727,12 +727,12 @@ seed_cairo_clip_extents (SeedContext ctx,
gdouble extents[4];
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION("clip_extents", "4 arguments");
}
-
+
cairo_clip_extents (cr, &extents[0], &extents[1], &extents[2], &extents[3]);
jsextents[0] = seed_value_from_double (ctx, extents[0], exception);
jsextents[1] = seed_value_from_double (ctx, extents[1], exception);
@@ -743,7 +743,7 @@ seed_cairo_clip_extents (SeedContext ctx,
}
-static SeedValue
+static SeedValue
seed_cairo_fill (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -753,13 +753,13 @@ seed_cairo_fill (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_fill(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_fill_preserve (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -769,12 +769,12 @@ seed_cairo_fill_preserve (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_fill_preserve(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_fill_extents (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -786,12 +786,12 @@ seed_cairo_fill_extents (SeedContext ctx,
gdouble extents[4];
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION("clip_extents", "4 arguments");
}
-
+
cairo_fill_extents (cr, &extents[0], &extents[1], &extents[2], &extents[3]);
jsextents[0] = seed_value_from_double (ctx, extents[0], exception);
jsextents[1] = seed_value_from_double (ctx, extents[1], exception);
@@ -813,15 +813,15 @@ seed_cairo_in_fill (SeedContext ctx,
cairo_t *cr;
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("in_fill", "2 arguments");
}
-
+
x = seed_value_to_double (ctx, arguments[0], exception);
y = seed_value_to_double (ctx, arguments[1], exception);
-
+
return seed_value_from_boolean (ctx, cairo_in_fill (cr, x, y), exception);
}
@@ -836,16 +836,16 @@ seed_cairo_mask_surface (SeedContext ctx,
gdouble x,y;
cairo_surface_t *surface;
cairo_t *cr;
-
+
cr = seed_object_get_private (this_object);
surface = seed_object_to_cairo_surface (ctx, arguments[0], exception);
if (!surface)
return seed_make_undefined (ctx);
-
+
x = seed_value_to_double (ctx, arguments[1], exception);
y = seed_value_to_double (ctx, arguments[2], exception);
cairo_mask_surface (cr, surface, x, y);
-
+
return seed_make_undefined (ctx);
}
@@ -859,7 +859,7 @@ seed_cairo_mask (SeedContext ctx,
{
cairo_t *cr;
cairo_pattern_t *pat;
-
+
CHECK_THIS();
if (argument_count != 1 && argument_count != 3)
{
@@ -876,10 +876,10 @@ seed_cairo_mask (SeedContext ctx,
return seed_make_undefined (ctx);
}
cairo_mask (cr, pat);
- return seed_make_undefined (ctx);
+ return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_paint (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -889,7 +889,7 @@ seed_cairo_paint (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_paint(cr);
return seed_make_undefined (ctx);
}
@@ -904,19 +904,19 @@ seed_cairo_paint_with_alpha (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("paint_with_alpha", "1 argument");
}
-
+
cr = seed_object_get_private (this_object);
cairo_paint_with_alpha (cr, seed_value_to_double (ctx, arguments[0], exception));
-
+
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_stroke (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -926,13 +926,13 @@ seed_cairo_stroke (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_stroke(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_stroke_preserve (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -942,12 +942,12 @@ seed_cairo_stroke_preserve (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_stroke_preserve(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_stroke_extents (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -959,12 +959,12 @@ seed_cairo_stroke_extents (SeedContext ctx,
gdouble extents[4];
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION("clip_extents", "4 arguments");
}
-
+
cairo_stroke_extents (cr, &extents[0], &extents[1], &extents[2], &extents[3]);
jsextents[0] = seed_value_from_double (ctx, extents[0], exception);
jsextents[1] = seed_value_from_double (ctx, extents[1], exception);
@@ -986,19 +986,19 @@ seed_cairo_in_stroke (SeedContext ctx,
cairo_t *cr;
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("in_stroke", "2 arguments");
}
-
+
x = seed_value_to_double (ctx, arguments[0], exception);
y = seed_value_to_double (ctx, arguments[1], exception);
-
+
return seed_value_from_boolean (ctx, cairo_in_stroke (cr, x, y), exception);
}
-static SeedValue
+static SeedValue
seed_cairo_copy_page (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1008,12 +1008,12 @@ seed_cairo_copy_page (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_copy_page(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_show_page (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1023,12 +1023,12 @@ seed_cairo_show_page (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_show_page(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_has_current_point (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1038,11 +1038,11 @@ seed_cairo_has_current_point (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
return seed_value_from_boolean (ctx, cairo_has_current_point(cr), exception);
}
-static SeedValue
+static SeedValue
seed_cairo_get_current_point (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1058,11 +1058,11 @@ seed_cairo_get_current_point (SeedContext ctx,
cairo_get_current_point (cr, &x, &y);
points[0] = seed_value_from_double (ctx, x, exception);
points[1] = seed_value_from_double (ctx, y, exception);
-
+
return seed_make_array (ctx, points, 2, exception);
}
-static SeedValue
+static SeedValue
seed_cairo_new_path (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1072,12 +1072,12 @@ seed_cairo_new_path (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_new_path(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_new_sub_path (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1087,12 +1087,12 @@ seed_cairo_new_sub_path (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_new_sub_path(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_close_path (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1102,12 +1102,12 @@ seed_cairo_close_path (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_close_path(cr);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_arc (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1118,7 +1118,7 @@ seed_cairo_arc (SeedContext ctx,
gdouble xc, yc, radius, angle1, angle2;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 5)
{
EXPECTED_EXCEPTION ("arc", "5 arguments");
@@ -1128,12 +1128,12 @@ seed_cairo_arc (SeedContext ctx,
radius = seed_value_to_double (ctx, arguments[2], exception);
angle1 = seed_value_to_double (ctx, arguments[3], exception);
angle2 = seed_value_to_double (ctx, arguments[4], exception);
-
+
cairo_arc (cr, xc, yc, radius, angle1, angle2);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_arc_negative (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1144,7 +1144,7 @@ seed_cairo_arc_negative (SeedContext ctx,
gdouble xc, yc, radius, angle1, angle2;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 5)
{
EXPECTED_EXCEPTION ("arc_negative", "5 arguments");
@@ -1154,12 +1154,12 @@ seed_cairo_arc_negative (SeedContext ctx,
radius = seed_value_to_double (ctx, arguments[2], exception);
angle1 = seed_value_to_double (ctx, arguments[3], exception);
angle2 = seed_value_to_double (ctx, arguments[4], exception);
-
+
cairo_arc_negative (cr, xc, yc, radius, angle1, angle2);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_curve_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1170,7 +1170,7 @@ seed_cairo_curve_to (SeedContext ctx,
gdouble x1,y1,x2,y2,x3,y3;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 6)
{
EXPECTED_EXCEPTION ("curve_to", "6 arguments");
@@ -1181,12 +1181,12 @@ seed_cairo_curve_to (SeedContext ctx,
y2 = seed_value_to_double (ctx, arguments[3], exception);
x3 = seed_value_to_double (ctx, arguments[4], exception);
y3 = seed_value_to_double (ctx, arguments[5], exception);
-
+
cairo_curve_to (cr, x1, y2, x2, y2, x3, y3);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_rel_curve_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1197,7 +1197,7 @@ seed_cairo_rel_curve_to (SeedContext ctx,
gdouble x1,y1,x2,y2,x3,y3;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 6)
{
EXPECTED_EXCEPTION ("rel_curve_to", "6 arguments");
@@ -1208,12 +1208,12 @@ seed_cairo_rel_curve_to (SeedContext ctx,
y2 = seed_value_to_double (ctx, arguments[3], exception);
x3 = seed_value_to_double (ctx, arguments[4], exception);
y3 = seed_value_to_double (ctx, arguments[5], exception);
-
+
cairo_rel_curve_to (cr, x1, y2, x2, y2, x3, y3);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_line_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1224,19 +1224,19 @@ seed_cairo_line_to (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("line_to", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_line_to (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_rel_line_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1247,19 +1247,19 @@ seed_cairo_rel_line_to (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("rel_line_to", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_rel_line_to (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_move_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1270,19 +1270,19 @@ seed_cairo_move_to (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("move_to", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_move_to (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_rel_move_to (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1293,19 +1293,19 @@ seed_cairo_rel_move_to (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("rel_move_to", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_rel_move_to (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_rectangle (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1316,7 +1316,7 @@ seed_cairo_rectangle (SeedContext ctx,
gdouble x1,y1, width, height;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION ("rectangle", "2 arguments");
@@ -1325,7 +1325,7 @@ seed_cairo_rectangle (SeedContext ctx,
y1 = seed_value_to_double (ctx, arguments[1], exception);
width = seed_value_to_double (ctx, arguments[2], exception);
height = seed_value_to_double (ctx, arguments[3], exception);
-
+
cairo_rectangle (cr, x1, y1, width, height);
return seed_make_undefined (ctx);
}
@@ -1342,7 +1342,7 @@ seed_cairo_text_path (SeedContext ctx,
gchar *text;
CHECK_THIS();
cr = seed_object_get_private (this_object);
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("text_path", "1 argument");
@@ -1350,11 +1350,11 @@ seed_cairo_text_path (SeedContext ctx,
text = seed_value_to_string (ctx, arguments[0], exception);
cairo_text_path (cr, text);
g_free (text);
-
+
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_path_extents (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1366,12 +1366,12 @@ seed_cairo_path_extents (SeedContext ctx,
gdouble extents[4];
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 4)
{
EXPECTED_EXCEPTION("path_extents", "4 arguments");
}
-
+
cairo_path_extents (cr, &extents[0], &extents[1], &extents[2], &extents[3]);
jsextents[0] = seed_value_from_double (ctx, extents[0], exception);
jsextents[1] = seed_value_from_double (ctx, extents[1], exception);
@@ -1381,7 +1381,7 @@ seed_cairo_path_extents (SeedContext ctx,
return seed_make_array (ctx, jsextents, 4, exception);
}
-static SeedValue
+static SeedValue
seed_cairo_translate (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1392,19 +1392,19 @@ seed_cairo_translate (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("translate", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_translate (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_scale (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1415,19 +1415,19 @@ seed_cairo_scale (SeedContext ctx,
gdouble x1,y1;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION ("scale", "2 arguments");
}
x1 = seed_value_to_double (ctx, arguments[0], exception);
y1 = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_scale (cr, x1, y1);
return seed_make_undefined (ctx);
}
-static SeedValue
+static SeedValue
seed_cairo_rotate (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1438,14 +1438,14 @@ seed_cairo_rotate (SeedContext ctx,
gdouble angle;
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION ("rotate", "1 arguments");
}
angle = seed_value_to_double (ctx, arguments[0], exception);
-
+
cairo_rotate (cr, angle);
return seed_make_undefined (ctx);
}
@@ -1489,7 +1489,7 @@ seed_cairo_get_matrix (SeedContext ctx,
cairo_t *cr;
cairo_matrix_t m;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
cairo_get_matrix (cr, &m);
return seed_value_from_cairo_matrix (ctx, &m, exception);
@@ -1505,7 +1505,7 @@ seed_cairo_set_matrix (SeedContext ctx,
cairo_matrix_t m;
cairo_t *cr;
CHECK_THIS_BOOL();
-
+
cr = seed_object_get_private (this_object);
if (!seed_value_to_cairo_matrix (ctx, value, &m, exception))
{
@@ -1513,11 +1513,11 @@ seed_cairo_set_matrix (SeedContext ctx,
return FALSE;
}
cairo_set_matrix (cr, &m);
-
+
return TRUE;
}
-static SeedValue
+static SeedValue
seed_cairo_identity_matrix (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -1527,7 +1527,7 @@ seed_cairo_identity_matrix (SeedContext ctx,
{
CHECK_THIS();
cairo_t *cr = seed_object_get_private (this_object);
-
+
cairo_identity_matrix(cr);
return seed_make_undefined (ctx);
}
@@ -1543,7 +1543,7 @@ seed_cairo_user_to_device (SeedContext ctx,
SeedValue out[2];
cairo_t *cr;
double ix, iy;
-
+
CHECK_THIS();
if (argument_count != 2)
{
@@ -1552,11 +1552,11 @@ seed_cairo_user_to_device (SeedContext ctx,
cr = seed_object_get_private (this_object);
ix = seed_value_to_double (ctx, arguments[0], exception);
iy = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_user_to_device (cr, &ix, &iy);
out[0] = seed_value_from_double (ctx, ix, exception);
out[1] = seed_value_from_double (ctx, iy, exception);
-
+
return seed_make_array (ctx, out, 2, exception);
}
@@ -1572,7 +1572,7 @@ seed_cairo_user_to_device_distance (SeedContext ctx,
SeedValue out[2];
cairo_t *cr;
double ix, iy;
-
+
CHECK_THIS();
if (argument_count != 2)
{
@@ -1581,11 +1581,11 @@ seed_cairo_user_to_device_distance (SeedContext ctx,
cr = seed_object_get_private (this_object);
ix = seed_value_to_double (ctx, arguments[0], exception);
iy = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_user_to_device_distance (cr, &ix, &iy);
out[0] = seed_value_from_double (ctx, ix, exception);
out[1] = seed_value_from_double (ctx, iy, exception);
-
+
return seed_make_array (ctx, out, 2, exception);
}
@@ -1600,7 +1600,7 @@ seed_cairo_device_to_user (SeedContext ctx,
SeedValue out[2];
cairo_t *cr;
double ix, iy;
-
+
CHECK_THIS();
if (argument_count != 2)
{
@@ -1609,11 +1609,11 @@ seed_cairo_device_to_user (SeedContext ctx,
cr = seed_object_get_private (this_object);
ix = seed_value_to_double (ctx, arguments[0], exception);
iy = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_device_to_user (cr, &ix, &iy);
out[0] = seed_value_from_double (ctx, ix, exception);
out[1] = seed_value_from_double (ctx, iy, exception);
-
+
return seed_make_array (ctx, out, 2, exception);
}
@@ -1628,7 +1628,7 @@ seed_cairo_device_to_user_distance (SeedContext ctx,
SeedValue out[2];
cairo_t *cr;
double ix, iy;
-
+
CHECK_THIS();
if (argument_count != 2)
{
@@ -1637,11 +1637,11 @@ seed_cairo_device_to_user_distance (SeedContext ctx,
cr = seed_object_get_private (this_object);
ix = seed_value_to_double (ctx, arguments[0], exception);
iy = seed_value_to_double (ctx, arguments[1], exception);
-
+
cairo_device_to_user_distance (cr, &ix, &iy);
out[0] = seed_value_from_double (ctx, ix, exception);
out[1] = seed_value_from_double (ctx, iy, exception);
-
+
return seed_make_array (ctx, out, 2, exception);
}
@@ -1655,7 +1655,7 @@ seed_cairo_set_source (SeedContext ctx,
{
cairo_t *cr;
cairo_pattern_t *pat;
-
+
CHECK_THIS();
if (argument_count != 1 && argument_count != 3)
{
@@ -1670,10 +1670,10 @@ seed_cairo_set_source (SeedContext ctx,
seed_make_exception (ctx, exception, "ArgumentError", "set_source needs a Cairo Pattern as argument");
return seed_make_undefined (ctx);
}
-
+
cr = seed_object_get_private (this_object);
cairo_set_source (cr,pat);
-
+
return seed_make_undefined (ctx);
}
@@ -1687,9 +1687,9 @@ seed_cairo_get_source (SeedContext ctx,
{
cairo_t *cr;
CHECK_THIS();
-
+
cr = seed_object_get_private (this_object);
-
+
return seed_object_from_cairo_pattern (ctx, cairo_get_source(cr));
}
@@ -1718,7 +1718,7 @@ seed_static_value cairo_values[] = {
{"target", seed_cairo_get_target, 0, SEED_PROPERTY_ATTRIBUTE_READ_ONLY | SEED_PROPERTY_ATTRIBUTE_DONT_DELETE},
{0, 0, 0, 0}
};
-
+
seed_static_function cairo_funcs[] = {
{"save", seed_cairo_save, 0},
{"restore", seed_cairo_restore, 0},
@@ -1726,7 +1726,7 @@ seed_static_function cairo_funcs[] = {
{"push_group_with_content", seed_cairo_push_group_with_content, 0},
{"set_dash", seed_cairo_set_dash, 0},
{"get_dash_count", seed_cairo_get_dash_count, 0},
- {"get_dash", seed_cairo_get_dash, 0},
+ {"get_dash", seed_cairo_get_dash, 0},
{"pop_group", seed_cairo_pop_group, 0},
{"pop_group_to_source", seed_cairo_pop_group_to_source, 0},
{"get_group_target", seed_cairo_get_group_target, 0},
@@ -1793,7 +1793,7 @@ seed_module_init(SeedEngine * local_eng)
seed_class_definition cairo_def = seed_empty_class;
eng = local_eng;
namespace_ref = seed_make_object (eng->context, NULL, NULL);
-
+
// Temporary hack until API changes.
seed_value_protect (eng->context, namespace_ref);
@@ -1801,7 +1801,7 @@ seed_module_init(SeedEngine * local_eng)
seed_define_cairo_surface (eng->context, namespace_ref);
seed_define_cairo_matrix (eng->context, namespace_ref);
seed_define_cairo_pattern (eng->context, namespace_ref);
-
+
cairo_def.class_name = "Context";
cairo_def.static_functions = cairo_funcs;
cairo_def.static_values = cairo_values;
@@ -1824,6 +1824,6 @@ seed_module_init(SeedEngine * local_eng)
seed_object_set_property (eng->context, namespace_ref, "Context", context_constructor_ref);
seed_object_set_property (eng->context, context_constructor_ref, "from_drawable", gdk_context_constructor_ref);
seed_object_set_property (eng->context, context_constructor_ref, "steal", steal_context_constructor_ref);
-
+
return namespace_ref;
}
diff --git a/modules/canvas/seed-canvas.c b/modules/canvas/seed-canvas.c
index 29c5a16..ec7a9f0 100644
--- a/modules/canvas/seed-canvas.c
+++ b/modules/canvas/seed-canvas.c
@@ -20,21 +20,21 @@ typedef struct _SeedCanvasColor {
typedef struct _SeedCanvasStyle {
SeedCanvasColor fill;
SeedCanvasColor stroke;
-
+
gdouble global_opacity;
cairo_operator_t operator;
} SeedCanvasStyle;
typedef struct _SeedCanvasPrivates {
cairo_t *cr;
-
+
GSList *styles;
} SeedCanvasPrivates;
#define GET_CR \
SeedCanvasPrivates *priv = seed_object_get_private(this_object); \
cairo_t *cr = priv->cr
-
+
SeedObject
canvas_construct_canvas_from_cairo (SeedContext ctx, cairo_t * cr,
@@ -45,7 +45,7 @@ canvas_construct_canvas_from_cairo (SeedContext ctx, cairo_t * cr,
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_set_miter_limit (cr, 10);
-
+
priv->cr = cr;
priv->styles = NULL;
@@ -203,7 +203,7 @@ seed_canvas_parse_color (SeedCanvasColor *color,
if (*spec == '#')
{
guint r = 0, g = 0, b = 0, a = 0, found;
-
+
if (strlen (spec) > 4)
found = sscanf(spec, "#%2x%2x%2x%2x", &r, &g, &b, &a);
else
@@ -216,7 +216,7 @@ seed_canvas_parse_color (SeedCanvasColor *color,
}
if (found < 4)
a = 0xff;
-
+
color->r = r / 255.0;
color->g = g / 255.0;
color->b = b / 255.0;
@@ -232,27 +232,27 @@ seed_canvas_parse_color (SeedCanvasColor *color,
{
gdouble r, g, b;
gfloat a;
-
+
sscanf (spec, "rgba(%lf,%lf,%lf,%f)", &r, &g, &b, &a);
-
+
color->r = r/255.0;
color->g = g/255.0;
color->b = b/255.0;
color->a = a;
-
+
return;
}
case '(':
{
gdouble r, g, b;
-
+
sscanf (spec, "rgb(%lf,%lf,%lf)", &r, &g, &b);
-
+
color->r = r / 255.0;
color->g = g / 255.0;
color->b = b / 255.0;
color->a = 1.0;
-
+
return;
}
}
@@ -268,12 +268,12 @@ gboolean
seed_canvas_update_stroke_style (SeedContext ctx,
SeedObject this_object,
SeedString property_name,
- SeedValue value,
+ SeedValue value,
SeedException * e)
{
SeedCanvasStyle *style;
GET_CR;
-
+
gchar *stroke_style = seed_value_to_string (ctx, value, e);
if (!priv->styles)
@@ -283,13 +283,13 @@ seed_canvas_update_stroke_style (SeedContext ctx,
((SeedCanvasStyle *) priv->styles->data)->fill.a = 1;
((SeedCanvasStyle *) priv->styles->data)->operator = CAIRO_OPERATOR_OVER;
}
-
+
style = (SeedCanvasStyle *)priv->styles->data;
-
+
seed_canvas_parse_color (&style->stroke, stroke_style);
-
+
g_free(stroke_style);
-
+
return TRUE;
}
@@ -302,7 +302,7 @@ seed_canvas_update_fill_style (SeedContext ctx,
{
SeedCanvasStyle *style;
GET_CR;
-
+
gchar *fill_style = seed_value_to_string (ctx, value, e);
if (!priv->styles)
@@ -312,14 +312,14 @@ seed_canvas_update_fill_style (SeedContext ctx,
((SeedCanvasStyle *) priv->styles->data)->stroke.a = 1;
((SeedCanvasStyle *) priv->styles->data)->operator = CAIRO_OPERATOR_OVER;
}
-
+
style = (SeedCanvasStyle *)priv->styles->data;
-
+
seed_canvas_parse_color (&style->fill, fill_style);
-
+
g_free(fill_style);
-
+
return TRUE;
}
@@ -331,7 +331,7 @@ seed_canvas_update_global_alpha (SeedContext ctx,
{
SeedCanvasStyle *style;
GET_CR;
-
+
gdouble global_alpha = seed_value_to_double (ctx, value, e);
if (!priv->styles)
@@ -344,9 +344,9 @@ seed_canvas_update_global_alpha (SeedContext ctx,
}
style = (SeedCanvasStyle *)priv->styles->data;
-
+
style->global_opacity = global_alpha;
-
+
return TRUE;
}
@@ -370,7 +370,7 @@ seed_canvas_update_global_composite (SeedContext ctx,
}
style = (SeedCanvasStyle *)priv->styles->data;
-
+
if (!strcmp (composite_op, "copy"))
style->operator = CAIRO_OPERATOR_SOURCE;
else if (!strcmp (composite_op, "source-over"))
@@ -397,11 +397,11 @@ seed_canvas_update_global_composite (SeedContext ctx,
style->operator = CAIRO_OPERATOR_ADD;
else
style->operator = CAIRO_OPERATOR_OVER;
-
+
cairo_set_operator (cr, style->operator);
-
+
g_free (composite_op);
-
+
return TRUE;
}
@@ -476,7 +476,7 @@ void
seed_canvas_apply_stroke_style (SeedCanvasStyle *style,
cairo_t * cr)
{
- cairo_set_source_rgba(cr,
+ cairo_set_source_rgba(cr,
style->stroke.r,
style->stroke.g,
style->stroke.b,
@@ -488,7 +488,7 @@ void
seed_canvas_apply_fill_style (SeedCanvasStyle *style,
cairo_t * cr)
{
- cairo_set_source_rgba(cr,
+ cairo_set_source_rgba(cr,
style->fill.r,
style->fill.g,
style->fill.b,
@@ -508,7 +508,7 @@ seed_canvas_save (SeedContext ctx,
SeedCanvasStyle *old_style = (SeedCanvasStyle *)priv->styles->data;
cairo_save (cr);
-
+
priv->styles = g_slist_prepend(priv->styles, g_new(SeedCanvasStyle, 1));
memcpy(priv->styles->data, old_style, sizeof(SeedCanvasStyle));
@@ -782,7 +782,7 @@ seed_canvas_stroke (SeedContext ctx,
{
GET_CR;
- seed_canvas_apply_stroke_style ((SeedCanvasStyle *)priv->styles->data,
+ seed_canvas_apply_stroke_style ((SeedCanvasStyle *)priv->styles->data,
cr);
cairo_stroke (cr);
@@ -866,7 +866,7 @@ seed_canvas_quadratic (SeedContext ctx,
// Convert quadratic curve to cubic curve...
- // I think the math is explained in some
+ // I think the math is explained in some
// freetype documentation somewhere.
cp3x = qp2x;
cp3y = qp2y;
@@ -1071,6 +1071,6 @@ seed_module_init (SeedEngine * local_eng)
svg_constructor);
seed_object_set_property (eng->context, namespace_ref, "ImageCanvas",
svg_constructor);
-
+
return namespace_ref;
}
diff --git a/modules/dbus/dbus-exports.c b/modules/dbus/dbus-exports.c
index 61b68bd..d646b06 100644
--- a/modules/dbus/dbus-exports.c
+++ b/modules/dbus/dbus-exports.c
@@ -9,7 +9,7 @@
typedef struct _Exports {
// Why does GJS have this?
SeedObject object;
-
+
DBusBusType which_bus;
DBusConnection *connection_weak_ref;
gboolean filter_was_registered;
@@ -52,12 +52,12 @@ on_bus_opened(DBusConnection *connection,
if (!dbus_connection_add_filter(connection,
on_message, priv,
- NULL))
+ NULL))
{
g_warning("DBus: Failed to add message filter");
return;
}
-
+
priv->filter_was_registered = TRUE;
}
@@ -71,7 +71,7 @@ on_bus_closed(DBusConnection *connection,
priv->connection_weak_ref = NULL;
- if (priv->filter_was_registered)
+ if (priv->filter_was_registered)
{
dbus_connection_remove_filter(connection,
on_message, priv);
@@ -96,10 +96,10 @@ dbus_reply_from_exception_and_sender(SeedContext ctx,
gchar *s;
const gchar *name = NULL;
-
+
*reply_p = NULL;
- if (seed_value_is_undefined (ctx, *exception) ||
+ if (seed_value_is_undefined (ctx, *exception) ||
seed_value_is_null (ctx, *exception) ||
!seed_value_is_object (ctx, *exception))
return FALSE;
@@ -143,22 +143,22 @@ signature_from_method(SeedContext ctx,
SeedException *exception)
{
SeedValue signature_value;
-
+
if ((signature_value = seed_object_get_property(ctx,
method_obj, "outSignature")))
{
*signature = seed_value_to_string (ctx, signature_value, exception);
- if (*signature == NULL)
+ if (*signature == NULL)
{
return FALSE;
}
- }
- else
+ }
+ else
{
/* We default to a{sv} */
*signature = "a{sv}";
}
-
+
return TRUE;
}
@@ -195,21 +195,21 @@ build_reply_from_jsval(SeedContext ctx,
dbus_message_iter_init_append(reply, &arg_iter);
- if (seed_value_is_undefined (ctx, rval) || g_str_equal(signature, ""))
+ if (seed_value_is_undefined (ctx, rval) || g_str_equal(signature, ""))
{
/* We don't want to send anything in these cases so skip the
* marshalling altogether.
*/
return reply;
}
-
+
dbus_signature_iter_init(&sig_iter, signature);
-
- if (signature_has_one_element(signature))
+
+ if (signature_has_one_element(signature))
{
marshalled = seed_js_one_value_to_dbus(ctx, rval, &arg_iter, &sig_iter, exception);
- }
- else
+ }
+ else
{
if (!seed_value_is_object (ctx, rval))
{
@@ -248,7 +248,7 @@ invoke_js_from_dbus(SeedContext ctx,
dbus_message_iter_init(method_call, &arg_iter);
- if (!seed_js_values_from_dbus(ctx, &arg_iter, &values, exception))
+ if (!seed_js_values_from_dbus(ctx, &arg_iter, &values, exception))
{
if (!dbus_reply_from_exception(ctx, method_call, &reply, exception))
g_warning("conversion of dbus method arg failed but no exception was set?");
@@ -273,7 +273,7 @@ invoke_js_from_dbus(SeedContext ctx,
goto out;
}
- if (dbus_reply_from_exception(ctx, method_call, &reply, exception))
+ if (dbus_reply_from_exception(ctx, method_call, &reply, exception))
{
g_warning("Closure invocation succeeded but an exception was set?");
goto out;
@@ -281,11 +281,11 @@ invoke_js_from_dbus(SeedContext ctx,
if (!signature_from_method(ctx,
method_obj,
- &signature, exception))
+ &signature, exception))
{
if (!dbus_reply_from_exception(ctx, method_call, &reply, exception))
g_warning("dbus method invocation failed but no exception was set?");
-
+
goto out;
}
@@ -340,13 +340,13 @@ async_call_callback(SeedContext ctx,
prop_value = seed_object_get_property(ctx,
function,
"_dbusSerial");
-
-
+
+
serial = seed_value_to_uint (ctx, prop_value, exception);
prop_value = seed_object_get_property(ctx,
function,
"_dbusBusType");
-
+
which_bus = seed_value_to_int(ctx, prop_value, exception);
/* From now we have enough information to
@@ -355,13 +355,13 @@ async_call_callback(SeedContext ctx,
prop_value = seed_object_get_property(ctx,
function,
"_dbusOutSignature");
-
+
signature = seed_value_to_string (ctx, prop_value, exception);
if (!signature)
return FALSE;
if (argument_count != 1) {
- seed_make_exception(ctx, exception, "ArgumentError",
+ seed_make_exception(ctx, exception, "ArgumentError",
"The callback to async DBus calls takes one argument, "
"the return value or array of return values");
thrown = TRUE;
@@ -376,18 +376,18 @@ async_call_callback(SeedContext ctx,
exception);
out:
- if (!reply && thrown)
+ if (!reply && thrown)
{
if (!dbus_reply_from_exception_and_sender(ctx, sender, serial, &reply, exception))
g_warning("dbus method invocation failed but no exception was set?");
}
- if (reply)
+ if (reply)
{
big_dbus_add_bus_weakref(which_bus, &connection);
- if (!connection)
+ if (!connection)
{
- seed_make_exception(ctx, exception, "DBusError",
+ seed_make_exception(ctx, exception, "DBusError",
"We were disconnected from the bus before the callback "
"to some async remote call was called");
dbus_message_unref(reply);
@@ -427,7 +427,7 @@ invoke_js_async_from_dbus(SeedContext ctx,
argc = 0;
argv = NULL;
- if (!seed_js_values_from_dbus(ctx, &arg_iter, &values, exception))
+ if (!seed_js_values_from_dbus(ctx, &arg_iter, &values, exception))
{
if (!dbus_reply_from_exception(ctx, method_call, &reply, exception))
g_warning ("conversion of dbus method arg failed but no exception was set?");
@@ -446,12 +446,12 @@ invoke_js_async_from_dbus(SeedContext ctx,
* callback, so we don't need to bother with memory managing them
* if the callback is never called and just discarded.*/
sender_string = seed_value_from_string (ctx, dbus_message_get_sender (method_call), exception);
- if (!sender_string)
+ if (!sender_string)
{
thrown = TRUE;
goto out;
}
-
+
seed_object_set_property (ctx, callback_object, "_dbusSender", sender_string);
seed_object_set_property (ctx, callback_object, "_dbusSerial",
seed_value_from_int (ctx, dbus_message_get_serial (method_call),
@@ -462,14 +462,14 @@ invoke_js_async_from_dbus(SeedContext ctx,
if (!signature_from_method(ctx,
method_obj,
&signature,
- exception))
+ exception))
{
thrown = TRUE;
goto out;
}
-
+
signature_string = seed_value_from_string (ctx, signature, exception);
- if (!signature_string)
+ if (!signature_string)
{
thrown = TRUE;
goto out;
@@ -479,10 +479,10 @@ invoke_js_async_from_dbus(SeedContext ctx,
argc = values->len;
argv = (SeedValue *)values->data;
- seed_object_call (ctx, method_obj, this_obj, argc,
+ seed_object_call (ctx, method_obj, this_obj, argc,
argv, &ignored);
out:
- if (thrown)
+ if (thrown)
{
if (!dbus_reply_from_exception(ctx, method_call, &reply, exception))
g_warning("conversion of dbus method arg failed but no exception was set?");
@@ -508,7 +508,7 @@ find_js_property_by_path(SeedContext ctx,
/* g_strsplit returns empty string for the first
* '/' so we start with elements[1]
*/
- for (i = 1; elements[i] != NULL; ++i)
+ for (i = 1; elements[i] != NULL; ++i)
{
obj = seed_object_get_property(ctx, obj, elements[i]);
@@ -519,7 +519,7 @@ find_js_property_by_path(SeedContext ctx,
break;
}
}
-
+
g_strfreev(elements);
return obj;
@@ -532,7 +532,7 @@ find_method(SeedContext ctx,
SeedValue *method_value)
{
*method_value = seed_object_get_property (ctx, obj, method_name);
- if (seed_value_is_undefined (ctx, *method_value) ||
+ if (seed_value_is_undefined (ctx, *method_value) ||
!seed_value_is_object (ctx, *method_value))
return FALSE;
@@ -554,27 +554,27 @@ on_message(DBusConnection *connection,
SeedValue method_value;
DBusMessage *reply;
Exports *priv;
-
+
priv = user_data;
async_method_name = NULL;
reply = NULL;
-
+
ctx = seed_context_create (group, NULL);
seed_prepare_global_context (ctx);
-
+
if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
+
method_value = seed_make_undefined (ctx);
result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
+
path = dbus_message_get_path(message);
-
+
obj = find_js_property_by_path(ctx,
priv->object,
path);
- if (obj == NULL)
+ if (obj == NULL)
{
g_warning("There is no JS object at %s",
path);
@@ -642,9 +642,9 @@ exports_constructor(SeedContext ctx,
SeedObject obj)
{
Exports *priv;
-
+
priv = g_slice_new0(Exports);
-
+
seed_object_set_private (obj, priv);
priv->object = obj;
}
@@ -707,14 +707,14 @@ exports_new (SeedContext ctx,
{
SeedObject exports;
SeedObject global;
-
+
global = seed_context_get_global_object (ctx);
if (!seed_js_exports_class)
{
seed_class_definition def = seed_empty_class;
def.initialize = exports_constructor;
def.finalize = exports_finalize;
-
+
seed_js_exports_class = seed_create_class (&def);
}
exports = seed_make_object (ctx, seed_js_exports_class, NULL);
@@ -736,7 +736,7 @@ seed_js_define_dbus_exports(SeedContext ctx,
if (!add_connect_funcs(ctx, exports, which_bus))
return FALSE;
-
+
seed_object_set_property (ctx, on_object, "exports",
exports);
diff --git a/modules/dbus/dbus-values.c b/modules/dbus/dbus-values.c
index 97fd018..e6b85af 100644
--- a/modules/dbus/dbus-values.c
+++ b/modules/dbus/dbus-values.c
@@ -13,7 +13,7 @@
gboolean
seed_js_one_value_from_dbus (SeedContext ctx,
- DBusMessageIter * iter,
+ DBusMessageIter * iter,
SeedValue *value_p,
SeedException *exception)
{
@@ -109,7 +109,7 @@ seed_js_one_value_from_dbus (SeedContext ctx,
{
return FALSE;
}
-
+
seed_object_set_property (ctx, obj,
key, entry_value);
@@ -153,14 +153,14 @@ seed_js_one_value_from_dbus (SeedContext ctx,
{
return FALSE;
}
-
+
seed_object_set_property_at_index (ctx, obj, index, prop_value, exception);
dbus_message_iter_next (&array_iter);
index++;
}
seed_object_set_property (ctx, obj, "length",
- seed_value_from_int (ctx,
+ seed_value_from_int (ctx,
index, exception));
*value_p = (SeedValue) obj;
}
@@ -252,15 +252,15 @@ seed_js_one_value_from_dbus (SeedContext ctx,
gboolean
seed_js_values_from_dbus (SeedContext ctx,
- DBusMessageIter * iter,
+ DBusMessageIter * iter,
GArray **array_p,
SeedException *exception)
{
GArray *array;
SeedValue value;
-
+
value = seed_make_undefined (ctx);
-
+
array = g_array_new (FALSE, FALSE, sizeof(SeedValue));
/* TODO */
@@ -273,11 +273,11 @@ seed_js_values_from_dbus (SeedContext ctx,
g_array_free (array, TRUE);
return FALSE;
}
-
+
g_array_append_val (array, value);
}
while (dbus_message_iter_next (iter));
-
+
*array_p = array;
return TRUE;
}
@@ -309,7 +309,7 @@ append_basic_maybe_in_variant (DBusMessageIter * iter,
static void
append_byte_array_maybe_in_variant (DBusMessageIter * iter,
const char *data,
- gsize len,
+ gsize len,
gboolean wrap_in_variant)
{
DBusMessageIter array_iter;
@@ -339,8 +339,8 @@ append_byte_array_maybe_in_variant (DBusMessageIter * iter,
static gboolean
append_string (SeedContext ctx,
DBusMessageIter * iter,
- const char *forced_signature,
- const char *s,
+ const char *forced_signature,
+ const char *s,
gsize len,
SeedException *exception)
{
@@ -388,8 +388,8 @@ append_string (SeedContext ctx,
static gboolean
append_int32 (SeedContext ctx,
- DBusMessageIter * iter,
- int forced_type,
+ DBusMessageIter * iter,
+ int forced_type,
dbus_int32_t v_INT32,
SeedException *exception)
{
@@ -501,7 +501,7 @@ append_boolean (SeedContext ctx,
static gboolean
append_array (SeedContext ctx,
DBusMessageIter * iter,
- DBusSignatureIter * sig_iter, SeedObject array,
+ DBusSignatureIter * sig_iter, SeedObject array,
int length,
SeedException *exception)
{
@@ -548,9 +548,9 @@ append_array (SeedContext ctx,
for (i = 0; i < length; i++)
{
element = seed_object_get_property_at_index (ctx, array, i, exception);
-
+
SEED_NOTE(MODULE, " Adding array element %u", i);
-
+
if (!seed_js_one_value_to_dbus (ctx, element, &array_iter,
&element_sig_iter, exception))
return FALSE;
@@ -564,7 +564,7 @@ append_array (SeedContext ctx,
static gboolean
append_dict (SeedContext ctx,
DBusMessageIter * iter,
- DBusSignatureIter * sig_iter,
+ DBusSignatureIter * sig_iter,
SeedObject props,
SeedException *exception)
{
@@ -657,7 +657,7 @@ append_dict (SeedContext ctx,
"Specifying _dbus_signatures for a dictionary with non-variant values is useless");
return FALSE;
}
-
+
prop_names = seed_object_copy_property_names (ctx, props);
num_props = g_strv_length (prop_names);
@@ -681,7 +681,7 @@ append_dict (SeedContext ctx,
if (!seed_value_is_undefined (ctx, prop_signatures))
{
SeedValue signature_value;
-
+
signature_value = seed_object_get_property (ctx, prop_signatures, name);
if (!seed_value_is_undefined (ctx, signature_value))
{
@@ -745,7 +745,7 @@ append_dict (SeedContext ctx,
}
dbus_message_iter_close_container (&dict_iter, &entry_iter);
-
+
next:
continue;
}
@@ -775,7 +775,7 @@ seed_js_one_value_to_dbus (SeedContext ctx,
/* Don't write anything on the bus if the signature is empty */
if (forced_type == DBUS_TYPE_INVALID)
return TRUE;
-
+
type = seed_value_get_type (ctx, value);
if (seed_value_is_null (ctx, value))
@@ -894,19 +894,19 @@ gboolean
seed_js_values_to_dbus (SeedContext ctx,
int index,
SeedObject values,
- DBusMessageIter * iter,
+ DBusMessageIter * iter,
DBusSignatureIter * sig_iter,
SeedException *exception)
{
SeedValue value;
guint length;
- length = seed_value_to_int (ctx,
+ length = seed_value_to_int (ctx,
seed_object_get_property (ctx, values, "length"),
exception);
if (index > (int) length)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Index %d is bigger than array length %d", index,
length);
return FALSE;
@@ -914,7 +914,7 @@ seed_js_values_to_dbus (SeedContext ctx,
if (index == (int) length)
return TRUE;
-
+
value = seed_object_get_property_at_index (ctx, values, index, exception);
if (!seed_js_one_value_to_dbus (ctx, value, iter, sig_iter, exception))
@@ -945,7 +945,7 @@ seed_js_add_dbus_props (SeedContext ctx, DBusMessage * message, SeedValue value,
return TRUE;
sender = (gchar *)dbus_message_get_sender (message);
-
+
seed_object_set_property (ctx, value, "_dbus_sender",
seed_value_from_string (ctx, sender, exception));
diff --git a/modules/dbus/module.c b/modules/dbus/module.c
index 6422078..d635540 100644
--- a/modules/dbus/module.c
+++ b/modules/dbus/module.c
@@ -72,7 +72,7 @@ prepare_call (SeedContext ctx,
SeedObject arg_array,
guint argc,
const SeedValue * argv,
- DBusBusType bus_type,
+ DBusBusType bus_type,
SeedException * exception)
{
DBusMessage *message;
@@ -778,7 +778,7 @@ seed_js_dbus_emit_signal(SeedContext ctx,
const char *in_signature;
DBusBusType bus_type;
- if (argument_count < 4)
+ if (argument_count < 4)
{
seed_make_exception(ctx, exception, "ArgumentError", "Not enough args, need object path, interface and signal and the arguments");
return seed_make_null (ctx);
@@ -816,7 +816,7 @@ seed_js_dbus_emit_signal(SeedContext ctx,
dbus_signature_iter_init(&sig_iter, in_signature);
- if (!seed_js_values_to_dbus(ctx, 0, arguments[4], &arg_iter, &sig_iter, exception))
+ if (!seed_js_values_to_dbus(ctx, 0, arguments[4], &arg_iter, &sig_iter, exception))
{
dbus_message_unref(message);
return seed_make_null (ctx);
@@ -844,7 +844,7 @@ seed_js_dbus_call(SeedContext ctx,
DBusBusType bus_type;
SeedValue retval;
- if (argument_count < 8)
+ if (argument_count < 8)
{
seed_make_exception(ctx, exception, "ArgumentError",
"Not enough args, need bus name, object path, interface, method, out signature, in signature, autostart flag, and args");
@@ -906,7 +906,7 @@ on_name_acquired(DBusConnection *connection,
seed_closure_invoke_with_context(ctx, owner->acquired_closure,
argv, argc, &exception);
-
+
seed_context_unref (ctx);
}
@@ -939,7 +939,7 @@ on_name_lost(DBusConnection *connection,
seed_closure_invoke_with_context(ctx, owner->lost_closure,
argv, argc, &exception);
-
+
seed_context_unref (ctx);
}
@@ -980,9 +980,9 @@ seed_js_dbus_acquire_name(SeedContext ctx,
BigDBusNameType name_type;
unsigned int id;
- if (argument_count < 4)
+ if (argument_count < 4)
{
- seed_make_exception (ctx, exception, "ArgumentError",
+ seed_make_exception (ctx, exception, "ArgumentError",
"Not enough args, need bus name, name type, acquired_func, lost_func");
return seed_make_null (ctx);
}
@@ -993,8 +993,8 @@ seed_js_dbus_acquire_name(SeedContext ctx,
name_type = (BigDBusNameType)seed_value_to_int (ctx, arguments[1], exception);
- if (!seed_value_is_object (ctx, arguments[2]) ||
- !seed_value_is_function (ctx, arguments[2]))
+ if (!seed_value_is_object (ctx, arguments[2]) ||
+ !seed_value_is_function (ctx, arguments[2]))
{
seed_make_exception (ctx, exception, "ArgumentError",
"Third arg is a callback to invoke on acquiring the name");
@@ -1003,8 +1003,8 @@ seed_js_dbus_acquire_name(SeedContext ctx,
acquire_func = arguments[2];
- if (!seed_value_is_object (ctx, arguments[3]) ||
- !seed_value_is_function (ctx, arguments[3]))
+ if (!seed_value_is_object (ctx, arguments[3]) ||
+ !seed_value_is_function (ctx, arguments[3]))
{
seed_make_exception (ctx, exception, "ArgumentError",
"Fourth arg is a callback to invoke on acquiring the name");
@@ -1054,13 +1054,13 @@ seed_js_dbus_release_name_by_id (SeedContext ctx,
DBusBusType bus_type;
unsigned int id;
- if (argument_count < 1)
+ if (argument_count < 1)
{
- seed_make_exception (ctx, exception,
+ seed_make_exception (ctx, exception,
"ArgumentError", "Not enough args, need name owner monitor id");
return seed_make_null (ctx);
}
-
+
bus_type = get_bus_type_from_object(ctx, this_object, exception);
id = seed_value_to_int (ctx, arguments[0], exception);
@@ -1102,7 +1102,7 @@ on_name_appeared(DBusConnection *connection,
seed_closure_invoke_with_context (ctx, watcher->appeared_closure,
argv, argc, &exception);
// TODO: Do something with exception.
-
+
seed_context_unref (ctx);
}
@@ -1132,7 +1132,7 @@ on_name_vanished(DBusConnection *connection,
seed_closure_invoke_with_context (ctx, watcher->vanished_closure,
argv, argc, &exception);
// TODO: Do something with exception.
-
+
seed_context_unref (ctx);
}
@@ -1180,9 +1180,9 @@ seed_js_dbus_watch_name(SeedContext ctx,
BigJSDBusNameWatcher *watcher;
DBusBusType bus_type;
- if (argument_count < 4)
+ if (argument_count < 4)
{
- seed_make_exception (ctx, exception,
+ seed_make_exception (ctx, exception,
"ArgumentError", "Not enough args, need bus name, acquired_func, lost_func");
return seed_make_null (ctx);
}
@@ -1247,13 +1247,13 @@ unique_name_getter (SeedContext ctx,
{
DBusConnection *bus_connection;
DBusBusType bus_type;
-
+
bus_type = get_bus_type_from_object (ctx, object, exception);
-
+
bus_check (ctx, bus_type, exception);
-
+
bus_connection = DBUS_CONNECTION_FROM_TYPE (bus_type);
-
+
if (bus_connection == NULL)
{
return seed_make_null (ctx);
@@ -1279,7 +1279,7 @@ seed_js_dbus_start_service(SeedContext ctx,
DBusBusType bus_type;
DBusConnection *bus_connection;
- if (argument_count != 1)
+ if (argument_count != 1)
{
seed_make_exception (ctx, exception, "ArgumentError",
"Wrong number of arguments, expected service name");
@@ -1379,7 +1379,7 @@ define_bus_object (SeedContext ctx,
{
SeedObject bus_obj;
const gchar *bus_name;
-
+
bus_name = BIG_DBUS_NAME_FROM_TYPE(which_bus);
bus_obj = seed_make_object (ctx, dbus_bus_class, NULL);
seed_object_set_property (ctx, bus_obj, "_dbusBusType",
@@ -1410,7 +1410,7 @@ seed_module_init (SeedEngine * eng)
dbus_namespace_class_def.class_name = "dbusnative";
dbus_namespace_class_def.static_functions = dbus_funcs;
dbus_namespace_class_def.static_values = dbus_values;
-
+
dbus_bus_class_def.class_name = "dbusbus";
dbus_bus_class_def.static_functions = bus_funcs;
dbus_bus_class_def.static_values = bus_values;
diff --git a/modules/gettext/gettext.c b/modules/gettext/gettext.c
index b0e80c6..e010f33 100644
--- a/modules/gettext/gettext.c
+++ b/modules/gettext/gettext.c
@@ -20,21 +20,21 @@ seed_gettext_i18n (SeedContext ctx,
if (argument_count != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
- "gettext.i18n expected 1 argument, got %zd",
+ seed_make_exception (ctx, exception, "ArgumentError",
+ "gettext.i18n expected 1 argument, got %zd",
argument_count);
return seed_make_null (ctx);
}
-
+
string_to_translate = seed_value_to_string (ctx, arguments[0], exception);
-
- return seed_value_from_string (ctx, _(string_to_translate), exception);
+
+ return seed_value_from_string (ctx, _(string_to_translate), exception);
}
static void
seed_gettext_define_stuff ()
{
- seed_create_function(eng->context, "i18n",
+ seed_create_function(eng->context, "i18n",
(SeedFunctionCallback) seed_gettext_i18n,
namespace_ref);
}
diff --git a/modules/gtkbuilder/gtkbuilder.c b/modules/gtkbuilder/gtkbuilder.c
index 3362ef5..3ffda21 100644
--- a/modules/gtkbuilder/gtkbuilder.c
+++ b/modules/gtkbuilder/gtkbuilder.c
@@ -27,11 +27,11 @@ seed_builder_connect_func (GtkBuilder *builder,
func = seed_object_get_property (ctx, obj, handler_name);
if (!seed_value_is_object (ctx, func) || !seed_value_is_function (ctx, func))
return;
-
+
closure = seed_closure_new (ctx, func, priv->user_data, "signal handler (GtkBuilder)");
if (connect_object != NULL)
g_object_watch_closure (connect_object, closure);
-
+
g_signal_connect_closure (object, signal_name, closure, FALSE);
}
@@ -45,14 +45,14 @@ seed_gtk_builder_connect_signals(SeedContext ctx,
{
builder_ud ud;
GtkBuilder *b;
-
+
if (!seed_value_is_object (ctx, arguments[0]))
{
seed_make_exception (ctx, exception, "ArgumentError",
"connect_signals expects one object as an argument");
return seed_make_undefined (ctx);
}
-
+
b = GTK_BUILDER (seed_value_to_object (ctx, this_object, exception));
ud.ctx = ctx;
ud.obj = arguments[0];
@@ -61,7 +61,7 @@ seed_gtk_builder_connect_signals(SeedContext ctx,
else
ud.user_data = NULL;
gtk_builder_connect_signals_full(b, seed_builder_connect_func, &ud);
-
+
return seed_make_undefined (ctx);
}
@@ -69,12 +69,12 @@ SeedObject
seed_module_init(SeedEngine *eng)
{
SeedObject gtkbuilder_proto;
-
+
gtkbuilder_proto = seed_simple_evaluate (eng->context,
"imports.gi.Gtk.Builder.prototype",
NULL);
seed_create_function (eng->context,
- "connect_signals",
+ "connect_signals",
seed_gtk_builder_connect_signals,
gtkbuilder_proto);
diff --git a/modules/libxml/libxml.c b/modules/libxml/libxml.c
index 99cb1ea..2f140fd 100644
--- a/modules/libxml/libxml.c
+++ b/modules/libxml/libxml.c
@@ -22,7 +22,7 @@ SeedClass xml_xpathobj_class;
#define XML_XPATHOBJ_PRIV(obj) ((xmlXPathObjectPtr)seed_object_get_private (obj))
static SeedObject
-seed_make_xml_doc (SeedContext ctx,
+seed_make_xml_doc (SeedContext ctx,
xmlDocPtr doc)
{
SeedObject ret;
@@ -34,7 +34,7 @@ seed_make_xml_doc (SeedContext ctx,
}
static SeedObject
-seed_make_xml_node (SeedContext ctx,
+seed_make_xml_node (SeedContext ctx,
xmlNodePtr node)
{
SeedObject ret;
@@ -71,10 +71,10 @@ seed_xml_element_type_to_string (xmlElementType type)
else if (type == XML_TEXT_NODE)
return "text";
else
- return "Implement more types! racarr is lazy.";
+ return "Implement more types! racarr is lazy.";
}
-static SeedValue
+static SeedValue
seed_xml_parse_file (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -107,7 +107,7 @@ seed_xml_parse_file (SeedContext ctx,
return ret;
}
-static SeedValue
+static SeedValue
seed_xml_parse_string (SeedContext ctx,
SeedObject function,
SeedObject this_object,
@@ -174,7 +174,7 @@ seed_xml_node_get_children (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_node (ctx, node->children);
}
@@ -186,7 +186,7 @@ seed_xml_node_get_parent (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_node (ctx, node->parent);
}
@@ -197,7 +197,7 @@ seed_xml_node_get_next (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_node (ctx, node->next);
}
@@ -208,7 +208,7 @@ seed_xml_node_get_prev (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_node (ctx, node->prev);
}
@@ -219,7 +219,7 @@ seed_xml_node_get_last (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_node (ctx, node->last);
}
@@ -230,7 +230,7 @@ seed_xml_node_get_doc (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_doc (ctx, node->doc);
}
@@ -243,11 +243,11 @@ seed_xml_node_get_content (SeedContext ctx,
SeedValue ret;
gchar *content;
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
content = xmlNodeGetContent (node);
ret = seed_value_from_string (ctx, content, exception);
g_free (content);
-
+
return ret;
}
@@ -258,9 +258,9 @@ seed_xml_node_get_type (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
- return seed_value_from_string (ctx,
- seed_xml_element_type_to_string
+
+ return seed_value_from_string (ctx,
+ seed_xml_element_type_to_string
(node->type), exception);
}
@@ -271,7 +271,7 @@ seed_xml_node_get_properties (SeedContext ctx,
SeedException *exception)
{
xmlNodePtr node = XML_NODE_PRIV (object);
-
+
return seed_make_xml_attr (ctx, node->properties);
}
@@ -307,10 +307,10 @@ seed_xml_xpath_eval (SeedContext ctx,
xmlXPathObjectPtr xpath_obj;
xmlXPathContextPtr xpath_ctx;
gchar *xpath;
-
+
if (argument_count != 1)
{
- seed_make_exception (ctx, exception,
+ seed_make_exception (ctx, exception,
"ArgumentError",
"xpathEval expected 1 argument, got %zd",
argument_count);
@@ -321,7 +321,7 @@ seed_xml_xpath_eval (SeedContext ctx,
xpath = seed_value_to_string (ctx, arguments[0], exception);
xpath_obj = xmlXPathEval (xpath, xpath_ctx);
g_free (xpath);
-
+
return seed_make_object (ctx, xml_xpathobj_class, xpath_obj);
}
@@ -346,12 +346,12 @@ seed_xml_xpath_register_ns (SeedContext ctx,
xpath = XML_XPATH_PRIV (this_object);
prefix = seed_value_to_string (ctx, arguments[0], exception);
ns_uri = seed_value_to_string (ctx, arguments[1], exception);
-
+
xmlXPathRegisterNs (xpath, prefix, ns_uri);
g_free (prefix);
g_free (ns_uri);
-
- return seed_make_undefined (ctx);
+
+ return seed_make_undefined (ctx);
}
static SeedValue
@@ -364,12 +364,12 @@ seed_xml_construct_xpath_context (SeedContext ctx,
{
xmlXPathContextPtr xpath;
xmlDocPtr doc;
-
+
doc = XML_DOC_PRIV (this_object);
xpath = xmlXPathNewContext (doc);
-
+
seed_value_protect (ctx, this_object);
-
+
return seed_make_object (ctx, xml_xpath_class, xpath);
}
@@ -521,27 +521,27 @@ seed_libxml_define_stuff ()
xml_attr_class_def.finalize = seed_xml_node_finalize;
xml_attr_class_def.initialize = seed_xml_node_init;
xml_attr_class = seed_create_class (&xml_attr_class_def);
-
+
xml_xpath_class_def.class_name = "XMLXPathContext";
xml_xpath_class_def.finalize = seed_xml_xpath_finalize;
xml_xpath_class_def.static_functions = xpath_funcs;
xml_xpath_class = seed_create_class (&xml_xpath_class_def);
-
+
xml_xpathobj_class_def.class_name = "XMLXPathObj";
xml_xpathobj_class_def.finalize = seed_xml_xpathobj_finalize;
xml_xpathobj_class_def.static_values = xpathobj_values;
xml_xpathobj_class = seed_create_class (&xml_xpathobj_class_def);
-
- seed_create_function (eng->context, "parseFile",
+
+ seed_create_function (eng->context, "parseFile",
(SeedFunctionCallback) seed_xml_parse_file,
namespace_ref);
- seed_create_function (eng->context, "parseString",
+ seed_create_function (eng->context, "parseString",
(SeedFunctionCallback) seed_xml_parse_string,
namespace_ref);
node_proto = seed_object_get_prototype (eng->context,
- seed_make_object (eng->context,
- xml_node_class,
+ seed_make_object (eng->context,
+ xml_node_class,
NULL));
seed_make_object (eng->context, xml_node_class, NULL);
seed_object_set_property (eng->context, namespace_ref, "_nodeProto", node_proto);
@@ -554,7 +554,7 @@ seed_module_init(SeedEngine *local_eng)
eng = local_eng;
namespace_ref = seed_make_object (eng->context, NULL, NULL);
seed_value_protect (eng->context, namespace_ref);
-
+
seed_libxml_define_stuff();
return namespace_ref;
diff --git a/modules/os/os.c b/modules/os/os.c
index 268f53b..161a575 100644
--- a/modules/os/os.c
+++ b/modules/os/os.c
@@ -32,12 +32,12 @@ seed_os_chdir (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gchar *arg;
gint ret;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.chdir", "1 argument");
@@ -45,7 +45,7 @@ seed_os_chdir (SeedContext ctx,
arg = seed_value_to_string (ctx, arguments[0], exception);
ret = chdir (arg);
g_free (arg);
-
+
return seed_value_from_int (ctx, ret, exception);
}
@@ -54,18 +54,18 @@ seed_os_fchdir (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint ret, arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.fchdir", "1 argument");
}
arg = seed_value_to_int (ctx, arguments[0], exception);
ret = fchdir (arg);
-
+
return seed_value_from_int (ctx, ret, exception);
}
@@ -74,12 +74,12 @@ seed_os_getcwd (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue seed_ret;
gchar *ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getcwd", "no arguments");
@@ -87,7 +87,7 @@ seed_os_getcwd (SeedContext ctx,
ret = getcwd (NULL, 0);
seed_ret = seed_value_from_string (ctx, ret, exception);
g_free (ret);
-
+
return seed_ret;
}
@@ -96,12 +96,12 @@ seed_os_ctermid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue seed_ret;
gchar *ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getcwd", "no arguments");
@@ -109,7 +109,7 @@ seed_os_ctermid (SeedContext ctx,
// ctermid returns a static buffer
ret = ctermid (NULL);
seed_ret = seed_value_from_string (ctx, ret, exception);
-
+
return seed_ret;
}
@@ -118,11 +118,11 @@ seed_os_getegid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gid_t ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getegid", "no arguments");
@@ -137,11 +137,11 @@ seed_os_geteuid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
uid_t ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.geteuid", "no arguments");
@@ -156,12 +156,12 @@ seed_os_getgid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue seed_ret;
gid_t ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getgid", "no arguments");
@@ -176,11 +176,11 @@ seed_os_getuid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
uid_t ret;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getuid", "no arguments");
@@ -195,14 +195,14 @@ seed_os_getgroups (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
SeedValue *groups;
gid_t *group_list;
guint num_groups, i;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getgroups", "no arguments");
@@ -216,7 +216,7 @@ seed_os_getgroups (SeedContext ctx,
// Investigate python
return seed_make_null (ctx);
}
-
+
for (i = 0; i < num_groups; i++)
{
groups[i] = seed_value_from_long (ctx, (glong) group_list[i], exception);
@@ -231,7 +231,7 @@ seed_os_getlogin (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
if (argument_count != 0)
@@ -247,7 +247,7 @@ seed_os_getpgid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
pid_t pid;
@@ -256,7 +256,7 @@ seed_os_getpgid (SeedContext ctx,
EXPECTED_EXCEPTION("os.getpgid", "1 argument");
}
pid = (pid_t) seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_long (ctx, (glong) getpgid(pid), exception);
}
@@ -265,14 +265,14 @@ seed_os_getpgrp (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getpgrp", "no arguments");
}
-
+
return seed_value_from_long (ctx, (glong) getpgrp(), exception);
}
@@ -281,14 +281,14 @@ seed_os_getpid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getpid", "no arguments");
}
-
+
return seed_value_from_long (ctx, (glong) getpid(), exception);
}
@@ -297,14 +297,14 @@ seed_os_getppid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.getppid", "no arguments");
}
-
+
return seed_value_from_long (ctx, (glong) getppid(), exception);
}
@@ -313,7 +313,7 @@ seed_os_getenv (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -326,7 +326,7 @@ seed_os_getenv (SeedContext ctx,
value = getenv (name);
ret = seed_value_from_string (ctx, value, exception);
g_free (name);
-
+
return ret;
}
@@ -335,12 +335,12 @@ seed_os_putenv (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint ret;
gchar *name, *value, *arg;
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("os.putenv", "2 arguments");
@@ -348,12 +348,12 @@ seed_os_putenv (SeedContext ctx,
name = seed_value_to_string (ctx, arguments[0], exception);
value = seed_value_to_string (ctx, arguments[1], exception);
arg = g_strconcat (name, "=", value, NULL);
-
+
ret = putenv (arg);
-
+
g_free (name);
g_free (value);
-
+
return seed_value_from_int (ctx, ret, exception);
}
@@ -363,17 +363,17 @@ seed_os_setegid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gid_t arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.setegid", "1 argument");
}
arg = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, setegid(arg), exception);
}
@@ -382,17 +382,17 @@ seed_os_setgid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gid_t arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.setgid", "1 argument");
}
arg = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, setgid(arg), exception);
}
@@ -401,17 +401,17 @@ seed_os_seteuid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
uid_t arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.seteuid", "1 argument");
}
arg = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, seteuid(arg), exception);
}
@@ -420,17 +420,17 @@ seed_os_setuid (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
uid_t arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.setuid", "1 argument");
}
arg = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, setuid(arg), exception);
}
@@ -439,17 +439,17 @@ seed_os_strerror (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
int arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.strerror", "1 argument");
}
arg = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_string (ctx, strerror(arg), exception);
}
@@ -458,17 +458,17 @@ seed_os_umask (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
mode_t arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.umask", "1 argument");
}
arg = seed_value_to_long (ctx, arguments[0], exception);
-
+
return seed_value_from_long (ctx, umask(arg), exception);
}
@@ -477,13 +477,13 @@ seed_os_uname (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue elements[5], ret;
guint c;
struct utsname name;
-
+
if (argument_count != 0)
{
EXPECTED_EXCEPTION("os.uname", "no arguments");
@@ -496,8 +496,8 @@ seed_os_uname (SeedContext ctx,
elements[3] = seed_value_from_string (ctx, name.version, exception);
elements[4] = seed_value_from_string (ctx, name.machine, exception);
ret = seed_make_array (ctx, elements, 5, exception);
-
-
+
+
return ret;
}
@@ -507,7 +507,7 @@ seed_os_unsetenv (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint ret;
@@ -517,7 +517,7 @@ seed_os_unsetenv (SeedContext ctx,
{
EXPECTED_EXCEPTION("os.unsetenv", "1 argument");
}
-
+
arg = seed_value_to_string (ctx, arguments[0], exception);
ret = unsetenv (arg);
g_free (arg);
@@ -530,7 +530,7 @@ seed_os_open (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gchar *path;
@@ -540,13 +540,13 @@ seed_os_open (SeedContext ctx,
{
EXPECTED_EXCEPTION("os.open", "2 arguments");
}
-
+
path = seed_value_to_string (ctx, arguments[0], exception);
flags = seed_value_to_int (ctx, arguments[1], exception);
-
+
ret = open (path, flags);
g_free (path);
-
+
return seed_value_from_int (ctx, ret, exception);
}
@@ -555,18 +555,18 @@ seed_os_close (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.close", "2 arguments");
}
-
+
arg = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, close (arg), exception);
}
@@ -575,18 +575,18 @@ seed_os_dup (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint arg;
-
+
if (argument_count != 1)
{
EXPECTED_EXCEPTION("os.dup", "1 argument");
}
-
+
arg = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, dup (arg), exception);
}
SeedValue
@@ -594,19 +594,19 @@ seed_os_dup2 (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint arg, arg2;
-
+
if (argument_count != 2)
{
EXPECTED_EXCEPTION("os.dup2", "2 arguments");
}
-
+
arg = seed_value_to_int (ctx, arguments[0], exception);
arg2 = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, dup2 (arg, arg2), exception);
}
@@ -615,7 +615,7 @@ seed_os_fchmod (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd;
@@ -627,7 +627,7 @@ seed_os_fchmod (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
mode = seed_value_to_long (ctx, arguments[1], exception);
-
+
return seed_value_from_int (ctx, fchmod (fd, mode), exception);
}
@@ -636,7 +636,7 @@ seed_os_fchown (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd;
@@ -650,7 +650,7 @@ seed_os_fchown (SeedContext ctx,
fd = seed_value_to_int (ctx, arguments[0], exception);
uid = seed_value_to_long (ctx, arguments[1], exception);
gid = seed_value_to_long (ctx, arguments[2], exception);
-
+
return seed_value_from_int (ctx, fchown (fd, uid, gid), exception);
}
@@ -659,7 +659,7 @@ seed_os_fdatasync (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd;
@@ -669,7 +669,7 @@ seed_os_fdatasync (SeedContext ctx,
EXPECTED_EXCEPTION ("os.fdatasync", "1 argument");
}
fd = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_int (ctx, fdatasync (fd), exception);
}
@@ -678,7 +678,7 @@ seed_os_fpathconf (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd, name;
@@ -689,7 +689,7 @@ seed_os_fpathconf (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
name = seed_value_to_int (ctx, arguments[1], exception);
-
+
return seed_value_from_long (ctx, fpathconf (fd, name), exception);
}
@@ -698,7 +698,7 @@ seed_os_fsync (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd, name;
@@ -708,7 +708,7 @@ seed_os_fsync (SeedContext ctx,
EXPECTED_EXCEPTION ("os.fsync", "1 argument");
}
fd = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_long (ctx, fsync (fd), exception);
}
@@ -717,7 +717,7 @@ seed_os_ftruncate (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd;
@@ -729,7 +729,7 @@ seed_os_ftruncate (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
length = seed_value_to_int (ctx, arguments[1], exception);
-
+
return seed_value_from_long (ctx, ftruncate (fd, length), exception);
}
@@ -738,7 +738,7 @@ seed_os_isatty (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd;
@@ -748,7 +748,7 @@ seed_os_isatty (SeedContext ctx,
EXPECTED_EXCEPTION ("os.isatty", "1 argument");
}
fd = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_boolean (ctx, isatty (fd), exception);
}
@@ -757,7 +757,7 @@ seed_os_lseek (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
gint fd, whence;
@@ -770,7 +770,7 @@ seed_os_lseek (SeedContext ctx,
fd = seed_value_to_int (ctx, arguments[0], exception);
offset = seed_value_to_long (ctx, arguments[1], exception);
whence = seed_value_to_int (ctx, arguments[2], exception);
-
+
return seed_value_from_long (ctx, lseek (fd, offset, whence), exception);
}
@@ -779,7 +779,7 @@ seed_os_openpty (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue fds[2], ret;
@@ -790,12 +790,12 @@ seed_os_openpty (SeedContext ctx,
EXPECTED_EXCEPTION ("os.openpty", "no arguments");
}
openpty (&master, &slave, NULL, NULL, NULL);
-
+
fds[0] = seed_value_from_int (ctx, master, exception);
fds[1] = seed_value_from_int (ctx, slave, exception);
-
+
ret = seed_make_array (ctx, fds, 2, exception);
-
+
return ret;
}
@@ -804,7 +804,7 @@ seed_os_pipe (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue fds[2], ret;
@@ -818,12 +818,12 @@ seed_os_pipe (SeedContext ctx,
{
// TODO
}
-
+
fds[0] = seed_value_from_int (ctx, fildes[0], exception);
fds[1] = seed_value_from_int (ctx, fildes[1], exception);
-
+
ret = seed_make_array (ctx, fds, 2, exception);
-
+
return ret;
}
@@ -832,7 +832,7 @@ seed_os_read (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -845,7 +845,7 @@ seed_os_read (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
n = seed_value_to_int (ctx, arguments[1], exception);
-
+
buf = g_alloca (n * sizeof (gchar));
nr = read (fd, buf, n);
buf[nr] = '\0';
@@ -854,7 +854,7 @@ seed_os_read (SeedContext ctx,
ret = seed_value_from_string (ctx, buf, exception);
else
ret = seed_make_null (ctx);
-
+
return ret;
}
@@ -863,7 +863,7 @@ seed_os_write (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -876,7 +876,7 @@ seed_os_write (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
buf = seed_value_to_string (ctx, arguments[1], exception);
-
+
nw = write (fd, buf, strlen (buf));
return seed_value_from_int (ctx, nw, exception);
@@ -887,7 +887,7 @@ seed_os_ttyname (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -898,7 +898,7 @@ seed_os_ttyname (SeedContext ctx,
EXPECTED_EXCEPTION ("os.ttyname", "1 argument");
}
fd = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_string (ctx, ttyname (fd), exception);
}
@@ -907,7 +907,7 @@ seed_os_tcgetpgrp (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -918,7 +918,7 @@ seed_os_tcgetpgrp (SeedContext ctx,
EXPECTED_EXCEPTION ("os.tcgetpgrp", "1 argument");
}
fd = seed_value_to_int (ctx, arguments[0], exception);
-
+
return seed_value_from_long (ctx, tcgetpgrp (fd), exception);
}
@@ -927,7 +927,7 @@ seed_os_tcsetpgrp (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedValue ret;
@@ -940,7 +940,7 @@ seed_os_tcsetpgrp (SeedContext ctx,
}
fd = seed_value_to_int (ctx, arguments[0], exception);
pgrp = seed_value_to_int (ctx, arguments[1], exception);
-
+
return seed_value_from_int (ctx, tcsetpgrp (fd, pgrp), exception);
}
@@ -949,7 +949,7 @@ seed_os_access (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
int ret;
@@ -962,9 +962,9 @@ seed_os_access (SeedContext ctx,
}
path = seed_value_to_string (ctx, arguments[0], exception);
amd = seed_value_to_int (ctx, arguments[1], exception);
-
+
ret = access (path, amd);
-
+
if (ret == 0)
return seed_value_from_boolean (ctx, TRUE, exception);
else
@@ -980,7 +980,7 @@ seed_os_fork (SeedContext ctx,
SeedException *exception)
{
pid_t t = fork();
-
+
return seed_value_from_long (ctx, t, exception);
}
@@ -1043,12 +1043,12 @@ seed_module_init(SeedEngine * eng)
{
SeedClass os_namespace_class;
seed_class_definition os_namespace_class_definition = seed_empty_class;
-
+
os_namespace_class_definition.static_functions = os_funcs;
os_namespace_class = seed_create_class (&os_namespace_class_definition);
os_namespace = seed_make_object (eng->context, os_namespace_class, NULL);
-
+
OS_DEFINE_QUICK_ENUM (O_RDONLY);
OS_DEFINE_QUICK_ENUM (O_WRONLY);
OS_DEFINE_QUICK_ENUM (O_RDWR);
@@ -1084,7 +1084,7 @@ seed_module_init(SeedEngine * eng)
OS_DEFINE_QUICK_ENUM (SEEK_SET);
OS_DEFINE_QUICK_ENUM (SEEK_CUR);
OS_DEFINE_QUICK_ENUM (SEEK_END);
-
+
OS_DEFINE_QUICK_ENUM (F_OK);
OS_DEFINE_QUICK_ENUM (R_OK);
OS_DEFINE_QUICK_ENUM (W_OK);
diff --git a/modules/readline/seed-readline.c b/modules/readline/seed-readline.c
index 29d58b6..6134a9a 100644
--- a/modules/readline/seed-readline.c
+++ b/modules/readline/seed-readline.c
@@ -56,7 +56,7 @@ seed_readline_bind(SeedContext ctx,
if (argumentCount != 2)
{
- seed_make_exception(ctx, exception, "ArgumentError",
+ seed_make_exception(ctx, exception, "ArgumentError",
"Seed.readline_bind expected 2 arguments, "
"got %Zd", argumentCount);
return seed_make_null(ctx);
@@ -77,7 +77,7 @@ seed_rl_done(SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argumentCount,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedValue * exception)
{
rl_done = 1;
@@ -89,7 +89,7 @@ seed_rl_buffer(SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argumentCount,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedValue * exception)
{
return seed_value_from_string (ctx, rl_line_buffer, exception);
@@ -100,22 +100,22 @@ seed_rl_insert(SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argumentCount,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedValue * exception)
{
gchar *ins;
gint ret;
if (argumentCount != 1)
{
- seed_make_exception (ctx, exception, "ArgumentError",
- "readline.insert expected 1 argument, got %zd",
+ seed_make_exception (ctx, exception, "ArgumentError",
+ "readline.insert expected 1 argument, got %zd",
argumentCount);
return seed_make_null (ctx);
}
ins = seed_value_to_string (ctx, arguments[0], exception);
ret = rl_insert_text (ins);
g_free (ins);
-
+
return seed_value_from_int (ctx, ret, exception);
}
@@ -140,7 +140,7 @@ seed_readline(SeedContext ctx,
if (argumentCount != 1)
{
- seed_make_exception(ctx, exception, "ArgumentError",
+ seed_make_exception(ctx, exception, "ArgumentError",
"Seed.readline expected 1 argument, "
"got %Zd", argumentCount);
return seed_make_null(ctx);
diff --git a/modules/sandbox/sandbox.c b/modules/sandbox/sandbox.c
index 966ec91..edabbe6 100644
--- a/modules/sandbox/sandbox.c
+++ b/modules/sandbox/sandbox.c
@@ -14,10 +14,10 @@ seed_construct_sandbox_context (SeedContext ctx,
{
SeedObject ret;
SeedContext c;
-
+
c = seed_context_create (group, NULL);
ret = seed_make_object (ctx, context_class, c);
-
+
seed_object_set_property (ctx, ret, "global", seed_context_get_global_object (c));
return ret;
}
@@ -27,7 +27,7 @@ seed_context_eval (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedContext c = seed_object_get_private (this_object);
@@ -36,15 +36,15 @@ seed_context_eval (SeedContext ctx,
if (!c)
{
- seed_make_exception (ctx, exception,
+ seed_make_exception (ctx, exception,
"ArgumentError", "Context is destroyed");
return seed_make_undefined (ctx);
}
-
+
s = seed_value_to_string (ctx, arguments[0], exception);
ret = seed_simple_evaluate (c, s, exception);
g_free (s);
-
+
return ret;
}
@@ -53,13 +53,13 @@ seed_sandbox_context_add_globals (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedContext c = seed_object_get_private (this_object);
if (!c)
{
- seed_make_exception (ctx, exception,
+ seed_make_exception (ctx, exception,
"ArgumentError", "Context is destroyed");
return seed_make_undefined (ctx);
}
@@ -74,11 +74,11 @@ seed_sandbox_context_destroy (SeedContext ctx,
SeedObject function,
SeedObject this_object,
size_t argument_count,
- const SeedValue arguments[],
+ const SeedValue arguments[],
SeedException * exception)
{
SeedContext c = seed_object_get_private (this_object);
-
+
seed_context_unref (c);
seed_object_set_private (this_object, NULL);
return seed_make_null (ctx);
@@ -100,18 +100,18 @@ seed_module_init(SeedEngine * eng)
ctx = eng->context;
group = eng->group;
namespace_ref = seed_make_object (ctx, NULL, NULL);
-
+
context_class_def.class_name = "Context";
context_class_def.static_functions = context_funcs;
-
+
context_class = seed_create_class (&context_class_def);
-
-
+
+
context_constructor = seed_make_constructor (eng->context,
context_class,
seed_construct_sandbox_context);
seed_object_set_property (eng->context, namespace_ref, "Context", context_constructor);
-
+
return namespace_ref;
}
diff --git a/modules/sqlite/seed-sqlite.c b/modules/sqlite/seed-sqlite.c
index f940753..397404b 100644
--- a/modules/sqlite/seed-sqlite.c
+++ b/modules/sqlite/seed-sqlite.c
@@ -139,7 +139,7 @@ SeedValue seed_sqlite_exec(SeedContext ctx,
{
if (sqlite_error)
{
- seed_make_exception(ctx, exception, "SqliteError",
+ seed_make_exception(ctx, exception, "SqliteError",
sqlite_error, NULL);
sqlite3_free(sqlite_error);
}
@@ -193,6 +193,6 @@ seed_module_init(SeedEngine * local_eng)
sqlite_construct_database);
seed_object_set_property(eng->context,
namespace_ref, "Database", db_constructor);
-
+
return namespace_ref;
}
diff --git a/src/main.c b/src/main.c
index a0db963..5a64476 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,7 +52,7 @@ seed_exec (gint argc, gchar ** argv)
gchar *buffer;
g_file_get_contents (argv[1], &buffer, 0, 0);
-
+
if (!buffer)
{
g_critical ("File %s not found!", argv[1]);
@@ -75,7 +75,7 @@ seed_exec (gint argc, gchar ** argv)
seed_exception_get_line (eng->context, e));
exit (1);
}
-
+
global = seed_context_get_global_object (eng->context);
seed_importer_add_global (global, argv[1]);
diff --git a/tests/c/api-types.c b/tests/c/api-types.c
index 0b45f3b..fde3bf7 100644
--- a/tests/c/api-types.c
+++ b/tests/c/api-types.c
@@ -143,10 +143,10 @@ void basic_types(TestSimpleFixture * fixture, gconstpointer _data)
si[1] = seed_value_from_int (fixture->context, 1, NULL);
gint ni;
gchar *ns;
-
+
seed_value_to_format (fixture->context, "si", si, NULL, &ns, &ni, NULL);
g_assert (ni == 1);
g_assert (!strcmp(ns, "Hi"));
-
+
}
diff --git a/tests/javascript/enum.js b/tests/javascript/enum.js
index a9de117..8488d51 100755
--- a/tests/javascript/enum.js
+++ b/tests/javascript/enum.js
@@ -3,7 +3,7 @@
// STDIN:
// STDOUT:2
// STDERR:
-
+
Gtk = imports.gi.Gtk;
Gtk.init(Seed.argv);
diff --git a/tests/javascript/gdk-event.js b/tests/javascript/gdk-event.js
index 3b3c6e8..d88e19c 100755
--- a/tests/javascript/gdk-event.js
+++ b/tests/javascript/gdk-event.js
@@ -13,7 +13,7 @@ function paint(wdg, evt)
print(evt.expose.window);
print(wdg.window);
print(evt.expose.window === wdg.window);
-
+
print(evt.expose.area.width);
Gtk.main_quit();
diff --git a/tests/javascript/gtypes/gtype-class-init-exception.js b/tests/javascript/gtypes/gtype-class-init-exception.js
index 12f485c..2a10ad2 100755
--- a/tests/javascript/gtypes/gtype-class-init-exception.js
+++ b/tests/javascript/gtypes/gtype-class-init-exception.js
@@ -20,4 +20,4 @@ HelloWindowType = {
HelloWindow = new GType(HelloWindowType);
w = new HelloWindow();
-
+
diff --git a/tests/javascript/gtypes/gtype-extraprop.js b/tests/javascript/gtypes/gtype-extraprop.js
index 24f5488..c348588 100755
--- a/tests/javascript/gtypes/gtype-extraprop.js
+++ b/tests/javascript/gtypes/gtype-extraprop.js
@@ -18,4 +18,4 @@ HelloWindow = new GType(HelloWindowType);
w = new HelloWindow({test: 1});
w.show();
-
+
diff --git a/tests/javascript/gtypes/gtype-self.js b/tests/javascript/gtypes/gtype-self.js
index e95e380..542e8a3 100755
--- a/tests/javascript/gtypes/gtype-self.js
+++ b/tests/javascript/gtypes/gtype-self.js
@@ -18,4 +18,4 @@ HelloWindow = new GType(HelloWindowType);
w = new HelloWindow();
w.show();
-
+
diff --git a/tests/javascript/gtypes/gtype.js b/tests/javascript/gtypes/gtype.js
index b439eff..71b8103 100755
--- a/tests/javascript/gtypes/gtype.js
+++ b/tests/javascript/gtypes/gtype.js
@@ -30,4 +30,4 @@ w.signal.map.connect(
print("In map, verifying widget.title : " + widget.title);
});
w.show();
-
+
diff --git a/tests/javascript/introspect.js b/tests/javascript/introspect.js
index 84481e1..ddac59a 100755
--- a/tests/javascript/introspect.js
+++ b/tests/javascript/introspect.js
@@ -5,7 +5,7 @@
// STDERR:
Gtk = imports.gi.Gtk;
-JSON = imports.JSON;
+JSON = imports.JSON;
Gtk.init(Seed.argv);
win = new Gtk.Window();
diff --git a/tests/javascript/json.js b/tests/javascript/json.js
index b0f5aaa..db1d09a 100755
--- a/tests/javascript/json.js
+++ b/tests/javascript/json.js
@@ -13,4 +13,4 @@ object = JSON.parse(json);
json2 = JSON.stringify(object);
if (json != json2)
print("Failure");
-
+
diff --git a/tests/javascript/type-conversion.js b/tests/javascript/type-conversion.js
index 20e3f96..9a397c1 100755
--- a/tests/javascript/type-conversion.js
+++ b/tests/javascript/type-conversion.js
@@ -23,5 +23,5 @@ for ( i in tests )
{
print(e.message);
}
-
+
}
diff --git a/tests/make-test.py b/tests/make-test.py
index 4b9d28b..8faa89f 100755
--- a/tests/make-test.py
+++ b/tests/make-test.py
@@ -15,7 +15,7 @@ else:
os.system("chmod +x " + sys.argv[1])
(n,out,err) = os.popen3("./" + sys.argv[1])
-
+
if(test_in != ""):
n.write(test_in + "\004")
n.close()
diff --git a/tests/run-tests.py b/tests/run-tests.py
index d1e1eff..8c5ca73 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -28,20 +28,20 @@ for root, dirs, files in os.walk(os.path.join(mcwd,"javascript")):
test_in = test_code[2].replace("// STDIN:","").rstrip().replace("\\n","\n");
test_out = "^" + test_code[3].replace("// STDOUT:","").rstrip().replace("\\n","\n") + "$";
test_err = "^" + test_code[4].replace("// STDERR:","").rstrip().replace("\\n","\n") + "$";
-
+
p = subprocess.Popen(f, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True,
cwd=os.path.join(mcwd,"javascript"))
(out,err)=(p.stdout, p.stderr)
-
+
(run_out,run_err)=p.communicate(test_in + "\004")
run_out = run_out.rstrip()
run_err = run_err.rstrip()
-
+
out.close()
err.close()
-
+
if not re.match(test_out,run_out):
failed.append([filename,test_out,run_out,0,run_err])
sys.stdout.write("x")
@@ -100,4 +100,4 @@ for fail in failed:
print " Expected Retval:\t%d" % fail[1]
print " Actual Retval:\t%d" % fail[2]
if len(failed):
- print "---------------------------------------"
+ print "---------------------------------------"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]