RE: Fun with Garnet & ASDF - Garnet ASDF cursor system, defining cursors at system load time

Brad Myers <[email protected]> Thu, 1 Sep 2005 11:12:09 -0400
Newsgroups gmane.lisp.garnet.user
Message-ID <[email protected]>
Hi Sean,
Thanks for this. Does it make sense for files like this to be added to the SourceForge
Garnet area or something so they aren't lost?
http://garnetlisp.sourceforge.net/
http://sourceforge.net/projects/garnetlisp

Brad Myers

> -----Original Message-----
> From: Sean Champ [mailto:[email protected]] 
> Sent: Monday, August 29, 2005 5:24 PM
> To: Garnet Users List
> Subject: Fun with Garnet & ASDF - Garnet ASDF cursor system, 
> defining cursors at system load time
> 
> Hello,
> 
> In order to make it somehow easier to load and develop 
> Garnet, and to incorporate Garnet with other Common Lisp 
> applications that do and would have ASDF system definitions, 
> I've been taking some time to define ASDF systems for Garnet. 
> I hope to share the work, made for this, once it would be all 
> completed and tested -- I've got as far as defining a system 
> for Garnet-Gadgets, then had to stop to address how I will 
> have GARNET-BITMAP-PATHNAME defined, given how I've been 
> doing the Garnet ASDF "stuff", thus far. At that time, I 
> stopped to notice the Garnet cursor files.
> 
> The ASDF work, mentioned, is not my primary point, here, 
> though it has been coincident to this email. When it would be 
> released, I hope to write enough notes to explain it.
> 
> 
> 
> As a result of the ASDF+Garnet fun, I decided to define 
> something, upon a lark, about Garnet cursor files. I thought 
> it would be worth sharing, then. It's attached -- an ASDF 
> system definition, containing some  extensions on ASDF; it 
> would best be located within the Garnet lib/bitmaps/ 
> directory, named garnet-cursors.asd, if one would load it. It 
> would be most easily used, if one would already have Opal 
> loaded. Then, one would simply load the file, and execute
> 
>   (asdf:operate  'asdf:load-op :garnet-cursors)
> 
> Of course, it would redefine some things, but just as how 
> they've been defined, before.
> 
> 
> Essentially, the code in the attached ADSF file does 
> represent a means for automatically defining Garnet cursors 
> when an ASDF system is loaded -- such that the system would 
> contain one or more CURSOR-COMPONENT components. I'm sure it 
> is not perfectly  done, but it may at least serve as an 
> example, and a first revision (avaialble in later forms, once 
> it would be availabile)
> 
> 
> As for  how the attached ASDF extensions would work, I'll 
> explain it in regards to a hypothetical ASDF component with 
> the name <FOO>. This explanation might be more clear, after a 
> brief look at the attached *.asd file.
> 
> 
> I'd thought that this set of extensions on ASDF would be 
> helpful, for that it would allow a Garnet developer to simply 
> create the appropriate <FOO>.mask and <FOO>.cursor files, 
> then identify a <FOO> CURSOR-COMPONENT in an ASDF system -- 
> with no more code being required, for this.  When the ASDF 
> system would be loaded, then, the apprpriate <FOO>-CURSOR and 
> <FOO>-CURSOR-MASK schemas would be defined for the <FOO> 
> CURSOR-COMPONENT; both of those schemas would then be 
> identified within a <FOO>-PAIR variable -- much like how it 
> is being done in Garnet, though this would do it 
> automatically, upon the loading of the ASDF system.
> 
> Additionally, this allows for a :PACKAGE argument to be 
> specified in the definition of the comopnent; it would be 
> spedified in the ASDF definiton for the <FOO>  
> CURSOR-COMPONENT, or in the definiton of the module (possibly 
> a system) directly containing the <FOO> component. Granted, 
> the attached *.asd file is not so well desinged for this -- 
> some class names may need to be revised -- but it works.
> 
> The :PACKAGE identified will have to exist when the component 
> would be loaded; it would be used as the package in which the 
> symbols for the CURSOR-COMPONENT would be interned (namely, 
> the cursor schemas and the cursor's <FOO>-PAIR variable)
> 
> 
> Granted, this serves to require that one wold be using ASDF, 
> to load the appropriate system. I'm sure that that should not 
> be a matter of problem; ASDF is hardly an uncommon application.
> 
> 
> Furthermore, now having completed the thing, I've come to 
> realize that this particular system definition, attached, it 
> is not so glaringly necessary; there is already the code, 
> within Garnet, for acccomplishing what the attached system 
> definition does accomplish.
> 
> Still, if anyone would be defining new cursors for Garnet, 
> and using ASDF, then perhaps the attached code would be of interest.
> 
> 
> I hope it serves to demonstrate some of what can be done with 
> ASDF systems, furthermore. 
> 
> Something like this could be done, if necesary, for 
> automatically loading Garnet bitmaps, when an appropriate 
> ASDF system would be loaded. Of course, it could be done for 
> any image file, given some appropriate support in the Lisp image.
> 
> (Incorporating Garnet with more of what exists for the 
> representation of image files -- I do not know the 
> package-names offhand, but I know they exist, and they should 
> be at http://common-lisp.net/ -- it  is one more item on my 
> own to-do list; perhaps there will be come code after it, 
> sometime when.)
> 
> Incidentally, the ASDF+Garnet work is being done as part of 
> an intention, for to package Garnet for Debian GNU/Linux 
> systems. That should be reported about, when it's done and tested
> 
> I do not intend to work-in this garnet-cursor code with it, 
> except perhaps as an example. Regardless, it's done, and 
> attached, in at least a first draft form. Maybe it will have 
> been of any interest.
> 
> 
> 
> 
> --
> Sean Champ
> [email protected]
>