on 2/26/05 3:19 PM, Ruslan Zasukhin at sunshine at public dot kherson dot ua
wrote:
> Hi All,
>
> http://www.realsoftware.com/feedback/viewreport.php?reportid=ccmjfdkx
>
> I have submit to REAL bugs another serious bug for
> plugins + interfaces are.
>
> Please averybody who use Valentina and other plugins
> And who develop plugins self add your vote.
>
> Thank you in advance :-)
Hmm, I wished you had provided the code here, but I took a look.
So the method declaration would be:
REALmethodDefinition _InterfaceMethods)[] = {
{ (REALproc)nil, REALnoImplementation, "OnDelete() as Integer" },
{ (REALproc)nil, REALnoImplementation, "OnDelete(Assigns inValue as
Integer)" },
};
I believe there are a couple of difficulties. One relates to what the
meaning would be of the return value. If the interface method is invoked by
a call to "REALInterfaceRoutine" RB will sequentially call all classes that
implement the interface something like:
long REALbasicInterfaceCallback(REALobject instance, REALclassDefinition
classDef, InterfaceMethodDefinition iDef, long value)
{
REALbasicData *rbData = (REALbasicData *)REALGetClassData(instance,
&classDef);
long (*fp)(REALobject, long);
InterfaceArray* content = rbData->InterfacesFirst;
long theReturnValue;
if (content != nil) {
do {
fp = (long (*)(REALobject, long))
REALInterfaceRoutine(content->self,
iDef.Interface, iDef.Method);
if (fp) {
theReturnValue = fp (content->self, value);
return theReturnValue;
}
content = content->next;
} while (content != nil);
}
}
The problem arises from the line that returns the "theReturnValue", which
means that the first class in the list of classes will be called, but the
others won't. So it seems to me that it is pointless to ask for Rb
recognizing the Assigns keyword. In addition, another problem is related to
the fact that there are no C-functions when the inteface is registered. The
old way to use a setter and getter like
REALmethodDefinition _InterfaceMethods)[] = {
{ (REALproc)nil, REALnoImplementation, "OnDelete(inValue as Integer) as
Integer" },
};
won't allow RB to know that both a getter and setter are meant. This is just
a minor point, The big caveat in returning a value as described above is
consistent with returning a return value in an event.
Does this make sense? "OnDelete() as Integer" seems to suggest that the
Interface is dependent on an action to be taken at system time, based on the
return value. An Event implementation would be better I guess.
Alfred
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|