<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<!-- iDefrag Scripting defintion file -->
<dictionary title="">
  <suite name="iDefrag" code="iDfS" 
	 description="Commands and classes for iDefrag">

    <!-- Copied from NSCoreSuite.sdef -->
    <class name="item" code="cobj" 
	   description="A scriptable object.">
      <cocoa class="AbstractObject"/>
      <property name="class" code="pcls" type="type" access="r" 
		description="The class of the object.">
	<cocoa key="classCode"/>
      </property>
      <property name="properties" code="pALL" type="record" 
		description="All of the object's properties.">
	<cocoa key="scriptingProperties"/>
      </property>
      <!--
	   The blank method declarations are needed to emulate the existing
	   NSCoreSuite.scriptSuite.framework.  Ordinarily, you wouldn't do this.
	-->
      <responds-to name="count">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="delete">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="duplicate">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="exists">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="get">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="move">
	<cocoa method=""/>
      </responds-to>
      <responds-to name="set">
	<cocoa method=""/>
      </responds-to>
    </class>

    <class name="window" code="cwin" 
	   description="A window.">
      <cocoa class="NSWindow"/>
      <property name="name" code="pnam" type="text" 
		description="The full title of the window.">
	<cocoa key="title"/>
      </property>
      <property name="id" code="ID  " type="integer" access="r" 
		description="The unique identifier of the window.">
	<cocoa key="uniqueID"/>
      </property>
      <property name="bounds" code="pbnd" type="rectangle" 
		description="The bounding rectangle of the window.">
	<cocoa key="boundsAsQDRect"/>
      </property>
      <property name="closeable" code="hclb" type="boolean" access="r" 
		description="Whether the window has a close box.">
	<cocoa key="hasCloseBox"/>
      </property>
      <property name="titled" code="ptit" type="boolean" access="r" 
		description="Whether the window has a title bar.">
	<cocoa key="hasTitleBar"/>
      </property>
      <property name="index" code="pidx" type="integer" 
		description="The index of the window in the back-to-front window ordering.">
	<!-- the type is supposed to be "integer" -->
	<cocoa key="orderedIndex"/>
      </property>
      <property name="floating" code="isfl" type="boolean" access="r" 
		description="Whether the window floats.">
	<cocoa key="isFloatingPanel"/>
      </property>
      <property name="miniaturizable" code="ismn" type="boolean" access="r" 
		description="Whether the window can be miniaturized.">
	<cocoa key="isMiniaturizable"/>
      </property>
      <property name="miniaturized" code="pmnd" type="boolean" 
		description="Whether the window is currently miniaturized.">
	<cocoa key="isMiniaturized"/>
      </property>
      <property name="modal" code="pmod" type="boolean" access="r" 
		description="Whether the window is the application's current modal window.">
	<cocoa key="isModalPanel"/>
      </property>
      <property name="resizable" code="prsz" type="boolean" access="r" 
		description="Whether the window can be resized.">
	<cocoa key="isResizable"/>
      </property>
      <property name="visible" code="pvis" type="boolean" 
		description="Whether the window is currently visible.">
	<cocoa key="isVisible"/>
      </property>
      <property name="zoomable" code="iszm" type="boolean" access="r" 
		description="Whether the window can be zoomed.">
	<cocoa key="isZoomable"/>
      </property>
      <property name="zoomed" code="pzum" type="boolean" 
		description="Whether the window is currently zoomed.">
	<cocoa key="isZoomed"/>
      </property>
      <responds-to name="close">
	<cocoa method="handleCloseScriptCommand:"/>
      </responds-to>
    </class>

    <!-- Status information -->
    <enumeration name="defrag status" code="iDst">
      <enumerator name="idle" code="idle"
                  description="iDefrag is not doing anything." />
      <enumerator name="waiting to go" code="wait"
                  description="iDefrag is waiting for the current operation to complete." />
      <enumerator name="working" code="work"
                  description="iDefrag is working." />
      <enumerator name="failed" code="fail"
                  description="iDefrag has encountered an error." />
    </enumeration>

    <!-- Application class -->
    <class name="application" code="capp" 
	   description="iDefrag's top level scripting object">
      <cocoa class="NSApplication"/>
      
      <!-- Copied from NSCoreSuite.sdef -->
      <element type="window" access="r">
	<cocoa key="orderedWindows"/>
      </element>
      <property name="name" code="pnam" type="text" access="r" 
		description="The name of the application."/>
      <property name="frontmost" code="pisf" type="boolean" access="r" 
		description="Is this the frontmost (active) application?">
	<cocoa key="isActive"/>
      </property>
      <property name="version" code="vers" type="text" access="r" 
		description="The version of the application."/>
      <property name="status" code="idst" type="defrag status" access="r"
                description="iDefrag's current status">
        <cocoa key="status" />
      </property>
      <property name="error code" code="idec" type="integer" access="r"
                description="a code indicating the nature of the last error">
        <cocoa key="errorCode" />
      </property>
      <property name="error message" code="idem" type="text" access="r"
                description="a message explaining the nature of the last
                error">
        <cocoa key="errorMessage" />
      </property>
      <property name="progress" code="idpp" type="real" access="r"
                description="The progress of the current operation, as a percentage (-1.0 means indeterminate)">
        <cocoa key="progress" />
      </property>
      <property name="operation" code="idpt" type="text" access="r"
                description="A description of the current operation">
        <cocoa key="progressText" />
      </property>
      <element type="volume">
	<cocoa key="volumes"/>
      </element>
      <element type="disk">
	<cocoa key="disks"/>
      </element>
      <element type="algorithm">
	<cocoa key="algorithms"/>
      </element>
      <element type="class set">
	<cocoa key="classSets"/>
      </element>
      <property name="selected volume" code="idsv" 
		description="The currently selected volume">
	<type type="volume" />
	<type type="missing value" />
      </property>
      <property name="selected algorithm" code="idsa" type="algorithm"
		description="The currently selected algorithm"/>
      <property name="selected class set" code="idsc" type="class set"
		description="The currently selected class set"/>
      <responds-to name="quit">
	<cocoa method="handleQuitScriptCommand:"/>
      </responds-to>
    </class>
    
    <!-- Algorithm class -->
    <class name="algorithm" code="iDal"
	   description="Represents a defragmentation algorithm">
      <cocoa class="IDAppleScriptAlgorithm"/>
      
      <property name="name" code="pnam" type="text" access="r"
		
		description="The name of this defragmentation algorithm"/>
      <property name="selected" code="psel" type="boolean" access="r"
		
		description="True if this algorithm is currently selected,
		false otherwise"/>
      <property name="parameters" code="idpm" type="any"
                description="Parameters to override for this algorithm.  Note that setting parameters using this feature will override the settings in the UI.  See the 'algorithm parameters' record definition for settings you can control."/>
      <responds-to name="select">
	<cocoa method="handleSelectCommand:"/>
      </responds-to>
    </class>

    <!-- Class Set class -->
    <class name="class set" code="iDcs" 
	   description="Represents a class set">
      <cocoa class="IDAppleScriptClassSet"/>
      
      <property name="name" code="pnam" type="text" access="r"
		
		description="The name of this class set"/>
      <property name="path" code="ppth" type="text" access="r"
		
		description="The path of the .classes file that defines this class set"/>
      <property name="selected" code="psel" type="boolean" access="r"
		
		description="True if this class set is currently selected, false otherwise"/>

      <responds-to name="select">
	<cocoa method="handleSelectCommand:"/>
      </responds-to>
    </class>

    <!-- Disk class -->
    <class name="disk" code="iDds" 
	   description="Represents a disk attached to the system">
      <cocoa class="IDAppleScriptDisk"/>
      
      <element type="volume">
	<cocoa key="volumes"/>
      </element>
      
      
      <property name="name" code="pnam" type="text" access="r" 
		description="The name of this disk (e.g. /dev/rdisk0)"/>
      <property name="displayed name" code="dnam" type="text" access="r" 
		description="The best human readable name we can find for this disk"/>
      <property name="root device" code="rdev" type="boolean" access="r" 
		description="True if this is the device from which the system started, false otherwise">
	<cocoa key="isRootDevice"/>
      </property>

      <!-- Exposed media properties -->
      <property name="block size" code="mbsz" type="integer" access="r" 
		description="The media block size for this disk">
	<cocoa key="mediaBlockSize"/>
      </property>
      <property name="BSD major" code="bmaj" type="integer" access="r" 
		description="The BSD major device number">
	<cocoa key="mediaBSDMajor"/>
      </property>
      <property name="BSD minor" code="bmin" type="integer" access="r" 
		description="The BSD minor device number">
	<cocoa key="mediaBSDMinor"/>
      </property>
      <property name="BSD name" code="bnam" type="text" access="r" 
		description="The BSD name for this disk">
	<cocoa key="mediaBSDName"/>
      </property>
      <property name="BSD unit" code="bunt" type="integer" access="r" 
		description="The BSD unit number for this disk">
	<cocoa key="mediaBSDUnit"/>
      </property>
      <property name="ejectable" code="mejc" type="boolean" access="r" 
		description="True if this disk is ejectable, false otherwise">
	<cocoa key="mediaIsEjectable"/>
      </property>
      <property name="removable" code="mejc" type="boolean" access="r" 
		description="True if this disk is removable, false otherwise">
	<cocoa key="mediaIsRemovable"/>
      </property>
      <property name="writable" code="mwrt" type="boolean" access="r" 
		description="True if this disk is writable, false otherwise">
	<cocoa key="mediaIsWritable"/>
      </property>

      <!-- Exposed device properties -->
      <property name="internal" code="dint" type="boolean" access="r" 
		description="True if this disk is internal, false otherwise">
	<cocoa key="deviceIsInternal"/>
      </property>
      <property name="model" code="dmdl" type="text" access="r" 
		description="The model name of this disk device">
	<cocoa key="deviceModel"/>
      </property>
      <property name="device path" code="dpth" type="text" access="r" 
		description="The device path (in the IOKit registry) of this disk device">
	<cocoa key="devicePath"/>
      </property>
      <property name="protocol" code="dprt" type="text" access="r" 
		description="The protocol used by this disk device">
	<cocoa key="deviceProtocol"/>
      </property>
      <property name="revision" code="drev" type="text" access="r" 
		description="The revision string for this disk device">
	<cocoa key="deviceRevision"/>
      </property>
      <property name="unit" code="dunt" type="integer" access="r" 
		description="The unit number for this disk device">
	<cocoa key="deviceUnit"/>
      </property>
      <property name="vendor" code="dvnd" type="text" access="r" 
		description="The vendor of this disk device">
	<cocoa key="deviceVendor"/>
      </property>

      <!-- Exposed bus properties -->
      <property name="bus name" code="bunm" type="text" access="r" 
		description="The name of the bus on which this device sits">
	<cocoa key="busName"/>
      </property>
      <property name="bus path" code="bpth" type="text" access="r" 
		description="The bus path (in the IOKit registry) for this device">
	<cocoa key="busPath"/>
      </property>
      
      <!-- Other properties -->
      <property name="mounts" code="dmnt" access="r" 
		description="Locations within the file system where this volume is mounted">
	<cocoa key="mountList"/>
	<type type="record" list="yes"/>
      </property>
      
    </class>

    <!-- Volume class -->
    <class name="volume" code="iDvl" 
	   description="A volume">
      <cocoa class="IDAppleScriptVolume"/>
      
      <property name="name" code="pnam" type="text" access="r" 
		description="The BSD name of this volume (e.g. /dev/rdisk0s9)"/>
      <property name="displayed name" code="dnam" type="text" access="r" 
		description="The human-readable name of this volume"/>
      <property name="parent disk" code="vdsk" type="disk" access="r" 
		description="The disk on which this volume resides"/>
      <property name="selected" code="psel" type="boolean" access="r" 
		description="True if this volume is currently selected, false otherwise"/>
      <property name="content type" code="fsty" type="text" access="r" 
		description="Type of file system on this volume"/>
      <property name="mounts" code="dmnt" access="r" 
		description="Locations within the file system where this volume is mounted">
	<cocoa key="mountList"/>
	<type type="text" list="yes"/>
      </property>

      <responds-to name="select">
	<cocoa method="handleSelectCommand:"/>
      </responds-to>
      <responds-to name="defragment">
	<cocoa method="handleDefragmentCommand:"/>
      </responds-to>
      
    </class>

    <!-- Record fields (part of a fictitious record)

         If you modify this, you must update the table in
         IDAppleScriptAlgorithm in order to get a sensible mapping for the
         actual algorithm implementations.

      -->
    <record-type name="algorithm parameters" code="idpa">
      <!-- Compact -->
      <property name="compact metadata zone" type="boolean" code="idcm"
                description="Should the volume metadata zone be compacted?" />
      <property name="allow unsafe moves" type="boolean" code="idau"
                description="Should overlapping moves be allowed?" />
      <property name="compact fully" type="boolean" code="idcf"
                description="Should the algorithm try to compact all free space?" />
      <property name="compact b-trees" type="boolean" code="idcb"
                description="Should the volume's B-Trees be compacted?" />
      <property name="rebuild b-trees" type="boolean" code="idrb"
                description="Should the volume's B-Trees by rebuilt?" />
      <property name="maintain fragment order" type="boolean" code="idmo"
                description="Should the order of fragments be maintained when compacting?" />

      <!-- Special -->
      <property name="space to clear" type="real" code="idcl"
                description="the amount of space to clear, in GB" />

      <!-- Metadata -->
      <property name="metadata limits are hard" type="boolean" code="idmh"
                description="Should the amount of space reserved in the volume's Metadata Zone for each metadata file be a hard limit?" />

      <!-- Optimize -->
      <property name="per-class sorting" type="boolean" code="idpc"
                description="Should per-class sorting be enabled?" />
      <property name="skip oversized fragments" type="boolean" code="idso"
                description="Should iDefrag skip fragments if there isn't enough contiguous space?" />
      <property name="scratch area at end of disk" type="boolean" code="idse"
                description="Should the end of the disk be used as a scratch area?" />
    </record-type>

    <!-- Commands -->
    <command name="select" code="iDfgSele" 
	     description="Select a volume, algorithm or class set">
      <cocoa class="NSScriptCommand" />
      <direct-parameter description="The object to select">
	<type type="specifier"/>
      </direct-parameter>
    </command>

    <command name="go" code="iDfgGoGo" 
	     description="Start defragmenting the selected volume">
      <cocoa class="IDAppleScriptGoCommand"/>
    </command>

    <command name="check status" code="iDfgCkSt"
             description="Raise an error if something has gone wrong">
      <cocoa class="IDAppleScriptCheckStatusCommand"/>
    </command>

    <command name="stop" code="iDfgStop" 
	     description="Stop defragmentation">
      <cocoa class="IDAppleScriptStopCommand"/>
    </command>
    
    <command name="defragment" code="iDfgDefr" 
	     description="Defragment the specified volume">
      <direct-parameter description="The volume to defragment">
	<type type="specifier" />
      </direct-parameter>
      <parameter name="using" code="Algo" type="algorithm" 
		 description="The defragmentation algorithm to use" optional="yes">
	<cocoa key="Algorithm"/>
      </parameter>
      <parameter name="with class set" code="Clst" 
		 description="The class set to use" optional="yes">
	<cocoa key="Class Set"/>
	<type type="text"/>
	<type type="class set"/>
      </parameter>
    </command>
    
    <command name="quit" code="aevtquit" 
	     description="Quit an application.">
      <cocoa class="NSQuitCommand"/>
    </command>

    <command name="close" code="coreclos" 
	     description="Close an object.">
      <cocoa class="NSCloseCommand"/>
      <direct-parameter description="the object to close">
	<type type="specifier" />
      </direct-parameter>
    </command>

    <command name="count" code="corecnte" 
	     description="Return the number of elements of a particular class within an object.">
      <cocoa class="NSCountCommand"/>
      <direct-parameter type="specifier" 
			description="the object whose elements are to be counted"/>
      <parameter name="each" code="kocl" type="type" optional="yes" 
		 description="The class of objects to be counted.">
	<cocoa key="ObjectClass"/>
      </parameter>
      <result type="integer" 
	      description="the number of elements"/>
    </command>

    <command name="delete" code="coredelo" 
	     description="Delete an object.">
      <cocoa class="NSDeleteCommand"/>
      <direct-parameter type="specifier" 
			description="the object to delete"/>
    </command>

    <command name="duplicate" code="coreclon" 
	     description="Copy object(s) and put the copies at a new location.">
      <cocoa name="Copy" class="NSCloneCommand"/>
      <direct-parameter type="specifier" 
			description="the object(s) to duplicate"/>
      <!-- "duplicate" is supposed to return the new objects.
	   <result type="object" 
		   description="to the duplicated object(s)"/>
	   -->
      <parameter name="to" code="insh" type="location specifier" 
		 description="The location for the new object(s).">
	<!-- "to" is supposed to be optional. -->
	<cocoa key="ToLocation"/>
      </parameter>
      <parameter name="with properties" code="prdt" type="record" 
		 description="Properties to be set in the new duplicated object(s)." optional="yes">
	<cocoa key="WithProperties"/>
      </parameter>
    </command>

    <command name="exists" code="coredoex" 
	     description="Verify if an object exists.">
      <cocoa class="NSExistsCommand"/>
      <direct-parameter type="specifier" 
			description="the object in question"/>
      <result type="boolean" 
	      description="true if it exists, false if not"/>
    </command>

    <!-- "get" is supposed to be hidden. -->
    <command name="get" code="coregetd" 
	     description="Get the data for an object.">
      <cocoa class="NSGetCommand"/>
      <direct-parameter type="specifier"/>
      <result type="any"/>
    </command>
    <command name="move" code="coremove" 
	     description="Move object(s) to a new location.">
      <cocoa class="NSMoveCommand"/>
      <direct-parameter type="specifier" 
			description="the object(s) to move"/>
      <!-- "move" is supposed to return the relocated objects.
	   <result type="object" 
		   description="to the object(s) after they have been moved"/>
	   -->
      <parameter name="to" code="insh" type="location specifier" 
		 description="The new location for the object(s).">
	<cocoa key="ToLocation"/>
      </parameter>
    </command>

    <command name="set" code="coresetd" 
	     description="Set an object's data.">
      <cocoa class="NSSetCommand"/>
      <direct-parameter type="specifier"/>
      <!-- "set" is supposed to return the fully evaluated "to" data.
	   <result type="any"/>
	   -->
      <parameter name="to" code="data" type="any" 
		 description="The new value.">
	<cocoa key="Value"/>
      </parameter>
    </command>
  </suite>
</dictionary>
<!--
    Local Variables:
    mode:xml
    End:
  -->
