[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-perl
Subject:    [Kde-perl] Smokin'
From:       Ashley Winters <qaqortog () nwlink ! com>
Date:       2002-06-07 1:37:13
[Download RAW message or body]

Now that I've about finished writing PerlQt, it's time to start the design 
phase. :)

I'm working on separating the parts of PerlQt which need to be shared with 
PerlKDE and other child modules. An abstract SmokePerl class will define the 
interface which Smoke-based modules can all use to glue themselves. A pointer 
to that abstract interface will be stored in a global Perl variable, probably 
${'main::<SMOKE>'}. The goal is to have really small, simple modules consist 
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, 
signals/slots, and the Qt-specific type handlers.

SmokePerl, which will be included with PerlQt until someone wants it separated 
(and I'm willing to freeze the interface), will have everything else. The 
type marshallers (virtual/regular/signal/slot method 
arguments/return-values), the basic type handlers (int/double/class/...), 
copy-construction, object creation, pointer => object mapping, method 
calling, AUTOLOAD, etc.

The Smoke::* structs will all get inline class wrappers. No Smoke::* structure 
can exist independently of its Smoke object, since there could be many Smoke 
objects loaded. Each wrapper class will contain one Smoke::* element and a 
Smoke object. Smoke::Type has a SmokeType wrapper, Smoke::Class has 
SmokeClass, etc. smokeperl_object becomes SmokeObject and gains some useful 
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 
need to know what classes have overridden virtual destructors, so I know when 
to expect destructor callbacks. Currently, I use isa("QObject") || 
isa("QPaintDevice"). I would also like to know which classes have copy 
constructors. I'll probably use another flag to mark classes which are listed 
but not defined (like QWidget would be in SmokeKDE).

David, can you add a flags field to smoke.h whenever Kalyptus generates it?

+    enum ClassFlags {
+	cf_constructor = 0x01,	// has constructor
+	cf_deepcopy = 0x02,	// has copy constructor
+	cf_virtual = 0x04,	// has virtual destructor
+	cf_undefined = 0x10	// defined elsewhere
+    };
     struct Class {
	const char *className;	// Name of the class
	Index parents;		// Index into inheritanceList
	ClassFn classFn;	// Calls any method in the class
	EnumFn enumFn;		// Handles enum pointers
+	unsigned short flags;	// 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 
enjoyed writing A5. (http://www.perl.com/)

Ashley Winters

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic