Skip to content

Commit

Permalink
Add dummy ClipboardExtendedPlugin (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Feb 8, 2019
1 parent 73df774 commit f9ccf53
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package de.hpi.swa.graal.squeak.nodes.plugins;

import java.util.List;

import com.oracle.truffle.api.dsl.GenerateNodeFactory;
import com.oracle.truffle.api.dsl.NodeFactory;
import com.oracle.truffle.api.dsl.Specialization;

import de.hpi.swa.graal.squeak.exceptions.PrimitiveExceptions.PrimitiveFailed;
import de.hpi.swa.graal.squeak.model.CompiledMethodObject;
import de.hpi.swa.graal.squeak.model.PointersObject;
import de.hpi.swa.graal.squeak.nodes.primitives.AbstractPrimitiveFactoryHolder;
import de.hpi.swa.graal.squeak.nodes.primitives.AbstractPrimitiveNode;
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.BinaryPrimitive;
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.QuaternaryPrimitive;
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.TernaryPrimitive;
import de.hpi.swa.graal.squeak.nodes.primitives.PrimitiveInterfaces.UnaryPrimitiveWithoutFallback;
import de.hpi.swa.graal.squeak.nodes.primitives.SqueakPrimitive;

public final class ClipboardExtendedPlugin extends AbstractPrimitiveFactoryHolder {
@GenerateNodeFactory
@SqueakPrimitive(names = "ioAddClipboardData")
protected abstract static class PrimIOAddClipboardDataNode extends AbstractPrimitiveNode implements QuaternaryPrimitive {
protected PrimIOAddClipboardDataNode(final CompiledMethodObject method) {
super(method);
}

@SuppressWarnings("unused")
@Specialization
protected static final Object doAdd(final PointersObject receiver, final Object clipboard, final Object data, final Object dataFormat) {
throw new PrimitiveFailed(); // TODO: implement primitive
}
}

@GenerateNodeFactory
@SqueakPrimitive(names = "ioClearClipboard")
protected abstract static class PrimIOClearClipboardNode extends AbstractPrimitiveNode implements BinaryPrimitive {
protected PrimIOClearClipboardNode(final CompiledMethodObject method) {
super(method);
}

@SuppressWarnings("unused")
@Specialization
protected static final Object doClear(final PointersObject receiver, final Object clipboard) {
throw new PrimitiveFailed(); // TODO: implement primitive
}
}

@GenerateNodeFactory
@SqueakPrimitive(names = "ioCreateClipboard")
protected abstract static class PrimIOCreateClipboardNode extends AbstractPrimitiveNode implements UnaryPrimitiveWithoutFallback {
protected PrimIOCreateClipboardNode(final CompiledMethodObject method) {
super(method);
}

@Specialization
protected static final Object doCreate(@SuppressWarnings("unused") final Object receiver) {
throw new PrimitiveFailed(); // TODO: implement primitive
}
}

@GenerateNodeFactory
@SqueakPrimitive(names = "ioGetClipboardFormat")
protected abstract static class PrimIOGetClipboardFormatNode extends AbstractPrimitiveNode implements TernaryPrimitive {
protected PrimIOGetClipboardFormatNode(final CompiledMethodObject method) {
super(method);
}

@SuppressWarnings("unused")
@Specialization
protected static final Object doGet(final PointersObject receiver, final Object clipboard, final long formatNumber) {
throw new PrimitiveFailed(); // TODO: implement primitive
}
}

@GenerateNodeFactory
@SqueakPrimitive(names = "ioReadClipboardData")
protected abstract static class PrimIOReadClipboardDataNode extends AbstractPrimitiveNode implements TernaryPrimitive {
protected PrimIOReadClipboardDataNode(final CompiledMethodObject method) {
super(method);
}

@SuppressWarnings("unused")
@Specialization
protected static final Object doRead(final PointersObject receiver, final Object clipboard, final Object dataFormat) {
throw new PrimitiveFailed(); // TODO: implement primitive
}
}

@Override
public List<? extends NodeFactory<? extends AbstractPrimitiveNode>> getFactories() {
return ClipboardExtendedPluginFactory.getFactories();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import de.hpi.swa.graal.squeak.nodes.plugins.B2DPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.BMPReadWriterPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.BitBltPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.ClipboardExtendedPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.CroquetPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.DropPlugin;
import de.hpi.swa.graal.squeak.nodes.plugins.FilePlugin;
Expand Down Expand Up @@ -67,6 +68,7 @@ public final class PrimitiveNodeFactory {
new B2DPlugin(),
new BitBltPlugin(),
new BMPReadWriterPlugin(),
new ClipboardExtendedPlugin(),
new CroquetPlugin(),
new DropPlugin(),
new FilePlugin(),
Expand Down

0 comments on commit f9ccf53

Please sign in to comment.