]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - doc/help/api-ppd.html
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / doc / help / api-ppd.html
index b8ea921548513e654e50e35721aa8192b6e7bcbd..20e51fc4e04e0c197081371138f98197a77a0b70 100644 (file)
@@ -300,6 +300,7 @@ div.contents ul.subcontents li {
 </ul></li>
 <li><a href="#FUNCTIONS">Functions</a><ul class="code">
 <li><a href="#cupsMarkOptions" title="Mark command-line options in a PPD file.">cupsMarkOptions</a></li>
+<li><a href="#cupsResolveConflicts" title="Resolve conflicts in a marked PPD.">cupsResolveConflicts</a></li>
 <li><a href="#ppdClose" title="Free all memory used by the PPD file.">ppdClose</a></li>
 <li><a href="#ppdCollect" title="Collect all marked options that reside in the specified
 section.">ppdCollect</a></li>
@@ -323,6 +324,8 @@ marked option choices.">ppdConflicts</a></li>
 <li><a href="#ppdFindOption" title="Return a pointer to the specified option.">ppdFindOption</a></li>
 <li><a href="#ppdFirstCustomParam" title="Return the first parameter for a custom option.">ppdFirstCustomParam</a></li>
 <li><a href="#ppdFirstOption" title="Return the first option in the PPD file.">ppdFirstOption</a></li>
+<li><a href="#ppdInstallableConflict" title="Test whether an option choice conflicts with
+an installable option.">ppdInstallableConflict</a></li>
 <li><a href="#ppdIsMarked" title="Check to see if an option is marked.">ppdIsMarked</a></li>
 <li><a href="#ppdLastError" title="Return the status from the last ppdOpen*().">ppdLastError</a></li>
 <li><a href="#ppdLocalize" title="Localize the PPD file to the current locale.">ppdLocalize</a></li>
@@ -332,7 +335,8 @@ attribute.">ppdLocalizeIPPReason</a></li>
 <li><a href="#ppdLocalizeMarkerName" title="Get the localized version of a marker-names
 attribute value.">ppdLocalizeMarkerName</a></li>
 <li><a href="#ppdMarkDefaults" title="Mark all default options in the PPD file.">ppdMarkDefaults</a></li>
-<li><a href="#ppdMarkOption" title="Mark an option in a PPD file.">ppdMarkOption</a></li>
+<li><a href="#ppdMarkOption" title="Mark an option in a PPD file and return the number of
+conflicts.">ppdMarkOption</a></li>
 <li><a href="#ppdNextCustomParam" title="Return the next parameter for a custom option.">ppdNextCustomParam</a></li>
 <li><a href="#ppdNextOption" title="Return the next option in the PPD file.">ppdNextOption</a></li>
 <li><a href="#ppdOpen" title="Read a PPD file into memory.">ppdOpen</a></li>
@@ -341,6 +345,7 @@ attribute value.">ppdLocalizeMarkerName</a></li>
 <li><a href="#ppdOpenFile" title="Read a PPD file into memory.">ppdOpenFile</a></li>
 <li><a href="#ppdPageLength" title="Get the page length for the given size.">ppdPageLength</a></li>
 <li><a href="#ppdPageSize" title="Get the page size record for the given size.">ppdPageSize</a></li>
+<li><a href="#ppdPageSizeLimits" title="Return the custom page size limits.">ppdPageSizeLimits</a></li>
 <li><a href="#ppdPageWidth" title="Get the page width for the given size.">ppdPageWidth</a></li>
 <li><a href="#ppdSetConformance" title="Set the conformance level for PPD files.">ppdSetConformance</a></li>
 </ul>
@@ -627,11 +632,69 @@ int cupsMarkOptions (<br>
 <dd class="description">Options</dd>
 </dl>
 <h4 class="returnvalue">Return Value</h4>
-<p class="description">1 if conflicting</p>
+<p class="description">1 if conflicts exist, 0 otherwise</p>
 <h4 class="discussion">Discussion</h4>
 <p class="discussion">This function maps the IPP &quot;finishings&quot;, &quot;media&quot;, &quot;mirror&quot;,
 &quot;multiple-document-handling&quot;, &quot;output-bin&quot;, &quot;printer-resolution&quot;, and
 &quot;sides&quot; attributes to their corresponding PPD options and choices.</p>
+<h3 class="function"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="cupsResolveConflicts">cupsResolveConflicts</a></h3>
+<p class="description">Resolve conflicts in a marked PPD.</p>
+<p class="code">
+int cupsResolveConflicts (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *choice,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;int *num_options,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t **options<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>ppd</dt>
+<dd class="description">PPD file</dd>
+<dt>option</dt>
+<dd class="description">Newly selected option or <code>NULL</code> for none</dd>
+<dt>choice</dt>
+<dd class="description">Newly selected choice or <code>NULL</code> for none</dd>
+<dt>num_options</dt>
+<dd class="description">Number of additional selected options</dd>
+<dt>options</dt>
+<dd class="description">Additional selected options</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 on success, 0 on failure</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function attempts to resolve any conflicts in a marked PPD, returning
+a list of option changes that are required to resolve them.  On input,
+&quot;num_options&quot; and &quot;options&quot; contain any pending option changes that have
+not yet been marked, while &quot;option&quot; and &quot;choice&quot; contain the most recent
+selection which may or may not be in &quot;num_options&quot; or &quot;options&quot;.<br>
+<br>
+On successful return, &quot;num_options&quot; and &quot;options&quot; are updated to contain
+&quot;option&quot; and &quot;choice&quot; along with any changes required to resolve conflicts
+specified in the PPD file and 1 is returned.<br>
+<br>
+If option conflicts cannot be resolved, &quot;num_options&quot; and &quot;options&quot; are not
+changed and 0 is returned.<br>
+<br>
+When resolving conflicts, <code>cupsResolveConflicts</code> does not consider
+changes to the current page size (<code>media</code>, <code>PageSize</code>, and
+<code>PageRegion</code>) or to the most recent option specified in &quot;option&quot;.
+Thus, if the only way to resolve a conflict is to change the page size
+or the option the user most recently changed, <code>cupsResolveConflicts</code>
+will return 0 to indicate it was unable to resolve the conflicts.<br>
+<br>
+The <code>cupsResolveConflicts</code> function uses one of two sources of option
+constraint information.  The preferred constraint information is defined by
+<code>cupsUIConstraints</code> and <code>cupsUIResolver</code> attributes - in this
+case, the PPD file provides constraint resolution actions.<br>
+<br>
+The backup constraint information is defined by the
+<code>UIConstraints</code> and <code>NonUIConstraints</code> attributes.  These
+constraints are resolved algorithmically by first selecting the default
+choice for the conflicting option, then iterating over all possible choices
+until a non-conflicting option choice is found.
+
+</p>
 <h3 class="function"><a name="ppdClose">ppdClose</a></h3>
 <p class="description">Free all memory used by the PPD file.</p>
 <p class="code">
@@ -1010,6 +1073,31 @@ const char *ppdErrorString (<br>
 <h4 class="discussion">Discussion</h4>
 <p class="discussion">Options are returned from all groups in ascending alphanumeric order.
 
+</p>
+<h3 class="function"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="ppdInstallableConflict">ppdInstallableConflict</a></h3>
+<p class="description">Test whether an option choice conflicts with
+an installable option.</p>
+<p class="code">
+int ppdInstallableConflict (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *option,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *choice<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>ppd</dt>
+<dd class="description">PPD file</dd>
+<dt>option</dt>
+<dd class="description">Option</dd>
+<dt>choice</dt>
+<dd class="description">Choice</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 if conflicting, 0 if not conflicting</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function tests whether a particular option choice is available based
+on constraints against options in the &quot;InstallableOptions&quot; group.
+
 </p>
 <h3 class="function"><a name="ppdIsMarked">ppdIsMarked</a></h3>
 <p class="description">Check to see if an option is marked.</p>
@@ -1155,7 +1243,8 @@ void ppdMarkDefaults (<br>
 <dd class="description">PPD file record</dd>
 </dl>
 <h3 class="function"><a name="ppdMarkOption">ppdMarkOption</a></h3>
-<p class="description">Mark an option in a PPD file.</p>
+<p class="description">Mark an option in a PPD file and return the number of
+conflicts.</p>
 <p class="code">
 int ppdMarkOption (<br>
 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
@@ -1287,6 +1376,33 @@ float ppdPageLength (<br>
 </dl>
 <h4 class="returnvalue">Return Value</h4>
 <p class="description">Size record for page or NULL</p>
+<h3 class="function"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="ppdPageSizeLimits">ppdPageSizeLimits</a></h3>
+<p class="description">Return the custom page size limits.</p>
+<p class="code">
+int ppdPageSizeLimits (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_file_t">ppd_file_t</a> *ppd,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *minimum,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ppd_size_t">ppd_size_t</a> *maximum<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>ppd</dt>
+<dd class="description">PPD file record</dd>
+<dt>minimum</dt>
+<dd class="description">Minimum custom size</dd>
+<dt>maximum</dt>
+<dd class="description">Maximum custom size</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">1 if custom sizes are supported, 0 otherwise</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function returns the minimum and maximum custom page sizes and printable
+areas based on the currently-marked (selected) options.<br>
+<br>
+If the specified PPD file does not support custom page sizes, both
+&quot;minimum&quot; and &quot;maximum&quot; are filled with zeroes.
+
+</p>
 <h3 class="function"><a name="ppdPageWidth">ppdPageWidth</a></h3>
 <p class="description">Get the page width for the given size.</p>
 <p class="code">
@@ -1639,8 +1755,8 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
 <dd class="description">Number of pre-loaded fonts</dd>
 <dt>num_groups </dt>
 <dd class="description">Number of UI groups</dd>
-<dt>num_profiles </dt>
-<dd class="description">Number of sRGB color profiles</dd>
+<dt>num_profiles <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
+<dd class="description">Number of sRGB color profiles </dd>
 <dt>num_sizes </dt>
 <dd class="description">Number of page sizes</dd>
 <dt>patches </dt>
@@ -1649,8 +1765,8 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
 <dd class="description">PCFileName string </dd>
 <dt>product </dt>
 <dd class="description">Product name (from PS RIP/interpreter)</dd>
-<dt>profiles </dt>
-<dd class="description">sRGB color profiles</dd>
+<dt>profiles <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
+<dd class="description">sRGB color profiles </dd>
 <dt>protocols <span class="info">&nbsp;CUPS 1.1.19&nbsp;</span></dt>
 <dd class="description">Protocols (BCP, TBCP) string </dd>
 <dt>shortnickname </dt>