From kde-perl Fri Jun 07 01:37:13 2002 From: Ashley Winters Date: Fri, 07 Jun 2002 01:37:13 +0000 To: kde-perl Subject: [Kde-perl] Smokin' X-MARC-Message: https://marc.info/?l=kde-perl&m=102421278314207 Now that I've about finished writing PerlQt, it's time to start the desig= n=20 phase. :) I'm working on separating the parts of PerlQt which need to be shared wit= h=20 PerlKDE and other child modules. An abstract SmokePerl class will define = the=20 interface which Smoke-based modules can all use to glue themselves. A poi= nter=20 to that abstract interface will be stored in a global Perl variable, prob= ably=20 ${'main::'}. The goal is to have really small, simple modules cons= ist=20 of about 2 lines of XS code. BOOT: smokePerlInterface()->registerSmoke("Qwt", init_Qwt_smoke(), "Qt"); // registerSmoke(moduleName, smokeObject, parentModuleName) PerlQt will end up consisting of the Qt::[a-z]+\.pm pragma implementation= ,=20 signals/slots, and the Qt-specific type handlers. SmokePerl, which will be included with PerlQt until someone wants it sepa= rated=20 (and I'm willing to freeze the interface), will have everything else. The= =20 type marshallers (virtual/regular/signal/slot method=20 arguments/return-values), the basic type handlers (int/double/class/...),= =20 copy-construction, object creation, pointer =3D> object mapping, method=20 calling, AUTOLOAD, etc. The Smoke::* structs will all get inline class wrappers. No Smoke::* stru= cture=20 can exist independently of its Smoke object, since there could be many Sm= oke=20 objects loaded. Each wrapper class will contain one Smoke::* element and = a=20 Smoke object. Smoke::Type has a SmokeType wrapper, Smoke::Class has=20 SmokeClass, etc. smokeperl_object becomes SmokeObject and gains some usef= ul=20 methods. They will hide all the complexity and data structures. ObKalyptusRequest: I don't know how I lasted so long without a flags field in Smoke::Class. = I=20 need to know what classes have overridden virtual destructors, so I know = when=20 to expect destructor callbacks. Currently, I use isa("QObject") ||=20 isa("QPaintDevice"). I would also like to know which classes have copy=20 constructors. I'll probably use another flag to mark classes which are li= sted=20 but not defined (like QWidget would be in SmokeKDE). David, can you add a flags field to smoke.h whenever Kalyptus generates i= t? + enum ClassFlags { +=09cf_constructor =3D 0x01,=09// has constructor +=09cf_deepcopy =3D 0x02,=09// has copy constructor +=09cf_virtual =3D 0x04,=09// has virtual destructor +=09cf_undefined =3D 0x10=09// defined elsewhere + }; struct Class { =09const char *className;=09// Name of the class =09Index parents;=09=09// Index into inheritanceList =09ClassFn classFn;=09// Calls any method in the class =09EnumFn enumFn;=09=09// Handles enum pointers +=09unsigned short flags;=09// ClassFlags }; I need to break binary compatibility while I still can! At least I don't have to write Apocalypses for PerlQt. I would not have=20 enjoyed writing A5. (http://www.perl.com/) Ashley Winters