[commit] r2111 - repair broken plugin translation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2111 - repair broken plugin translation

commits-3
 
Author: piumarta
Date: 2009-08-27 19:49:56 -0700 (Thu, 27 Aug 2009)
New Revision: 2111

Modified:
   trunk/platforms/unix/src/vm/intplugins/DropPlugin/DropPlugin.c
Log:
repair broken plugin translation

Modified: trunk/platforms/unix/src/vm/intplugins/DropPlugin/DropPlugin.c
===================================================================
--- trunk/platforms/unix/src/vm/intplugins/DropPlugin/DropPlugin.c 2009-08-27 09:18:25 UTC (rev 2110)
+++ trunk/platforms/unix/src/vm/intplugins/DropPlugin/DropPlugin.c 2009-08-28 02:49:56 UTC (rev 2111)
@@ -45,8 +45,8 @@
 #pragma export off
 static sqInt msg(char * s);
 static sqInt primitiveDndOutAcceptedType(void);
-static sqInt primitiveDndOutSend(sqInt bytes);
-static sqInt primitiveDndOutStart(sqInt types);
+static sqInt primitiveDndOutSend(void);
+static sqInt primitiveDndOutStart(void);
 #pragma export on
 EXPORT(sqInt) primitiveDropRequestFileHandle(void);
 EXPORT(sqInt) primitiveDropRequestFileName(void);
@@ -98,28 +98,54 @@
  fprintf(stderr, "\n%s: %s", moduleName, s);
 }
 
-static sqInt primitiveDndOutAcceptedType(void) {
- primitiveparameters("primitiveDndOutAcceptedType", "XXX UNTRANSLATABLE CONSTANT XXX");
- return sqDndOutAcceptedType();
+EXPORT(sqInt) primitiveDndOutAcceptedType(void) {
+ sqInt _return_value;
+
+ _return_value = sqDndOutAcceptedType();
+ if (interpreterProxy->failed()) {
+ return null;
+ }
+ interpreterProxy->popthenPush(1, _return_value);
+ return null;
 }
 
-static sqInt primitiveDndOutSend(sqInt bytes) {
-    sqInt nbytes;
+EXPORT(sqInt) primitiveDndOutSend(void) {
+ sqInt nbytes;
+ char *bytes;
 
- primitiveparameters("primitiveDndOutSend", "XXX UNTRANSLATABLE CONSTANT XXX");
- nbytes = interpreterProxy->slotSizeOf(cPtrAsOop(bytes));
+ interpreterProxy->success(interpreterProxy->isBytes(interpreterProxy->stackValue(0)));
+ bytes = ((char *) (interpreterProxy->firstIndexableField(interpreterProxy->stackValue(0))));
+ if (interpreterProxy->failed()) {
+ return null;
+ }
+ nbytes = interpreterProxy->slotSizeOf((oopForPointer( bytes ) - 4));
  sqDndOutSend(bytes, nbytes);
+ if (interpreterProxy->failed()) {
+ return null;
+ }
+ interpreterProxy->pop(1);
+ return null;
 }
 
 
 /* Start drag out session. Formats are types for the data separated with NULL. */
 
-static sqInt primitiveDndOutStart(sqInt types) {
-    sqInt ntypes;
+EXPORT(sqInt) primitiveDndOutStart(void) {
+ sqInt ntypes;
+ char *types;
 
- primitiveparameters("primitiveDndOutStart", "XXX UNTRANSLATABLE CONSTANT XXX");
- ntypes = interpreterProxy->slotSizeOf(cPtrAsOop(types));
+ interpreterProxy->success(interpreterProxy->isBytes(interpreterProxy->stackValue(0)));
+ types = ((char *) (interpreterProxy->firstIndexableField(interpreterProxy->stackValue(0))));
+ if (interpreterProxy->failed()) {
+ return null;
+ }
+ ntypes = interpreterProxy->slotSizeOf((oopForPointer( types ) - 4));
  sqDndOutStart(types, ntypes);
+ if (interpreterProxy->failed()) {
+ return null;
+ }
+ interpreterProxy->pop(1);
+ return null;
 }