finding the way through the xtools codebase

Discussion of the xtools Toolkit

Moderators: Tom, Kukurykus

jacobolus

finding the way through the xtools codebase

Post by jacobolus »

Hi xbytor & everyone,

I downloaded a copy of xtools and have been trying to read through to make some mental inventory of what's included. There seems to be a lot of useful functionality here, but it's also hundreds of thousands of lines of code with many parts duplicated several times in slightly different versions. I'm having some trouble orienting myself. Is there anywhere with documentation of what each of the functions here does, or even just a list of them all? Are the scripts with big duplicated parts generated from some source makefile or similar? Is there a place to find a version with just the parts unique to each file?

Cheers,
Jacob
xbytor

finding the way through the xtools codebase

Post by xbytor »

There are some files in xtools/docs that may be helpful, but I've not updated them in quite awhile.
The HTML page http://ps-scripts.sourceforge.net/xtools.html provides more info.

But the basic break down is this:
xtools/xlib is contains the primary library files. The most important is stdlib.js which is where
I usually just dump new stuff. Internally, it is mostly split into logical sections.
GenericUI.js is my UI framework. Since I was cranking out lots of UIs for clients very quickly,
I put this together to speed things up. I _always_ use it for any real UI. It has lots of interesting
stuff that you could extract like a file output parameter panel, a file renaming panel (like the
the one in Bridge), and a few other goodies.

xtools/xlib/xml is actually misnamed. It contains the core of my ActionManager encoding and decoding
routines. This stuff lets me read atn files into ActionManager classes, save them (or read them) as XML.

xtools/xlib/xmp is deprecated. I started on it well before ScriptUI had real XMP support.

xtools/xapps contains all of the proper application scripts. These are scripts that you can actually run to
accomplish some task. Some are useful for normal work (like XWatermark) others are of interest
primarily to script developers (like GetterDemo).
All of these scripts use //@include directives to include files from xtools/xlib.

xtools/apps contains the flattened versions of the scripts in xapps. You can run these independent of an
xtools installation. I usually flatten scripts and zip them up before sending them out to clients.
DO NOT try to read these files.

If you want to see a complete and large implementation of a script that uses xtools to a high degree,
get CSX from the same repository on sourceforge. The UI is bigger than most scripts you'll come across
and takes full advantage of xtools to manage the complexity.

-X
jacobolus

finding the way through the xtools codebase

Post by jacobolus »

Thanks for the summary. I think looking at /apps was the most daunting bit before.

I somehow hadn't seen the page http://ps-scripts.sourceforge.net/xtools.html. That's quite helpful.
xbytor

finding the way through the xtools codebase

Post by xbytor »

Good luck wading through all of that. It can be a bit daunting. There is a lot of cruft in there because
- I needed to maintain backwards compatibility. I only fully support back to CS3, now, but a lot of code will work back to CS.
- PS has bugs or changes from version to version that I need to deal with.

If you have any questions, ask away...