Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Expose gd.Layout.moveLayer
Browse files Browse the repository at this point in the history
4ian committed Jun 17, 2017
1 parent bd33f60 commit 916c9cd
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Bindings/Bindings.idl
Original file line number Diff line number Diff line change
@@ -303,6 +303,7 @@ interface Layout {
void RemoveLayer([Const] DOMString name);
unsigned long GetLayersCount();
void SwapLayers(unsigned long firstLayerIndex, unsigned long secondLayerIndex);
void MoveLayer(unsigned long oldIndex, unsigned long newIndex);
void SerializeLayersTo([Ref] SerializerElement element);
void UnserializeLayersFrom([Const, Ref] SerializerElement element);

4 changes: 4 additions & 0 deletions Bindings/glue.cpp
Original file line number Diff line number Diff line change
@@ -132,6 +132,10 @@ void EMSCRIPTEN_KEEPALIVE emscripten_bind_Layout_SwapLayers_2(Layout* self, unsi
self->SwapLayers(arg0, arg1);
}

void EMSCRIPTEN_KEEPALIVE emscripten_bind_Layout_MoveLayer_2(Layout* self, unsigned int arg0, unsigned int arg1) {
self->MoveLayer(arg0, arg1);
}

void EMSCRIPTEN_KEEPALIVE emscripten_bind_Layout_SerializeLayersTo_1(Layout* self, SerializerElement* arg0) {
self->SerializeLayersTo(*arg0);
}
7 changes: 7 additions & 0 deletions Bindings/glue.js
Original file line number Diff line number Diff line change
@@ -280,6 +280,13 @@ Layout.prototype['SwapLayers'] = Layout.prototype.SwapLayers = function(arg0, ar
_emscripten_bind_Layout_SwapLayers_2(self, arg0, arg1);
};;

Layout.prototype['MoveLayer'] = Layout.prototype.MoveLayer = function(arg0, arg1) {
var self = this.ptr;
if (arg0 && typeof arg0 === 'object') arg0 = arg0.ptr;
if (arg1 && typeof arg1 === 'object') arg1 = arg1.ptr;
_emscripten_bind_Layout_MoveLayer_2(self, arg0, arg1);
};;

Layout.prototype['SerializeLayersTo'] = Layout.prototype.SerializeLayersTo = function(arg0) {
var self = this.ptr;
if (arg0 && typeof arg0 === 'object') arg0 = arg0.ptr;
2 changes: 2 additions & 0 deletions test/Core.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ describe('libGD.js', function(){
it('can return the version number of the library', function() {
expect(gd.VersionWrapper.major()).to.be.a("number");
expect(gd.VersionWrapper.minor()).to.be.a("number");
expect(gd.VersionWrapper.build()).to.be.a("number");
expect(gd.VersionWrapper.revision()).to.be.a("number");
expect(gd.VersionWrapper.fullString()).to.be.a("string");
});
});

0 comments on commit 916c9cd

Please sign in to comment.