From: mike Date: Sat, 29 Dec 2001 19:04:40 +0000 (+0000) Subject: Remove fonts and pstoraster code from CUPS baseline; this is now part of X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2503e0238ea54dd70b55c68d2c3882addf34fb5;p=thirdparty%2Fcups.git Remove fonts and pstoraster code from CUPS baseline; this is now part of ESP Ghostscript. Add GNU Ghostscript source patches/additions for CUPS. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@1997 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.0.txt b/CHANGES-1.0.txt new file mode 100644 index 0000000000..296d89f791 --- /dev/null +++ b/CHANGES-1.0.txt @@ -0,0 +1,217 @@ +CHANGES-1.0.txt +--------------- + +CHANGES IN CUPS v1.0.5 + + - The HP-GL/2 filter did not correctly set the pen color + for pens other than #1. + - The scheduler would only accept 26 simultaneous jobs + under some OS releases (mkstemp() limitation.) It now + handles up to 2^32 simultaneous jobs. + - The PostScript filter loaded the printer's PPD file + twice. + - The PAM authentication code now uses pam_strerror() to + provide a textual error message in the error_log file. + - The scheduler now copies PPD and interface script + files instead of moving them; this fixes installations + with a separate requests directory. + - The PostScript RIP did not generate correct 6-color + output. + - Several filters were marking PPD options twice when + they didn't need to. + - The scheduler did not save the printer or class state + after an accept-jobs or reject-jobs operation. + - The cupsGetDefault() function now ignores the PRINTER + environment variable if it is set to "lp". + - New ippErrorString() function to get textual error + messages. + - Better error reporting in the System V commands. + - The lpadmin and lpstat commands always tried to + connect to the default server. + - The text filter didn't load the charset files from the + correct location. + - Wasn't sending a WWW-Authenticate: field to HTTP + clients when authentication was required. + - httpSeparate() didn't always set the default port + number for known methods. + - The HP-GL/2 filter now looks for "PSwidth,length" + instead of (the correct) "PSlength,width" as + documented by HP. It appears that many major CAD + applications are broken and this change allows the + auto-rotation to work with them. + - The IPP "printer-resolution" option was not being + translated. + - The charset files did not include the Microsoft + "standard" characters from 128 to 159 (unused by the + ISO-8859-x charsets) + - The scheduler was chunking the Content-Type field from + CGI programs; this problem was most noticeable with + Microsoft Internet Explorer 5. + - By popular demand, the printers, jobs, and classes + CGIs no longer force a reload of the page every 10/30 + seconds. + - The scheduler incorrectly required that the IPP client + provide a document-format attribute for the + validate-job operation. + - Clients that sent bad IPP requests without the + required attributes-natural-language and + attributes-charset attributes would crash the + scheduler. + + +CHANGES IN CUPS v1.0.4 + + - Documentation updates. + - Jobs would get stuck in the queue and wouldn't print + until you enabled the queue. + - The lp and lpr commands now catch SIGHUP and SIGINTR. + - The lp and lpr commands now use sigaction or sigset + when available. + - CUPS library updates for WIN32/OS-2 + + +CHANGES IN CUPS v1.0.3 + + - Documentation updates. + - The lpq man page was missing. + - The configure script was not properly detecting the + image libraries. + - The top-level makefile was calling "make" instead of + "$(MAKE)". + - PostScript filter fixes for number-up, OutputOrder, + and %Trailer. + - The imagetops filter didn't end the base-85 encoding + properly if the image data was not a multiple of 4 + bytes in length. + - The imagetoraster filter didn't generate good banded + RGB or CMY data (was dividing the line width by 4 + instead of 3...) + - The imagetoraster filter now records the bounding + box of the image on the page. + - The CUPS image library cache code wasn't working as + designed; images larger than the maximum RIP cache + would eventually thrash using the same cache tile. + - The CUPS image library TIFF loading code didn't + handle unknown resolution units properly; the fixed + code uses a default resolution of 128 PPI. + - cupsGetClasses() and cupsGetPrinters() did not free + existing strings if they ran out of memory. + - The scheduler logs incorrectly contained 3 digits for + the timezone offset instead of 4. + - The scheduler now does a lookup for the default user + and group ID; the previous hardcoded values caused + problems with the LPD backend. + - The cancel-job operation now allows any user in the + system group to cancel any job. + - The cancel-job operation stopped the print queue if + the job was being printed. + - Now only stop printers if the backend fails. If the + filter fails then the failure is noted in the + error_log and printing continues with the next file in + the queue. + - Now log whether a filter fails because of a signal + or because it returned a non-zero exit status. + - The root user now always passes the system group test. + - Printers with an interface script and remote printers + and classes didn't have a printer-make-and-model + attribute. + - Added logging of lost/timed-out remote printers. + - The HP-GL/2 filter was scaling the pen width twice. + - Updated the HP-GL/2 filter to use a single SP (Set + Pen) procedure. This makes the output smaller and is + more appropriate since the filter keeps track of the + pen states already. + - The scheduler didn't handle passwords with spaces. + - The IPP backend now does multiple copies and retries + if the destination server requires it (e.g. HP + JetDirect.) + - The disable command didn't implement the "-c" option + (cancel all jobs.) + - Changed the CMYK generation function for the image file + and PostScript RIPs. + - The lp command didn't support the "-h" option as + documented. + - The AppSocket, IPP, and LPD backends now retry on all + network errors. This should prevent stopped queues + caused by a printer being disconnected from the + network or powered off. + - The scheduler now restarts a job if the corresponding + printer is modified. + - The image RIPs now rotate the image if needed to fit + on the page. + + +CHANGES IN CUPS v1.0.2 + + - The HP-GL/2 filter didn't always scale the output + correctly. + - The HP-GL/2 filter now supports changing the page size + automatically when the "fitplot" option is not used. + - The cancel-job operation was expecting a resource name + of the form "/job/#" instead of "/jobs/#"; this + prevented the cancel and lprm commands from working. + - The backends didn't log pages when files were printed + using the "-oraw" option. + - The authorization code did not work with the Slackware + long shadow password package because its crypt() can + return NULL. + - The chunking code didn't work for reading the response + of a POST request. + - cupsGetPPD() now does authentication as needed. + - The N-up code in the PostScript filter didn't work + with some printers (grestoreall would restore the + default blank page and device settings). + - The N-up code in the PostScript filter didn't scale + the pages to fit within the imageable area of the + page. + - Wasn't doing an fchown() on the request files. This + caused problems when the default root account group + and CUPS group were not the same. + + +CHANGES IN CUPS v1.0.1 + + - Documentation updates. + - Fixed a bunch of possible buffer-overflow conditions. + - The scheduler now supports authentication using PAM. + - Updated the Italian message file. + - httpEncode64() didn't add an extra "=" if there was + only one byte in the last three-byte group. + - Now drop any trailing character set from the locale + string (e.g. "en_US.ISO_8859-1" becomes "en_US") + - Fixed "timezone" vs "tm_gmtoff" usage for BSD-based + operating systems. + - Updated IPP security so that "get" operations can be + done from any resource name; this allows the CGIs to + work with printer authentication enabled so long as + authentication isn't turned on for the whole "site". + - The IPP code didn't properly handle the "unsupported" + group; this caused problems with the HP JetDirect since + it doesn't seem to support the "copies" attribute. + - The HTTP chunking code was missing a CR LF pair at the + end of a 0-length chunk. + - The httpSeparate() function didn't handle embedded + usernames and passwords in the URI properly. + - Doing "lpadmin -p printer -E" didn't restart printing + if there were pending jobs. + - The cancel-job operation now requires either a + requesting-user-name attribute or an authenticated + username. + - The add-printer code did not report errors if the + interface script or PPD file could not be renamed. + - Request files are now created without world read + permissions. + - Added a cupsLastError() function to the CUPS API to + retrieve the IPP error code from the last request. + - Options are now case-insensitive. + - The lpq command now provides 10 characters for the + username instead of the original (Berkeley standard) + 7. + - The cancel command needed a local CUPS server to work + (or the appropriate ServerName in cupsd.conf) + - The cancel and lprm commands didn't report the IPP + error if the job could not be cancelled. + - The lp and lpr commands didn't intercept SIGTERM to + remove temporary files when printing from stdin. + - The lp and lpr commands didn't report the IPP error if + the job could not be printed. diff --git a/CHANGES-1.1.txt b/CHANGES-1.1.txt new file mode 100644 index 0000000000..2530640d37 --- /dev/null +++ b/CHANGES-1.1.txt @@ -0,0 +1,1699 @@ +CHANGES-1.1.txt +--------------- + +CHANGES IN CUPS V1.1.13 + + - Updated the default system group under MacOS X. + - If no SystemGroup was defined in cupsd.conf, the + system default group was not used. + - The cups-lpd mini-daemon now supports LPD clients that + send multiple control files. + - httpConnectEncrypt() now always uses encryption for + connections on port 443, since port 443 is reserved + for the "https" scheme. + - Group authentication via certificates did not work + from the web interface for accounts other than + "root". + - The serial port backend did not clear the OPOST + option, which could cause problems with some printers. + - The cups-lpd mini-daemon didn't lookup the client IP + address properly. + - The parallel backend now identifies the polled and + interrupt-driven devices under *BSD. + - The scheduler allowed the "always" encryption mode + inside a Location, which is not valid. + - The CUPS startup script now checks for the timezone + information under Linux. + - Now also map the sides attribute to the JCLDuplex + option (if present) in PPD files. + - Updated pdftops to Xpdf 0.93a. + - Added support for MD5 passwords under Slackware. + - Added new AuthType BasicDigest that does Basic + authentication using the MD5 password file managed by + the lppasswd command. + - The banner page attribute substitution code now + retains {name} sequences in banner files when the + named attribute is undefined. Use {?name} to + conditionally substitute an IPP attribute. + - The scheduler now ensures that the ServerRoot + directory and configuration files are owned by and + writable by the User and Group in cupsd.conf. + - The USB backend now lists all USB printer devices + regardless of whether a printer is connected or not. + This allows new USB printers to be connected without + restarting cupsd. + - Added some more minor performance tweeks to the IPP + protocol code to reduce copying and array indexing. + - The cupsaddsmb utility now uses the -c option with + smbclient and rpcclient to avoid the read length limit + for commands on the standard input. + - Added an include file to the CRD handling code in + pstoraster so that it would compile properly on 64-bit + pointer platforms... + + +CHANGES IN CUPS V1.1.12 + + - Added "Polish" to the list of known languages for PPD + files. + - Added missing directory definition to cups-config. + - The CUPS-Move-Job operation did not set the + destination type for the new destination. + - The CUPS-Add-Printer operation did not support the + allow=all or deny=none values to clear the per-user + printer ACLs. + - The SetPrinterAttrs() function did not handle invalid + PPD files that were missing the required NickName + attribute. It now looks for NickName, ModelName, and + then substitutes the string "Bad PPD File" for the + printer-make-and-model attribute. + + +CHANGES IN CUPS V1.1.11 + + - Added support for embedded TrueType fonts in PDF + files. + - Added support for PostScript functions in PDF + files. + - Added new "cupsaddsmb" utility for exporting + CUPS printer drivers to SAMBA/Windows clients. + - Added preliminary support for Darwin/MacOS X. + - The CUPS-Add-Printer operation no longer allows + arbitrary scheme names in device URIs to be used - it + now restricts the available schemes to those found in + the device list (lpinfo -m). + - The ippRead() and ipp_read_file() functions could not + handle more than IPP_MAX_VALUES (100) values in a + 1setOf attribute. These functions have been updated + to dynamically allocate more memory as needed, and the + IPP_MAX_VALUES constant now represents the allocation + increment. [this caused some versions of the + GIMP-print drivers to fail since the number of media + options exceeded 100...] + - The scheduler could crash when BrowseShortNames + was set to "No". + - The scheduler did not prevent MaxClients from being + set to 0, which could cause the scheduler to go in an + infinite loop when accepting a request. + - Made some performance optimizations in the ippRead() + functions to make IPP request/response processing + faster. + - The accept/reject/enable/disable command did not + support properly support the "-h" or default + server name. + - The scheduler did not save the quota configuration + when the job-quota-period attribute was set to 0. + - The LPDEST and PRINTER environment variables did not + support printer instances. + - The text filter now handles more types of boldface and + underline formatting. + - The cupsTempFd() function did not fail if the + temporary directory did not exist; this would cause it + to loop indefinitely instead of returning an error + (-1). + - Stopping (disabling) a printer class did not stop jobs + from printing to printers in that class. + - The cupsGetDests() function was sending the + requested-attributes attribute as a name instead of a + keyword; this caused a serious performance problem on + slower systems since more information had to be + transferred from server to client. + - The web interfaces did not always quote < and & in + things like the job title. This had the potential for + browser-based security violations (on the browser's + machine); bug report from SuSE. + - The scheduler now treats unauthenticated usernames as + case-insensitive when doing quota and allow/deny + processing. + - The lp command sent the "request ID is ..." message + to stderr instead of stdout... + - The PostScript filter (pstops) now handles EPS files, + adding a showpage command to the files as needed. + - The configure script checked for the header + file before the JPEG libraries; since the JPEG headers + can define HAVE_STDLIB_H, the configure check would + cause the JPEG check to fail on some systems. + - The scheduler now supports localized banner files, + using the subdirectory approach, e.g. the "es" + subdirectory under /usr/share/cups/banners is used for + the Spanish banner files. + - Updated the scheduler so it knows the correct + language abbreviation to use for all supported + PPD LanguageVersion values. The new code also + supports country codes as well, so "English-GB" + maps to the "en_GB" locale. + - The cups-lpd mini-daemon did not support + anonymous printing (no username specified). + While the username is REQUIRED by RFC-1179, + MacOS clients do not send the REQUIRED username + information when printing via LPD. + - Added many warning and informational messages + to cups-lpd where they were missing. + - Added Czech message file contributed by SuSE. + - The cups-lpd mini-daemon now returns a non-zero + status if an invalid destination or job ID is + provided. + - The scheduler did not honor the KeepAlive setting in + cupsd.conf. + - Increased the size of the file read/write buffers to + 32k. + - *BSD static library creation fixes. + - Use mkstemps() instead of tmpnam() in pdftops whenever + possible. + - Added httpGetHostByName() function as a wrapper around + gethostbyname() - some implementations of this + function do not support IP addresses (e.g. MacOS X.) + - Added casts to all printf's of file lengths, since + there is currently no standard way of formatting long + long values. + - The client filename field was not cleared in all + instances, resulting in old form data being submitted + to CGIs. + - The httpConnect*() functions now try all available + addresses for a host when connecting for the first + time. + - The pstoraster filter would "lose" all drawing + commands when the PageSize was set but the printer + bitmap was not reallocated. This was most noticeable + with the output from StarOffice 6 beta and would + result in a blank page being output... + - The IPP backend was sending a PAGE comment even when + printing the output from a filter (it should only send + page comments when printing files directly...) + - The pdftops filter didn't properly map glyph names of + embedded Asian TrueType fonts. + - Changed the CUPS startup script to look for a program + named "cupsd", not just any program with "cupsd" in + the name (this caused the apcupsd UPS monitoring + daemon to be stopped/restarted...) + - The CUPS-Move-Job operation did not change the + internal destination name for held jobs, so moved (but + held) jobs would still show up as queued on the + original destination. + - The cups-polld program didn't send the + requested-attributes attribute in the + CUPS-Get-Printers and CUPS-Get-Classes requests, which + made it use more CPU and bandwidth than required. + - The scheduler and CUPS API incorrectly added a + job-sheets-default attribute for remote printers. This + caused banner pages to be omitted from client system + prints. + + +CHANGES IN CUPS V1.1.10-1 + + - Minor fixes to the filter, systemv, and template + makefiles to install files properly. + + +CHANGES IN CUPS V1.1.10 + + - Added a driver for DYMO label printers. + - Added new ClassifyOverride directive to allow users + to override the classification of individual jobs. + - Added new BrowseProtocols directive to control which + browse protocols are used (currently CUPS and SLP). + - Added SLPv2 support (thanks to Matt Peterson for + contributing the initial implementation for CUPS.) + - Adding a raw printer on a remote CUPS server now + correctly redirects PPD file requests to the remote + server. + - The serial backend now limits writes to 1/10th + second worth of data to avoid buffer overflows + with some types of flow control. + - The scheduler did not properly process PUT requests, + so configuration files could not be uploaded to the + server. + - The scheduler did not strip trailing whitespace on + lines in the configuration files. + - The httpWrite() function did not transition the PUT + request to the HTTP_STATUS state to get the status + from the server. + - The scheduler did not properly handle trailing null + ("-") filters when testing a driver that sent data + to the file: pseudo-backend. + - The IPP backend now only sends a document-format of + "application/vnd.cups-raw" when printing to another + CUPS server using a local printer driver or interface + script. Previously the job's document format was + used, which was incorrect. + - The lpadmin command didn't use the ppd-name attribute + with the -m option; this prevented the use of the + "raw" model from the command-line. + - The pstoraster filter output draft (1-bit) 6-color + output in the wrong order; this resulted in yellow + being printed instead of black on Stylus Photo + printers. + - The pdftops filter did not have the Japanese and + Chinese text support compiled into it. + - The IPP and AppSocket backends did not clear the + "waiting for print job to complete" status message, + which caused some confusion... :) + - The serial backend now opens the port in "no delay" + mode to avoid DCD detection problems with some OS's. + + +CHANGES IN CUPS V1.1.9-1 + + - The configure script did not substitute the + correct user and group names. + - The configure script did not use the full path + to the install-sh script when it was used. + - The pstoraster filter did not correctly support + DuplexTumble mode for printers that used flip + duplexing. + - The cups.list.in file was missing from the + distribution. + - The New DeskJet series driver did not use the + correct OrderDependency for the Duplex option. + - Use read() instead of fread() to read piped + print files in lpr/lp. This avoids a bug in the + HP-UX 10.20 fread() function. + - Updated the pstoraster filter to use the MIPS_FIXADE + system call under IRIX to fix bus error problems on + R12000 processors (Ghostscript is not 64-bit clean...) + - Some Xerox PPD files (most notably the Phaser 790) + have illegal whitespace in the option keyword in the + OpenUI line. This caused the PageRegion option to not + be recognized properly for the Phaser 790. + + +CHANGES IN CUPS V1.1.9 + + - Revamped the configure script to use a modular + approach for the various tests. + - Added --with-openssl-* options to properly reference + the OpenSSL libraries in DSOs. + - Added --with-cups-user and --with-cups-group + options to specify the default user and group for + CUPS. + - Added AIX shared library support. + - Added AIX device discovery for the serial and + parallel ports. + - Now use install program or script to install + directories, files, and symlinks. + - Updated pstops filter to use strict handling of EPS + files embedded in a PostScript document. The %%EOF + handling in 1.1.8 caused some dvips files not to + print. + - Fixed yet another memory allocation bug in pstoraster + that would cause it to crash. This fix also ensures + that all memory allocations are done on (at least) a + 64-bit boundary. + - Fixed Digest authentication - httpGetSubField() didn't + skip the Digest keyword. + - The scheduler did not properly handle Digest + authentication with the new multiple-group support. + - The scheduler did not allow usernames that were + not in the UNIX password file to be used for Digest + authentication from passwd.md5. + - The scheduler could not scan PPD files that only used + a carriage return (i.e. MacOS PPD files); the new code + is also about 40% faster, so servers with thousands of + PPD files should start much faster now. + - The scheduler now stores the PPD file size and + modification times in the ppds.dat file, so it can now + incrementally update the PPD database from the model + directory, resulting in significantly faster startup + times. + - The lpinfo command did not return a non-zero status + code if an error occurred. + - Fixed a bug in the scheduler's UpdateJob() function. + Basically, all jobs shared the same status buffer, and + the "buffer start" pointer could point to 1 byte + before the beginning of the buffer. The new + implementation uses a separate buffer for each job and + eliminates the buffer start bug. + - The IPP backend would send N copies of a document if + the receiving device didn't support the copies + attribute, even if the upstream driver already added + the necessary commands to generate the copies. This + was most noticeable with HP printers where N * N + copies would come out instead of N. + - The PostScript filter (pstops) did not properly handle + duplex printing on inkjet printers that provide this + option. Copies would be put on the front and back + sides of the duplexed page, and the filter did not + output an even number of pages. + - The backends always caught SIGTERM after they + connected to the printer. This prevented raw jobs + from being cancelled early. + - The cupsSetDests() function now removes any printers, + instances, and options that are not defined by the + user or server. This should prevent old system-wide + options from being used in individual user accounts. + - Updated the EPSON printer driver and added PPDs for + the newer EPSON Stylus printers that only support the + "ESC i" graphics command. + - The lpadmin command didn't allow you to add remote + printers to a local class. + - The lpadmin command didn't allow you to set the + options (quotas, etc.) for a class. + - The scheduler did not load or save the + job-sheets-default attribute for classes. + - The scheduler did not automatically recreate remote + printers that were part of a class. + - It was possible for a printer class to list the same + printer more than once. + - The scheduler now makes a backup copy of classes.conf + and printers.conf before writing the new file. + - The lppasswd program incorrectly asked for a new + password when deleting an existing MD5 password + account. + - The scheduler did not match "/printers/name.ppd" + against a location of "/printers/name". + - The client code did not always handle HTTP encryption + upgrades properly. + - The client code now caches the last Digest password so + it can retry using a new resource path or nonce value, + which are included in the MD5 sum sent to the server. + This should eliminate unnecessary password prompts + when using Digest authentication. + - The lppasswd command didn't have a man page. + - Updated the PJL detection rules to allow the universal + escape to occur anywhere in the first 128 bytes of the + file. + - The cups-polld program would poll servers continuously + with no delay if there was an error contacting the + server. + - The IPP backend would send an empty job-name or + requesting-user-name attribute if the corresponding + job attribute was an empty string. While this is + allowed by the IPP specification, some HP JetDirect + implementations return a client-error-bad-request + error if an empty name attribute value is received. + The new code only sends these attributes if they are + not the empty string. + - At least some versions of the HP JetDirect firmware + do not correctly implement IPP. Added additional + checks to the IPP backend to eliminate extra, + unsupported attributes which should normally be + ignored by a compliant IPP device. + - The scheduler did not copy the complete list of + supported file types into the + document-format-supported attribute. This caused + clients to not send the local file type (such as + application/vnd.cups-raw for raw print files) and the + corresponding bad output in some cases. + - The scheduler did not fully copy attributes from a + set-job-attributes request - string attributes were + only referenced, which could cause cupsd to crash + or behave irratically. + - The lp command didn't send the right value for the + job-hold-until attribute when "-H resume" was + specified. + - The IPP backend now returns as soon as a job is + completed or reported as "pending-held". + - Added new ImplicitAnyClasses and HideImplicitMembers + directives to the cupsd.conf file to make implicit + classes more usable/transparent to the user. + - Clients can now (with the appropriate authentication) + retrieve and update the server configuration files + using HTTP GET and PUT requests. + - The web interface didn't allow you to modify the + location or description of the printer. + - The pdftops filter now uses its own temporary file + function to work with PDF files using LZW compression + (which use the uncompress program or gunzip) + - The SystemGroup directive now supports specification of + multiple groups. + - Added new Include directive to cupsd.conf, a la + Apache. + - Added new pseudo-driver/PPD called "raw" that can be + used to create/convert a raw queue. This also allows + raw queues to be created in the web interface. + - The pdftops filter didn't handle image objects that + used JPEG and Flate compression together. + - The pstops filter counted pages wrong when using the + N-up and even/odd printing options. This prevented + the page-ranges option from working properly. + - Added another fix to pstoraster for a bus error + condition caused by a lack of parenthesis in the + Ghostscript code. + - Added new "natural-scaling" option which scales the + natural size of the image (percent of natural image + size instead of percent of page size.) + - The lppasswd program is now setuid to the CUPS user + instead of root. + - The PPD functions did not allow for PPD files that + defined the page sizes and margins before the page + size options. + - The mime.types file now checks for the PJL "LANGUAGE = + Postscript" command for PostScript files. + - The scheduler did not truncate file: output files. + - The PPD file reading code did not handle options with + raw quotes (") in the human-readable names. + - The pdftops filter now remaps the space character when + (bad) PDF files contain a .notdef glyph for the space + character. + + +CHANGES IN CUPS V1.1.8 + + - Updated spec file to generate separate cups-pstoraster + package for pstoraster. + - The spec file wasn't setting LOGDIR in the install. + - The scheduler might restart a stopped printer after + stopping a print job. Thanks to Florent + Guiliani for finding this bug! + - The init script showed run level 0 for the Red Hat + chkconfig program. This is incorrect because Red Hat + doesn't use run level 0 for shutdown scripts. + - The IPP backend did not handle the + client-error-not-found error when checking the status + of the job that was sent. This caused remote queues + to stop on client machines when the server had job + history disabled. + - Added httpConnectEncrypt() function to avoid + performance penalty for setting up encrypted + connections initially. + - Use httpConnectEncrypt() in all client apps and in the + CUPS API to ensure consistent usage of encryption + throughout. + - Jobs weren't queued to remote classes (fix from + Richard Begg.) + - AIX changes from Richard Begg. + - Fixed the pstops fix for GNOME output - no longer use + the page numbers in the %%Page: comment since GNOME + puts a filename instead (!?@!#?!). There is still an + issue with N-up printing since GNOME defines its fonts + in the first page instead of the document setup section + (pages must be independent according to the DSC spec) + People with GNOME printing problems should consult bug + #54489... + - The imagetops filter produced PAGE: messages when + generating PostScript for a non-PostScript printer + (only affects page-label and Classification + options.) + - The updated pdftops filter was looking for an options + file called xpdf.conf instead of pdftops.conf. + + +CHANGES IN CUPS V1.1.7 + + - Configuration script changes, including new + "--with-docdir=/dir" option to relocate CUPS + documentation and web content according to your + favorite version of the FHS. + - Documentation updates for encryption, SLP, etc. + - New Software Test Plan and automated test script to + test CUPS prior to installation. + - All scheduler configuration files are now case + insensitive to match Apache. + - Added support for Apache ListenBackLog, LogFormat, + Require, UseCanonicalName, Satisfy, , + , LimitRequestSize, and Options + directives. + - Added support for all Apache log levels... + - Added support for "double" HostNameLookups. + - Added new "RunAsUser" directive to support non-root + configurations on the standard (priviledged) ports. + - Added support for non-root invocation of the lpd + backend (does no reserve a priviledged port, which + might not work with some LPD servers...) + - Added new PrintcapFormat directive to control the + output format of the printcap file (BSD or Solaris + formats are supported at present.) + - The CUPS directory service routines now handle + ECONNREFUSED errors gracefully rather than shutting + all browsing off. + - ippErrorString() now returns the recommended error + messages from the IPP/1.1 Model and Semantics + document. + - Fixed a minor IPP compliance issue with responses + to requests without the attributes-charset or + attributes-natural-language attributes. + - Sun fix: need httpFlush() call for chunked IPP + requests in cupsDoFileRequest(). + - httpConnect() now looks up "localhost" by name and + by address (127.0.0.1) for users the go to the + trouble of removing the required localhost entry + in /etc/hosts or on their DNS server... + - Added support for Linux 2.4.x devfs parallel port + filenames (/dev/parallel/N). + - cupsDo[File]Request() and cupsGetPPD() no longer + block trying to reconnect to a crashed or inaccessable + server. + - Added new ppdEmitJCL() function to better handle + PJL commands from PPD files. + - A bug in UpdateJob() would cause the scheduler to + consume 100% CPU until another request was submitted. + - The cancel command did not support the "-" option to + cancel all jobs on all printers. + - The cancel and lprm commands did not support cancelling + the next/current job in the queue. + - The pdftops and pstoraster filters were using unsafe + temporary file functions; while this is not a problem + in normal configurations (the CUPS temporary directory + is restricted), they now use the cupsTempFd() function. + - The mime.types file was missing the recognition rule + for Sun Raster images. + - The admin CGI was passing a printer make string to + ippSetCGIVars() that was being replaced in that + function. + - "lpoptions -l" would resave the options... + - The EPSON drivers now send the "end packet mode" + command when printing to USB devices. + - The scheduler initialized certificates before loading + the cupsd.conf file. + - The scheduler used /dev/random to collect random data, + which could block if insufficient entropy information + had been collected by the kernel. Now use + /dev/urandom. + - Fixed a bug in the whitespace skipping code in + httpGetSubField(). + - The LPD backend now supports a new "order" option: + "lpd://server/queue?order=control,data" (default) and + "lpd://server/queue?order=data,control". + - The scheduler enforced a 30 second timeout on all + clients regardless of the Timeout directive and if a + CGI was currently running. + - cupsParseOptions() now sets boolean options to + option=true or option=false. + - The "percent complete" calculations in the LPD backend + could overflow on large files, causing the percentage + to wrap to 0 every 40MB or so. + - Fixed a memory reallocation bug in pstoraster that + could cause it to crash. + - The LPD backend now sanitizes the job title to avoid + potential problems on remote LPD servers. + - The lp command did not send the requesting-user-name + attribute when altering a job. + - The pstops filter did not handle PostScript files with + lines longer than 8191 bytes. + - The scheduler no longer uses inet_addr() to convert IP + addresses in dot format (mmm.nnn.ooo.ppp) to the + 32-bit format, since it will not work for IPv6 + addresses. + - New "Classification" directive to force labeling of + the current classification on each page. + - New "page-label" attribute to add per-page labels + ("For Official Use Only", "Draft", etc.) + - The scheduler now sets the HTTPS environment variable + for CGI programs when a client connects using + encryption. + - Fixed a recursion bug in the scheduler that could + cause cupsd to crash when a printer was removed. + - The LPDEST and PRINTER environment variables didn't + support instances. + - Dropped the "file" backend from the device list that + is reported, since it is only available for *testing* + and should never be used in a production environment. + The file: device can still be used, but it won't show + up in the list of devices from lpinfo or the web + interface. + - Added support for /dev/lpa# parallel ports under *BSD. + - Added META variables to the CGI header template to + prevent caching of the results. + - Fixed an unaligned memory buffer for the pstoraster + clist states; this caused bus errors for some + combinations of printers, drivers, and options. + - Re-added black reduction for colorful colors; this + helps to prevent dark colors from getting desaturated. + (only used when converting RGB to CMYK) + - Added two new directives - MaxJobsPerPrinter and + MaxJobsPerUser - to allow an administrator to set + the maximum number of pending jobs in a queue or + submitted by a user. + - The scheduler no longer stops a printer if it can't + create the status pipe or run the filters or backend. + This will allow heavily loaded servers to service + clients or start print jobs as the load allows. + - Fixed a bug in the Set-Job-Attributes code that could + crash the scheduler (patch from Martin Zielinski) + - cupsSetDests() did not quote option values with + embedded spaces. + - Added support for the Enable-Printer and + Disable-Printer extension operations (same as + CUPS-Accept-Jobs and CUPS-Reject-Jobs.) + - The AppSocket and IPP backends now wait for the print + job to be finished before exiting; this should prevent + the loss of print jobs with older JetDirect firmware + and make consecutive print jobs print faster. + - The BMP loading code did not handle resolution values + of 0. This is a problem with BMP image files produced + by the GIMP. + - The HTTP Upgrade code (upgrade to TLS encryption) + bypassed the authentication checks. + - The HTTP Upgrade code did not send a 426 status code + to the client and end the current request. This caused + a race condition between the client and server for the + upgrade to TLS. + - Fixed a bug in the EOF and Trailer detection code in + the pstops filter. + - The imagetoraster filter did not add the margins to + the custom page size in the raster header. + - The imagetops filter did not adjust the custom page + size to the size of the printed image. + - The imagetops filter did not include DSC comments + which are required by some printers. + - The imagetops filter did not insert newlines in + Base85 encoded output, causing files to contain + lines longer than 255 characters (violation of the + DSC). + - Added support for the DeskJet 900 series duplexer + and CRET color modes in the HP driver. + - Added support for PPD-defined margins in the HP + driver. + - Fixed the debugging output from pstoraster - the + font list was not terminated by a newline. + - Some versions of the HP-UX pam_unix authentication + module apparently do not pass the appdata_ptr argument + to the conversation function, preventing the scheduler + from authenticating users using PAM under HP-UX. A + workaround using a static variable has been added to + address this problem. + - Fixed a bug in the scheduler SortPrinters() function + that could cause printers to disappear or the + scheduler to crash when adding a printer. + - Changed the pstops filter to not do per-page filtering + if the file does not conform to at least version 3.0 + of the document structuring conventions. This seems + to "fix" printing with broken apps. + - The image filters did not handle older TIFF files that + lacked the samples-per-pixel and bits-per-pixel tags. + - Added new cupsGetJobs() and cupsFreeJobs() functions + to manage print jobs. + - cupsEncodeOptions() would encode names of 0 length and + cupsAddOption() and cupsParseOptions() would add names + of 0 length. + - The scheduler might block waiting for status messages + after starting a new print job. Thanks to Florent + Guiliani for finding this bug! + + +CHANGES IN CUPS V1.1.6-3 + + - The configure script put the JPEG library before the + TIFF library; this caused problems in some + configurations since the TIFF library also supports + JPEG compression of TIFF images. + - Updated the configure script and makefiles to handle + admin man pages with the "1m" extension (HP-UX, IRIX, + Solaris, Tru64) and in odd directories (IRIX) + - The updated cupsTempFile() function did not return + the filename when called with a filename buffer of + NULL (previously it used a static buffer.) + - FreeBSD uses /dev/unlptN, but NetBSD and OpenBSD use + /dev/ulptN. + - DeletePrinter() didn't remove the printer from any + classes it was a member of. + - DeletePrinterFromClass() didn't preserve the + implicit status of a class. + - DeletePrinterFromClasses() didn't remove printers + from implicit classes. + - StartJob() didn't send the job-sheets, job-priority, + and job-hold-until attributes to remote printers. + - LoadAllJobs() was looking for job-sheets-completed + instead of job-media-sheets-completed. This would + prevent accumulation of page data after a restart + of the scheduler. + - The pstops and imagetops filters now generate copies + using the appropriate method for a Level 1, 2, or 3 + printer since some Level 2/3 printers don't support + the /#copies variable anymore. + - The man page for cups-lpd did not mention the "-o" + option. + - The IPP backend didn't handle version-not-supported + errors and revert to IPP/1.0 (previously it only checked + for a bad-request error) + - Caldera fix: lpc now reports unimplemented commands as + unimplemented, not invalid. + - Caldera fix: lpq didn't recognize BSD lpq "-a" option. + - Caldera fix: lpr didn't recognize BSD lpr "-1", "-2", + "-3", "-4", "-q", or "-U" options. + - RedHat fixes: patches to GNU Ghostscript + - SuSE fix: temp file creation patch to GNU Ghostscript + (pstoraster). + - SuSE fix: remove cgi-bin/abort.c and cgi-bin/email.c, + which are not used. + - SuSE fix: missing NULL check in cgi_initialize_post(). + - SuSE fix: potential buffer overflows in + cgi_initialize_string(). + - SuSE fix: potential buffer overflows in + ippSetCGIVars() + - SuSE fix: more NULL checks in ppdOpen(); also make + sure that all memory is freed on error to avoid memory + leaks. + - SuSE fix: Exit from child if setgid() or setuid() + fails. + - SuSE fix: Added setgroups() calls after setgid() and + setuid() calls. + - SuSE fix: potential buffer overflows in httpEncode64() + calls. + - SuSE fix: potential buffer overflows in httpSeparate() + - SuSE fix: potential buffer overflows in ippWrite() for + bad input. + - SuSE fix: potential nul skip in ppd_decode() for + missing hex digits. + + +CHANGES IN CUPS V1.1.6-2 + + - Added changes to support NetBSD startup scripts. + - Added separate compiler options for pstoraster + (Ghostscript) to avoid compiler-induced errors + from Ghostscript's twisted code. + - The mime.types file contained syntax errors. + - Updated the *BSD USB device filenames to use + the /dev/unlptN files so that the USB device + is not reset prior to printing (causes print + corruption on many printers) + - Added new cupsTempFd() function to avoid serious + security bug in glibc fopen() function. The glibc + fopen() function unlinks a file before creating it, + which opens up possible symlink attacks. + - Now reject 0-length names in add-printer and add-class + requests. + - Fix for pstoraster when ZLIB is not available. + - cupsGetPPD() didn't reconnect when a HTTP connection + was lost. + - SuSE fix: httpConnect() didn't check that the + value from gethostbyname() was a valid IPv4 address. + - SuSE fix: httpConnect() didn't allow file descriptor 0 + to be used for a socket. + - SuSE fix: ippRead() didn't confirm that all values in + a set were numeric or string types. + - SuSE fix: lppasswd race condition fixes. + - SuSE fix: directive names could overflow buffer when + reading *.conf files. + - SuSE fix: HEAD requests for PPD files did not use the + same logic as GET requests. + - SuSE fix: possible buffer overflow when adding + /index.html to requested directory name. + - SuSE fix: possible buffer overflow when converting + IPP attributes to string options for filters. + - SuSE fix: creating file: device output with mode 0666 + instead of mode 0600. + - SuSE fix: creating job info files with mode 0640 + instead of 0600. + - SuSE fix: don't rely on snprintf() for including + system name in log filenames. + - SuSE fix: add bounds checking when copying quoted + and hex strings. + + +CHANGES IN CUPS V1.1.6-1 + + - Added configure check for getting the correct + strftime() format string; %c is not Y2k safe, + and %KC and NULL are not universally supported. + + +CHANGES IN CUPS V1.1.6 + + - Fixed another possible DoS attack in httpGets() + - Added check for "LANGUAGE = PCL" and "LANGUAGE = + POSTSCRIPT" in mime.types. + - Resolution options were not being passed into the + filter programs properly. + - The default compiler options for GCC no longer include + "-g3", which apparently is deprecated in newer + versions of GCC. + - CheckJobs() could cause cupsd to crash if a job is + cancelled in StartJob(). + - The printers.conf and classes.conf files are now + written with restricted permissions. + - The round-robin algorithm used by FindAvailablePrinter() + had problems; fixes contributed by Joel Fredrikson. + - If LoadAllJobs() is unable to determine the file type + of a print job, assume "application/vnd.cups-raw". + - The web interface now provides a job_printer_name + value for any corresponding job_printer_uri value. + - The cups-lpd mini-daemon now logs the client address + and hostname as well as all commands and errors in the + syslog file. + - The IPP backend now detects the supported file formats + and only specifies the document format if it is + supported. This makes IPP printing to network print + servers and cards more reliable without affecting the + capabilities of CUPS servers. + - The time_at_xyz attributes are now converted to human- + readable dates and times for the web interfaces. + - The HP and EPSON sample drivers now correctly catch + signals and eject the current page when a job is + cancelled. + - Fixed bug in CGI code - did not ignore control + characters (e.g. newlines) in form data. This caused + sporatic web interface problems. + - The file type logging code in the scheduler referenced + the optional document-format attribute; the new code + uses the resolved MIME type instead. + - The client.conf parsing code now removes trailing + whitespace. + - The MaxJobs directive was being treated as a boolean + instead of an integer. + - The scheduler would not timeout remote printers if + BrowseInterval was set to 0. + - The lpadmin command now supports setting of options + and user-level access control. + - Added "-E" option to all printing commands to force + encryption. + - The client code did not consume the response to the + OPTIONS request when switching to secure mode. + - The scheduler did not output a Content-Length field + when responding to an OPTIONS request. + - Added documentation on using cups-lpd with xinetd + to the man page. + - The socket backend now starts retries at 5 seconds and + increases the interval to 30 seconds. This should + provide faster printing when multiple jobs/files are + queued for a printer. + - The filters and backends no longer buffer output to + stderr. This should provide much more accurate status + reporting. + + +CHANGES IN CUPS V1.1.5-2 + + - Fixed configure check for OpenSSL to work with RSA + code. + - Added configure check for , and use this + check in backend/serial.c. + - Updated configure script handling of data, + configuration, and state directories to use datadir, + sysconfdir, and localstatedir variables. + - NetBSD uses different serial port filenames than + FreeBSD and OpenBSD. + - The pdftops filter didn't need some X-specific files. + - The scheduler makefile doesn't do a chown anymore when + installing (cupsd did this automatically on startup + anyways) + + +CHANGES IN CUPS V1.1.5-1 + + - There was a typo in the top-level Makefile + - The top-level Makefile did not install an init script + for run level 5. + - The configure script did not add the "crypto" library + when checking for the OpenSSL library. + - The OKIDATA PPD files were missing. + - The config.h.in file defined the wrong version number. + - The serial backend did not define "funky_hex" under *BSD. + - Updated the Visual C++ project files and some of the + CUPS API sources to compile under Windows again. + + +CHANGES IN CUPS V1.1.5 + + - Security updates - new default configuration does + not broadcast printer information and only allows + access from the local system. + - EXPERIMENTAL encryption support - CUPS now optionally + supports TLS/SSL encryption via the OpenSSL library. + - Documentation updates. + - Makefile/configure script updates. + - The RPM spec file didn't work out-of-the-box under + RedHat or Mandrake. + - Minor code cleanup to remove extraneous compiler + warnings. + - cupsTempFile() was using %p for the temporary + filename; this should have been %08x (just 8 digit + hex) + - Deleting a printer with active print jobs would still + crash the server. + - ippWrite() and ipp_write_file() didn't send the + correct value length for name-with-language and + text-with-language attributes. + - Updated IPP code to support copied strings (that + should not be freed); this provides slightly more + efficient IPP server performance. + - Updated PDF filter to Xpdf 0.91. + - httpGets() could go into an infinite loop if a line + longer than the input buffer size was sent by a + client. This could be used in a Denial-of-Service + attack. + - The lpstat and CUPS API functions now request only the + data required when getting the list of printer or + class information. This should improve performance + with large numbers of printers on slower machines. + - The scheduler was always enforcing the FilterLimit, + even if FilterLimit was set to 0. + - Updated the Linux USB backend to support Mandrake's + /dev/usb/usblp# filenames. + - The PRINTER and LPDEST environment variables did not + override the lpoptions default printer. + - The PPD read functions incorrectly included trailing + characters (usually whitespace) after quoted string + attributes. + - The multiple-document-handling attribute handling code + did not check for the correct value for collated + copies (separate-documents-uncollated-copies). + - The EPSON driver did not work with OKIDATA printers in + EPSON emulation mode (needed change-emulation command) + - The HP-GL/2 filter did not scale the plot properly in + scale mode 2. + - Added PPD files for 9-pin and 24-pin OKIDATA printers. + - The httpSeparate() function didn't handle passwords + that started with a number. + - ippDelete() could free the character set string + multiple times in name-with-language and + text-with-language attributes. + - The scheduler would access freed memory right after + freeing it (for debug messages); these parts of the + code have been reordered to avoid this situation + which was causing sporatic errors and crashes. + - The ppdClose() function didn't free all of the strings + in the ppd_file_t structure. + - The LoadAllJobs() function in the scheduler did not + close the spool directory. + - Changed all sprintf's that use string formats to + snprintf's, even if the destination buffer is + larger than the source string(s); this protects + against buffer overflows caused outside of CUPS... + - Changed all strcpy's to strncpy's between local and + global variables, even if the destination buffer is + larger than the source string; this protects + against buffer overflows caused outside of CUPS... + - The CUPS certificate functions didn't use the + CUPS_SERVERROOT environment variable when set. + - The directory services code was copying instead of + comparing the remote printer info, resulting in + unnecessary updates of the printer attributes for + remote printers. + - Added new mime.types rules to allow automatic raw + printing of PCL and ESC/P files; PJL headers are + parsed to differentiate between PostScript and + PCL job files. This should eliminate a lot of + the reports of SAMBA printing problems due to + the missing "-oraw" or "-l" options. + - The mimeLoadType() function didn't handle the + 3-argument contains() function. + - The LoadPPDs() function in the scheduler didn't + properly set the alloc_ppds variable or handle a PPD + database containing 0 printers. + - The scheduler FindAvailablePrinter() function didn't + use the same queuing logic as the CheckJobs() + function. This caused classes to stall if a remote + printer was always busy. + - Jobs are now assigned to printers in a class + round-robin style. This should prevent the first + server in the class from bearing the brunt of the + jobs. + - The scheduler's LoadAllJobs() function didn't always + restore remote printers for queued jobs on startup. + - The serial backend didn't support the higher baud + rates with the old termios interface. It now supports + 57600 and 115200 baud. + - The serial backend now supports different types of + flow control; previously it ignored the flow=XYZ + option in the device URI. + - The serial backend now supports DTR/DSR flow control, + which is popular on dot-matrix printers (access with + "flow=dtrdsr" in the device URI) + - Added new job-originating-host-name attribute for + jobs. The new attribute provides the hostname or + IP address of the machine that submitted the job. + - The set-job-attributes code no longer allows read-only + job attributes to be changed. + - Expanded the click area for the navigation bar in the + web interface. + - Updated the lp and cancel commands to support all of + the Solaris print options (some are simply ignored + since they do not map) + - Updated the scheduler to limit the number of file + descriptors to the maximum select() set size. This + was causing problems on Solaris systems where the + max FD count was increased beyond 1024. + - The scheduler's LoadDevices() function was getting + interrupted by the SIGCHLD signal handler; now ignore + child signals while loading devices. + - Added quota and allow/deny user support for printers + and classes. + - Removed black/CMY adjustment code from the PS and + image file RIPs; it was interfering with some CUPS + driver dithering code. + - The lpc program stopped listing the queue statuses + after the first active printer. + - The cups-lpd program used an output format that the + Solaris printing system did not understand. + - Updated the lpq program to use the Solaris format + except under Tru64 UNIX. + - Some DEC PPD files incorrectly use "Off" for the null + value in UI constraints. Added "Off" to the list of + accepted null values. + - Changed the *BSD define constants to __*BSD__ in all + of the backends. + - Added support for "lpstat printername", which is an + undocumented feature in Solaris. + - The HP-GL/2 filter now only sets the plot size if it + is set in the plot file. + - The lpmove command wasn't sending the requesting + user name, causing it to always fail. + - Updated the cupsTempFile() code to use GetTempPath() + under Windows. + - The cups-lpd mini-daemon didn't limit the number of + data files accepted, didn't use cupsTempFile(), + didn't handle control file job information in any + order, and didn't free job options after printing + a file. + - The scheduler copy_banner() function did not + explicitly set the owner and permissions of the banner + files, which could prevent the banner pages from + printing on some systems. + - The lpstat program wasn't listing remote classes. + - The scheduler did not verify that the printer-uri + attribute was specified in all requests that required + it. + + +CHANGES IN CUPS v1.1.4 + + - Makefile and configure script fixes. + - **** Changed the default Printcap setting **** to + /etc/printcap. There are just too many people asking + why application XYZ doesn't see their printers! + - The web admin interface now displays an error if it + can't get the list of printer drivers from cupsd. + - The IPP backend was putting the copies option before + the other job options were set. This caused the IPP + request to contain attribute groups in the wrong + order, which prevented remote printing. + - Added checks in scheduler to free memory used for + IPP requests and language information when closing + a client connection. + - Fixed the duplex option in the HP LaserJet driver. It + should now work with all LaserJet printers (and + compatibles) + - The add-printer web interface didn't initialize the + "old info" data pointer, which caused random crashes + on many OS's. + - Fixed many page sizes defined in the Level 1 + compatibility file "gs_statd.ps" to match reality. + - Fixed another bug in the setpagedevice "code" in + Ghostscript. It should now accept all standard + Adobe attributes on all platforms. + - Fixed pstoraster so that it reallocates memory for + color depth changes as well as size/resolution + changes. This removes an ordering constraint on + the color, page size, and resolution options in + PPD files. + - The IPP backend didn't use the job's character set + when the destination printer supported it. This + caused problems when printing text files to other + CUPS servers. + - Updated the logic used to determine when to rebuild + the PPD file database. The scheduler now checks the + dates and the number of PPD files (was just checking + the dates.) + - Updated the ippSetCGIVars() function (used by the + web interfaces) to only filter valid string values. + - The PostScript filter was scaling 2-up pages + incorrectly. This caused the edges of some pages to + be clipped. + + +CHANGES IN CUPS v1.1.3 + + - Makefile fixes. + - RPM spec file changes. + - Documentation updates. + - Enabled pstoraster debug messages for everything + (only logged when LogLevel set to "debug"...) + - Changed the Input/OutputAttributes fix in + pstoraster so that it works on all platforms. + - The HP-GL/2 filter didn't set the right green + color value in encoded polylines or text. + - Updated the "fitplot" code to handle plot sizes + specified as "PSwidth,length" and "PSlength,width". + - Updated the Linux parallel and USB backends to open + the device files prior to looking in /proc for + autoprobe info. This makes sure that loadable device + driver modules are in fact loaded... + - Added new FilterLimit directive to limit the number + of processing jobs/filters on a system. + - set-job-attributes didn't change the job-state to + held/pending when the job-hold-until attribute was + specified. + - set-job-attributes didn't save the new job attributes. + - Now change the "requesting-user-name" attribute in + requests from remote systems to "remroot" when an + unauthenticated "root" user is sent. This can be + changed using the new RemoteRoot directive in + cupsd.conf. + - The cancel-job, hold-job, release-job, and restart-job + operations didn't log the authenticated username. + - The cups-lpd mini-daemon now checks for a + document-format option before forcing raw mode with + filter mode 'l'. + - The cups-lpd mini-daemon now supports "-o" options + on the command-line (passed by inetd) to set global + defaults for all print queues. + - The pstops filter assumed that a file with a Trailer + comment would also have an EOF comment. + - Added new cupsSetPasswordCB(), cupsSetServer(), + cupsSetUser(), and ippSetPort() functions to better + support client applications (especially GUIs...) + - The CUPS-add-class and CUPS-add-printer operations + didn't reset the printer-name attribute on remote + print queues that had to be renamed when a local + printer was defined with the same name. + - The lpoptions command now supports a "-r" option to + remove options for a printer or instance. + - The lpadmin and admin.cgi programs no longer allow + class and printer names to begin with a number; this + caused the command-line utilities to become confused. + - The Linux USB backend now looks for both the parallel + and usblp driver names in the device list. + - Added a new FontPath directive to cupsd.conf, and also + a "--with-fontpath" option for the configure script to + specify alternate font paths for pstoraster. + - The CUPS-move-job operation didn't update the + job-printer-uri attribute. + - The scheduler only looked up printers and classes by + name in IPP requests, instead of using the full URI. + This caused problems with KUPS and friends with + remote printers. + - The scheduler now handles better localization of + hostnames (e.g. server is host.foo.com, remote is + host.subfoo.foo.com, localized is not host.subfoo...) + - The scheduler logging functions now use a common + log file checking/rotation function (courtesy of + Crutcher Dunnavant at Red Hat) + - The scheduler could accept more client connections + than it allocated for if more than one Port or Listen + line was present in cupsd.conf. + - Other minor scheduler performance tweeks. + - The lpq and lprm commands didn't support the default + printer set using lpoptions. + - The lpoptions command now supports a "-l" option to + list the printer-specific options and their current + settings. + - The web printer and class lists now show a link to the + default printer or class at the top of the page. + - The text filter now supports pretty printing of shell + and perl scripts as well as C/C++ source files. + - The top and bottom margins were reversed for landscape + text printing. + - The lpq and lprm commands didn't understand printer + instances. + - The scheduler only selected on the first 100 file + descriptors instead of the maximum file descriptor + limit. + - The scheduler client, listener, and mainline functions + now share code to disable and enable monitoring for + new client connections. + - The imagetoraster filter didn't support all of the + required pagedevice parameters. + - The serial backend now checks for 100 serial ports + under Linux. + - The scheduler used sscanf() to pull out the remote + printer location, description, and make/model strings, + but if any of these options was empty then sscanf() + would stop processing. + - Added "debug2" log level to provide a little less + verbose debugging information at the "debug" level. + - The scheduler would crash if you stopped a printer + that was currently printing a job. + - The scheduler incorrectly allowed jobs in the cancelled, + aborted, or completed state to be cancelled. + - The image filters did not load TIFF images properly + for bottom-to-top and right-to-left orientations. + - Added new cupsEncodeOptions() function to encode + CUPS options as IPP job attributes. + - The IPP backend, LPD mini-daemon, client commands, + and CUPS API did not properly encode multiple + option values separated by commas. + - Added new scheduler malloc logging in debug mode + (provides summary of total arena size, allocated, + and free bytes once a minute) + - The EPM-based distributions didn't install the + correct symlinks for a few man pages. + - Fixed a memory leak in the scheduler - wasn't + freeing old filters when deleting or renaming + printers. + - The scheduler now queries the primary IP address + for the name of the server and maps any incoming + requests from that address to the server name. + This fixes web admin mapping problems from + server.domain.com to localhost. + - The web printer modify interface now remembers + the previous device and driver settings (except + for serial ports.) + - The job-k-octets attribute is now stored as part of + the job attributes; this preserves the information + after a job is completed when job file history is + turned off. + - Dropped option sub-group parsing code for the moment, + since many Xerox PPD files abuse this feature in PPD + files and don't follow the hierarchy rules. + - Added new wrapper code around options so that duplex + options for some HP printers don't prevent prints. + - Added support for Digital UNIX/Tru64 UNIX/OSF/1 format + for "lpstat -v" output. + - Now show the URI for remote printers instead of + /dev/null in "lpstat -v" output. + - Creating classes and adding printers to a class with + the lpadmin command didn't work. + - The banner pages and test page should now format + correctly in both portrait and landscape orientations. + - Updated banner page substitution so that { can appear + by itself without quoting. + + +CHANGES IN CUPS v1.1.2 + + - Makefile/configure fixes + - RPM spec file and EPM list file fixes + - The cupsTempFile() function now uses a different + algorithm for generating temp files and "reserves" + them to avoid possible security exploitation. + - Now use /dev/random (if available) to seed the random + number generator for certificates. + - The /var/spool/cups and /var/spool/cups/tmp directories + were incorrectly owned by root; they are now owned by + the filter user, typically "lp". + - The scheduler now resets the permissions on the spool + and temp directories as needed to match the filter + user. + - Now expose ppdCollect() as an externally callable + function. + - The image filters now support filtering from the + standard input. + - The imagetoraster filter now collects all printer + options and job patch files and applies them to the + page header as needed. + - Added format and banner options to LPD backend. + - The send-document operation didn't start a job + immediately when last-document was true. + - The set-job-attributes operation didn't correctly + replace the current job-hold-until value. + - Removed the option wrapper code from ppdEmit() and + friends since it caused problems with Ghostscript + and many PS printers. + - Was setting TZ environment variable twice for job + filters. + - Added syslog logging in cups-lpd to aide in + debugging problems. + - The HP-UX parallel port backend did not list the + available parallel ports on some systems (printf + calling problem...) + - The lp and lpr commands overrode user options if + -d/-P were specified after -o. + - The scheduler would crash with a */* filter. + - Added support for a "default" filter for unknown file + types. The example provided in the mime.types and + mime.convs file prints unknown files as if "-oraw" was + specified for the job. This functionality is disabled + by default. + - The "compatibility" mode fix for older backends did not + work for smbspool. Added a workaround for it. + - The HP-GL/2 filter didn't perform the right pen scaling + with some files and the "fitplot" option. + - New Software Performance Specification document that + describes the memory, disk, and CPU usage of all the + CUPS software. + + +CHANGES IN CUPS v1.1.1 + + - The pstoraster Makefile still referenced one of the + old PDF filter files. + - The filter Makefile used INSTALL_DATA instead of + INSTALL_LIB to install the CUPS image library. + - The administration CGI didn't work properly with + network devices. + - The BrowseACL variable was not updated after the + cupsd.conf file was loaded. + - The lpd mini-daemon didn't support printer instances. + - Now use a default umask of 077 for child processes. + - Now put temp files in /var/spool/cups/tmp for child + processes and the root user, unless TMPDIR or TempDir + is defined otherwise. + - cupsGetPPD() no longer uses easy-to-guess filenames. + - The CUPS-Delete-Class and CUPS-Delete-Printer + operations now save classes.conf file as needed. + - The lppasswd command wouldn't add a user. + - The ppdOpen() function could cause a segfault if a + 0-length PPD file was read. + - The image filters were not handling images with + different X and Y resolutions properly. + - The imagetoraster filter defaulted to RGB output + instead of black output like pstoraster. + - The pstops filter didn't handle binary data properly. + - The pstops filter didn't handle copies properly for + PS files lacking DSC comments. + - The pstops filter now appends %%EOF to the end of + documents if they don't have it. + - The cupsGetPPD() function didn't work with remote + printers lacking the @server in the name. + - The configure script didn't work right when only + --prefix was specified. + - The ppdEmit() code now wraps all printer commands so + that buggy PostScript printers will still print a file + after receiving an option that isn't available. + - Fixed the DeskJet margin bug, and disabled 600dpi + color mode until it can be fixed. + - The cupsAddDest() function didn't sort instances + correctly in all cases. + - The time-at-xyz attributes now expand to the date and + time in banner files. + + +CHANGES IN CUPS v1.1 + + - Documentation updates. + - Configuration script updates. + - Didn't map charset and language value strings to lowercase + and _ to - as required by SLP and IPP. + - ppdLoadXYZ() didn't add the list of available fonts to the + ppd_file_t structure. + - The text filter common code was freeing the PPD file data + before it was used. + - The text filter now embeds missing fonts. + - The CGI interface now maps local access to the server to + the localhost address. + - The HP-GL/2 filter didn't use the specified (or default) + color ranges, resulting in strange colors. + - The HP-GL/2 filter didn't default to no input window, which + caused unnecessary clipping of plots. + - Integrated Xpdf's pdftops filter into CUPS, which is a + lightweight and reliable replacement for Ghostscript's + PDF support. + - Removed all PDF support from Ghostscript. + - Updated HP driver to set top margin; this seems to fix + the offset problem seen on HP DeskJet printers. + - Fixed dependencies on the ZLIB and JPEG libraries in + pstoraster. + - The lpr command wasn't using the lpoptions defined by + the user. + - The lpr command would segfault if the CUPS server was + not running. + - The top-level makefile was not installing the CUPS + initialization script. It now does so if it sees there + is an init.d directory in /sbin, /etc/rc.d, or /etc. + - "lpstat -v all" didn't work. + - pstoraster would crash on some platforms doing the + setpagedevice operator. + - The web administration interface now allows you to set + the default banner pages. + - Images can now be positioned on the page using the new + "position" option. + - The AccessLog, ErrorLog, and PageLog directives now + support "%s" to insert the server name. + - Added a new BrowseShortNames directive to allow for + short remote printer names ("printer" instead of + "printer@server") when possible. + - The scheduler could crash if given an invalid PPD file + with no PageSize attributes. + - Updated the serial, parallel, and usb backends to do + multiple writes and ignore ioctl() errors as needed; + this should fix problems with serial printing on old + serial drivers and with the UltraSPARC parallel port + driver under Solaris 2.7. + - Now propagate LD_LIBRARY_PATH to child processes from + cupsd. + - New DataDir directive for installing in alternate + locations. + - New CUPS_SERVERROOT and CUPS_DATADIR environment + variables to specify installation directories as + needed. + - Queued remote jobs recreate remote printers as needed + when the scheduler is started. + - Deleting a printer also purges all jobs on that + printer. + - Old job and control files that don't belong to a + printer are automatically deleted. + - Wasn't updating time-at-processing and + time-at-completed attributes in job. + - Didn't send required multiple-operation-time-out + attribute in response to a get-printer-attributes + request. + - cups-lpd now supports options set with lpoptions. + - The job-hold-until attribute is now provided with all + jobs. For jobs that are not currently held the value + is "no-hold". + - The scheduler was not sending "unknown" values in IPP + responses. + - The lpoptions command now accumulates options from + previous runs rather than replacing all options for a + printer. + - The IPP backend now switches to IPP/1.0 if a 1.1 + request fails. + - The lpadmin and admin.cgi programs now validate new + printer and class names. + - The access_log file now includes the number of IPP bytes + received in a POST request. + + +CHANGES IN CUPS v1.1b5 + + - Documentation updates. + - The pstoraster filter didn't compile without the JPEG library. + - The cupsd server didn't support the HTTP OPTIONS request + method. + - Dropped the "CLOSE" method supported by the cupsd server. + (not defined in HTTP specification) + - Makefile/configure script fixes. + - Missing the job-restart template. + - Added IPP test suite for testing. + - Missing IPP documentation from binary distributions. + - Fixed multiple-document handling code when last-document + not specified. + - Added more checks to IPP requests to prevent bad requests + from getting through. + - Not all of the Ghostscript error output was being sent to + stderr. + - The PostScript filter now added PJL commands to set the + job name and display string, if supported. + - The scheduler would crash if the browse socket could not + be bound. Now disables browsing if port 631 (reserved for + IPP) is being used by a misbehaving daemon. + - The USB backend now looks for the older Linux 2.2.x USB + printer device filenames as well as the newer ones. + - The IPP backend now uses the UTF-8 charset exclusively, + since apparently only CUPS handles more than US-ASCII and + UTF-8... + - Wasn't quoting ( in PostScript banners... + - Send-document requests with no document-format attribute + could cause cupsd to crash. + - Old jobs in the spool directory might cause cupsd to + crash. + - CUPS now supports all of the recommended job-hold-until + keywords as well as name values of the form "HH:MM" and + "HH:MM:SS". + - Added placeholder pointer for TLS encryption to the HTTP + connection structure. + - Fixed the "fast poll" bug reported by DISA - the + status pipe wasn't being closed for multi-file jobs. + - Revamped put_params code in pstoraster to fix bitmap + allocation bug with FrameMaker output. + - Ripped out filename, etc. code from pstoraster as it + is a potential security hole. + - Added support for RIP_CACHE environment variable in the + new pstoraster. + - Fixed USB device filenames for Linux; now support new + pre-2.4 devices (/dev/usb/lp#) and 2.2 devices + (/dev/usblp#) + - Fixed accept-jobs crash with classes. + - Didn't include dot-matrix EPSON drivers in previous + release. + + +CHANGES IN CUPS v1.1b4 + + - Documentation updates. + - Many makefile and configuration script fixes (should + now compile better under *BSD.) + - The MediaPosition attribute was being mishandled by + GhostScript, causing the RIP to fail whenever a paper + tray was selected. + - The scheduler now logs the final line of log information + from a filter, even if it doesn't end with a newline; this + primarily affects GhostScript error output. + - The scheduler was saving implicit classes, so after a few + restarts you'll end up with AnyPrinter, AnyAnyPrinter, etc. + - The JPEG autodetection didn't work with some JPEG files that + came from digital cameras (JPEG but not JFIF); the new + magic types should work with all images that the JPEG library + can handle. + - Fixed a bug in the new contains() MIME type rule that could + cause cupsd to crash. + - Switched to using strtol() in the MIME type code so that you + can use hex, octal, or decimal constants as desired in the + mime.types file. + - Banner files are now treated as templates, allowing any type + of file to be used as a banner. + - Added a 30-second timeout to backend device reports so that a + hung backend will not prevent the scheduler from starting. + - Backends are once again terminated when jobs are stopped; the + CUPS-supplied backends will stay alive until the downstream + filters have had a chance to clear out old page data. + - The charset lookup in the CUPS localization support was wrong + (iso8859-x instead of iso-8859-x) + - Changed the "cpNNNN" code page files to "windows-NNNN" to match + the IANA registrations. + - New PostScript banner pages. + - Added Windows BMP and Alias PIX image file support to the image + filter. + - The PNG reading coded didn't free all of its buffers. + - Added Digest authentication support to the client and server + code. + - Added Solaris options to System V commands. + - Now support the output-bin job template attribute. + - Now log the job-billing attribute in the page_log file, and + keep track of the total number of pages in the + job-media-sheets-completed attribute. + - The penwidth option is now in micrometers to support more + accurate width specification. + - The image filters now support interlaced and transparent PNG + files. + - Didn't handle Keep-Alive for HTTP/1.0 clients. + - The BrowsePoll support didn't handle when BrowseInterval + was set to 0 (now uses 30 seconds if BrowseInterval is 0) + - The DeskJet driver now supports 600 DPI color for printers + that support it. + - New lpinfo and lpmove commands. + - The lpq command now supports the Digital UNIX output format. + - The LPD mini-daemon now supports all required LPD operations. + - Implemented timeouts for multi-file documents. + - New cupsPrintFiles() function in the CUPS API library to + print multiple files using create-job and send-document + requests (1 job ID for multiple files) + - The lp command now sends multiple files as a single job, + matching the behavior of the System V command. + - The "cancel -a" command now purges job history files. + + +CHANGES IN CUPS v1.1b3 + + - Documentation updates. + - The startup script redirected stderr before stdout, + which caused problems with some versions of Bourne + shell and Bash. + - Fixed a bug in the scheduler's PPD language reading + code. + - Fixed a bug in the scheduler's check for the + manufacturer in the PPD. + - The pstoraster filter didn't allow some input and + output attributes to be set. + - Added banner page support. + - Added missing PAM configuration file. + - Configuration script fixes for Linux and *BSD. + - The log file code was using the wrong sign for the + timezone offset. + - The default printcap file is now empty (no printcap + file is generated). + - The scheduler did not start jobs destined for remote + printers when they became available. + - The scheduler now sends jobs to remote printers + immediately. (when sending jobs to a class, the remote + printer is only used when it becomes available) + - The scheduler now supports printing of banner pages + via the job-sheets attribute (banner files go in + /usr/share/cups/banners) + - The cupsd process now forks itself into the background + (override with -f) + - Added several *BSD enhancements. + - Added UNSUPPORTED libtool option to configuration + script to allow the use of libtool. Note that this is + UNSUPPORTED by us, but added by request of the *BSD + folks. + - The parallel, serial, and usb backends now retry the + opening of their ports. This allows multiple print + queues to be associated with a single physical port, + and will allow CUPS to support several types of + parallel port auto-switches in the near future. + - Set-Job-Attributes now supports adding, changing, and + deleting job template attributes, and no longer allows + job-printer-uri to be set (see CUPS-Move-Job) + - Added CUPS-Move-Job operation to support moving of jobs. + - The CGI template functionality now supports multiple + languages (still only have templates for English) + - The CUPS-Get-Printers and CUPS-Get-Classes operations + now support filtering as defined in the IDD. + - The Get-Jobs, CUPS-Get-Printers, and CUPS-Get-Classes + operations no longer limit themselves to 1000 jobs, + printers, or classes (believe it or not, this is + needed for some sites) + - The web interfaces now support language-specific + templates. + - The web admin interface now supports class management. + - The web admin interface now shows a list of + manufacturers before selecting the PPD/driver for a + specific printer. + - The web admin interface now supports configuration of + the default printer options in the PPD file. + - The web interface now uses printer/class + authentication for the test page instead of admin + authentication. + - Updated the RPM spec file for the current release. + - Updated language support for Windows code pages. + - 8-bit character set files can now use multiple fonts + (needed for Arabic, Greek, Hebrew, etc.) + - Added basic right-to-left text support in the text + filter. + - The POSIX locale now uses ISO-8859-1 instead of + US-ASCII. + - Fixed PDF printing problems. + - Fixed PostScript RIP page device dictionary elements + that weren't getting passed in cups_get_params(). + - Added a new "contains" rule for the magic file typing. + - The "printable" rule now accepts characters from 128 to 255 + (needed for Microsoft character sets) + - Added support for ~/.cupsrc as well as /etc/cups/client.conf + so that the default server can be configured on a per-user + basis without environment variables. + - Added LPD mini-daemon to support incoming LPD jobs. + + +CHANGES IN CUPS v1.1b2 + + - Documentation updates. + - The lp command didn't always load the user-defined + destinations, preventing it from seeing the default + printer. + - Many configure script and makefile fixes. + - The Microsoft code page files were missing from the + distribution. + - Added a workaround for the HP IPP client (which is sending + an invalid printer-uri in requests) + - Fixed the encoding of text-with-language and name-with-language + to match the IPP spec. + - Added support for unknown value tags in the IPP routines + (previously they would be ignored) + - Integrated GNU GhostScript 5.50 into the pstoraster filter. + - Client hostname resolution was broken on little-endian + machines. + - Now look at client.conf file for client's default server + and printer. + - The cupsServer() function did not close the client.conf file + if it contained a ServerName directive. + - Added BrowseAllow, BrowseDeny, BrowseOrder, BrowsePoll, and + BrowseRelay directives. + - BrowseInterval 0 disables advertising of local printers, but + still receives information on remote printers. + - New browse polling daemon (for polling servers on different + networks) + - New PPD cache file for faster startup times with large numbers + of PPD files. + - The Host: field was incorrectly required for HTTP/1.0 clients. + - New set-job-attributes operation now supported. + - The mime_load_types() and mime_load_convs() functions did not + close their input files. + + +CHANGES IN CUPS v1.1b1 + + - NEW web-based administration interface. + - NEW EPSON printer drivers. + - NEW user-defined printers and options. + - NEW persistent jobs and job history + - NEW IPP/1.1 support + - NEW template-based web interfaces. + - NEW CUPS-get-devices and CUPS-get-ppds operations. + - NEW support for create-job and send-file operations. + - NEW certificate-based authentication for local + administration. + - NEW USB backend. + - The lpr command now produces human-readable error messages. + - The lpq command now produces BSD standard format output + instead of OSF/1 output. This should resolve the SAMBA + print queue problems that have been reported. + - The IPP backend did not always detect when the "raw" option + was being used. + - The "lpstat -p" command would stop after the first active + printer. + - The "lpstat -v" command would stop before the first remote + printer. diff --git a/CHANGES.txt b/CHANGES.txt index 6a8ce709da..a5bebd7739 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,1921 +1,11 @@ -CHANGES.txt - 12/28/2001 +CHANGES.txt - 12/29/2001 ------------------------ CHANGES IN CUPS V1.2.0a1 - New ippReadFile(), ippReadIO(), ippWriteFile(), and ippWriteIO() functions in CUPS API. - - -CHANGES IN CUPS V1.1.13 - - - Updated the default system group under MacOS X. - - If no SystemGroup was defined in cupsd.conf, the - system default group was not used. - - The cups-lpd mini-daemon now supports LPD clients that - send multiple control files. - - httpConnectEncrypt() now always uses encryption for - connections on port 443, since port 443 is reserved - for the "https" scheme. - - Group authentication via certificates did not work - from the web interface for accounts other than - "root". - - The serial port backend did not clear the OPOST - option, which could cause problems with some printers. - - The cups-lpd mini-daemon didn't lookup the client IP - address properly. - - The parallel backend now identifies the polled and - interrupt-driven devices under *BSD. - - The scheduler allowed the "always" encryption mode - inside a Location, which is not valid. - - The CUPS startup script now checks for the timezone - information under Linux. - - Now also map the sides attribute to the JCLDuplex - option (if present) in PPD files. - - Updated pdftops to Xpdf 0.93a. - - Added support for MD5 passwords under Slackware. - - Added new AuthType BasicDigest that does Basic - authentication using the MD5 password file managed by - the lppasswd command. - - The banner page attribute substitution code now - retains {name} sequences in banner files when the - named attribute is undefined. Use {?name} to - conditionally substitute an IPP attribute. - - The scheduler now ensures that the ServerRoot - directory and configuration files are owned by and - writable by the User and Group in cupsd.conf. - - The USB backend now lists all USB printer devices - regardless of whether a printer is connected or not. - This allows new USB printers to be connected without - restarting cupsd. - - Added some more minor performance tweeks to the IPP - protocol code to reduce copying and array indexing. - - The cupsaddsmb utility now uses the -c option with - smbclient and rpcclient to avoid the read length limit - for commands on the standard input. - - Added an include file to the CRD handling code in - pstoraster so that it would compile properly on 64-bit - pointer platforms... - - -CHANGES IN CUPS V1.1.12 - - - Added "Polish" to the list of known languages for PPD - files. - - Added missing directory definition to cups-config. - - The CUPS-Move-Job operation did not set the - destination type for the new destination. - - The CUPS-Add-Printer operation did not support the - allow=all or deny=none values to clear the per-user - printer ACLs. - - The SetPrinterAttrs() function did not handle invalid - PPD files that were missing the required NickName - attribute. It now looks for NickName, ModelName, and - then substitutes the string "Bad PPD File" for the - printer-make-and-model attribute. - - -CHANGES IN CUPS V1.1.11 - - - Added support for embedded TrueType fonts in PDF - files. - - Added support for PostScript functions in PDF - files. - - Added new "cupsaddsmb" utility for exporting - CUPS printer drivers to SAMBA/Windows clients. - - Added preliminary support for Darwin/MacOS X. - - The CUPS-Add-Printer operation no longer allows - arbitrary scheme names in device URIs to be used - it - now restricts the available schemes to those found in - the device list (lpinfo -m). - - The ippRead() and ipp_read_file() functions could not - handle more than IPP_MAX_VALUES (100) values in a - 1setOf attribute. These functions have been updated - to dynamically allocate more memory as needed, and the - IPP_MAX_VALUES constant now represents the allocation - increment. [this caused some versions of the - GIMP-print drivers to fail since the number of media - options exceeded 100...] - - The scheduler could crash when BrowseShortNames - was set to "No". - - The scheduler did not prevent MaxClients from being - set to 0, which could cause the scheduler to go in an - infinite loop when accepting a request. - - Made some performance optimizations in the ippRead() - functions to make IPP request/response processing - faster. - - The accept/reject/enable/disable command did not - support properly support the "-h" or default - server name. - - The scheduler did not save the quota configuration - when the job-quota-period attribute was set to 0. - - The LPDEST and PRINTER environment variables did not - support printer instances. - - The text filter now handles more types of boldface and - underline formatting. - - The cupsTempFd() function did not fail if the - temporary directory did not exist; this would cause it - to loop indefinitely instead of returning an error - (-1). - - Stopping (disabling) a printer class did not stop jobs - from printing to printers in that class. - - The cupsGetDests() function was sending the - requested-attributes attribute as a name instead of a - keyword; this caused a serious performance problem on - slower systems since more information had to be - transferred from server to client. - - The web interfaces did not always quote < and & in - things like the job title. This had the potential for - browser-based security violations (on the browser's - machine); bug report from SuSE. - - The scheduler now treats unauthenticated usernames as - case-insensitive when doing quota and allow/deny - processing. - - The lp command sent the "request ID is ..." message - to stderr instead of stdout... - - The PostScript filter (pstops) now handles EPS files, - adding a showpage command to the files as needed. - - The configure script checked for the header - file before the JPEG libraries; since the JPEG headers - can define HAVE_STDLIB_H, the configure check would - cause the JPEG check to fail on some systems. - - The scheduler now supports localized banner files, - using the subdirectory approach, e.g. the "es" - subdirectory under /usr/share/cups/banners is used for - the Spanish banner files. - - Updated the scheduler so it knows the correct - language abbreviation to use for all supported - PPD LanguageVersion values. The new code also - supports country codes as well, so "English-GB" - maps to the "en_GB" locale. - - The cups-lpd mini-daemon did not support - anonymous printing (no username specified). - While the username is REQUIRED by RFC-1179, - MacOS clients do not send the REQUIRED username - information when printing via LPD. - - Added many warning and informational messages - to cups-lpd where they were missing. - - Added Czech message file contributed by SuSE. - - The cups-lpd mini-daemon now returns a non-zero - status if an invalid destination or job ID is - provided. - - The scheduler did not honor the KeepAlive setting in - cupsd.conf. - - Increased the size of the file read/write buffers to - 32k. - - *BSD static library creation fixes. - - Use mkstemps() instead of tmpnam() in pdftops whenever - possible. - - Added httpGetHostByName() function as a wrapper around - gethostbyname() - some implementations of this - function do not support IP addresses (e.g. MacOS X.) - - Added casts to all printf's of file lengths, since - there is currently no standard way of formatting long - long values. - - The client filename field was not cleared in all - instances, resulting in old form data being submitted - to CGIs. - - The httpConnect*() functions now try all available - addresses for a host when connecting for the first - time. - - The pstoraster filter would "lose" all drawing - commands when the PageSize was set but the printer - bitmap was not reallocated. This was most noticeable - with the output from StarOffice 6 beta and would - result in a blank page being output... - - The IPP backend was sending a PAGE comment even when - printing the output from a filter (it should only send - page comments when printing files directly...) - - The pdftops filter didn't properly map glyph names of - embedded Asian TrueType fonts. - - Changed the CUPS startup script to look for a program - named "cupsd", not just any program with "cupsd" in - the name (this caused the apcupsd UPS monitoring - daemon to be stopped/restarted...) - - The CUPS-Move-Job operation did not change the - internal destination name for held jobs, so moved (but - held) jobs would still show up as queued on the - original destination. - - The cups-polld program didn't send the - requested-attributes attribute in the - CUPS-Get-Printers and CUPS-Get-Classes requests, which - made it use more CPU and bandwidth than required. - - The scheduler and CUPS API incorrectly added a - job-sheets-default attribute for remote printers. This - caused banner pages to be omitted from client system - prints. - - -CHANGES IN CUPS V1.1.10-1 - - - Minor fixes to the filter, systemv, and template - makefiles to install files properly. - - -CHANGES IN CUPS V1.1.10 - - - Added a driver for DYMO label printers. - - Added new ClassifyOverride directive to allow users - to override the classification of individual jobs. - - Added new BrowseProtocols directive to control which - browse protocols are used (currently CUPS and SLP). - - Added SLPv2 support (thanks to Matt Peterson for - contributing the initial implementation for CUPS.) - - Adding a raw printer on a remote CUPS server now - correctly redirects PPD file requests to the remote - server. - - The serial backend now limits writes to 1/10th - second worth of data to avoid buffer overflows - with some types of flow control. - - The scheduler did not properly process PUT requests, - so configuration files could not be uploaded to the - server. - - The scheduler did not strip trailing whitespace on - lines in the configuration files. - - The httpWrite() function did not transition the PUT - request to the HTTP_STATUS state to get the status - from the server. - - The scheduler did not properly handle trailing null - ("-") filters when testing a driver that sent data - to the file: pseudo-backend. - - The IPP backend now only sends a document-format of - "application/vnd.cups-raw" when printing to another - CUPS server using a local printer driver or interface - script. Previously the job's document format was - used, which was incorrect. - - The lpadmin command didn't use the ppd-name attribute - with the -m option; this prevented the use of the - "raw" model from the command-line. - - The pstoraster filter output draft (1-bit) 6-color - output in the wrong order; this resulted in yellow - being printed instead of black on Stylus Photo - printers. - - The pdftops filter did not have the Japanese and - Chinese text support compiled into it. - - The IPP and AppSocket backends did not clear the - "waiting for print job to complete" status message, - which caused some confusion... :) - - The serial backend now opens the port in "no delay" - mode to avoid DCD detection problems with some OS's. - - -CHANGES IN CUPS V1.1.9-1 - - - The configure script did not substitute the - correct user and group names. - - The configure script did not use the full path - to the install-sh script when it was used. - - The pstoraster filter did not correctly support - DuplexTumble mode for printers that used flip - duplexing. - - The cups.list.in file was missing from the - distribution. - - The New DeskJet series driver did not use the - correct OrderDependency for the Duplex option. - - Use read() instead of fread() to read piped - print files in lpr/lp. This avoids a bug in the - HP-UX 10.20 fread() function. - - Updated the pstoraster filter to use the MIPS_FIXADE - system call under IRIX to fix bus error problems on - R12000 processors (Ghostscript is not 64-bit clean...) - - Some Xerox PPD files (most notably the Phaser 790) - have illegal whitespace in the option keyword in the - OpenUI line. This caused the PageRegion option to not - be recognized properly for the Phaser 790. - - -CHANGES IN CUPS V1.1.9 - - - Revamped the configure script to use a modular - approach for the various tests. - - Added --with-openssl-* options to properly reference - the OpenSSL libraries in DSOs. - - Added --with-cups-user and --with-cups-group - options to specify the default user and group for - CUPS. - - Added AIX shared library support. - - Added AIX device discovery for the serial and - parallel ports. - - Now use install program or script to install - directories, files, and symlinks. - - Updated pstops filter to use strict handling of EPS - files embedded in a PostScript document. The %%EOF - handling in 1.1.8 caused some dvips files not to - print. - - Fixed yet another memory allocation bug in pstoraster - that would cause it to crash. This fix also ensures - that all memory allocations are done on (at least) a - 64-bit boundary. - - Fixed Digest authentication - httpGetSubField() didn't - skip the Digest keyword. - - The scheduler did not properly handle Digest - authentication with the new multiple-group support. - - The scheduler did not allow usernames that were - not in the UNIX password file to be used for Digest - authentication from passwd.md5. - - The scheduler could not scan PPD files that only used - a carriage return (i.e. MacOS PPD files); the new code - is also about 40% faster, so servers with thousands of - PPD files should start much faster now. - - The scheduler now stores the PPD file size and - modification times in the ppds.dat file, so it can now - incrementally update the PPD database from the model - directory, resulting in significantly faster startup - times. - - The lpinfo command did not return a non-zero status - code if an error occurred. - - Fixed a bug in the scheduler's UpdateJob() function. - Basically, all jobs shared the same status buffer, and - the "buffer start" pointer could point to 1 byte - before the beginning of the buffer. The new - implementation uses a separate buffer for each job and - eliminates the buffer start bug. - - The IPP backend would send N copies of a document if - the receiving device didn't support the copies - attribute, even if the upstream driver already added - the necessary commands to generate the copies. This - was most noticeable with HP printers where N * N - copies would come out instead of N. - - The PostScript filter (pstops) did not properly handle - duplex printing on inkjet printers that provide this - option. Copies would be put on the front and back - sides of the duplexed page, and the filter did not - output an even number of pages. - - The backends always caught SIGTERM after they - connected to the printer. This prevented raw jobs - from being cancelled early. - - The cupsSetDests() function now removes any printers, - instances, and options that are not defined by the - user or server. This should prevent old system-wide - options from being used in individual user accounts. - - Updated the EPSON printer driver and added PPDs for - the newer EPSON Stylus printers that only support the - "ESC i" graphics command. - - The lpadmin command didn't allow you to add remote - printers to a local class. - - The lpadmin command didn't allow you to set the - options (quotas, etc.) for a class. - - The scheduler did not load or save the - job-sheets-default attribute for classes. - - The scheduler did not automatically recreate remote - printers that were part of a class. - - It was possible for a printer class to list the same - printer more than once. - - The scheduler now makes a backup copy of classes.conf - and printers.conf before writing the new file. - - The lppasswd program incorrectly asked for a new - password when deleting an existing MD5 password - account. - - The scheduler did not match "/printers/name.ppd" - against a location of "/printers/name". - - The client code did not always handle HTTP encryption - upgrades properly. - - The client code now caches the last Digest password so - it can retry using a new resource path or nonce value, - which are included in the MD5 sum sent to the server. - This should eliminate unnecessary password prompts - when using Digest authentication. - - The lppasswd command didn't have a man page. - - Updated the PJL detection rules to allow the universal - escape to occur anywhere in the first 128 bytes of the - file. - - The cups-polld program would poll servers continuously - with no delay if there was an error contacting the - server. - - The IPP backend would send an empty job-name or - requesting-user-name attribute if the corresponding - job attribute was an empty string. While this is - allowed by the IPP specification, some HP JetDirect - implementations return a client-error-bad-request - error if an empty name attribute value is received. - The new code only sends these attributes if they are - not the empty string. - - At least some versions of the HP JetDirect firmware - do not correctly implement IPP. Added additional - checks to the IPP backend to eliminate extra, - unsupported attributes which should normally be - ignored by a compliant IPP device. - - The scheduler did not copy the complete list of - supported file types into the - document-format-supported attribute. This caused - clients to not send the local file type (such as - application/vnd.cups-raw for raw print files) and the - corresponding bad output in some cases. - - The scheduler did not fully copy attributes from a - set-job-attributes request - string attributes were - only referenced, which could cause cupsd to crash - or behave irratically. - - The lp command didn't send the right value for the - job-hold-until attribute when "-H resume" was - specified. - - The IPP backend now returns as soon as a job is - completed or reported as "pending-held". - - Added new ImplicitAnyClasses and HideImplicitMembers - directives to the cupsd.conf file to make implicit - classes more usable/transparent to the user. - - Clients can now (with the appropriate authentication) - retrieve and update the server configuration files - using HTTP GET and PUT requests. - - The web interface didn't allow you to modify the - location or description of the printer. - - The pdftops filter now uses its own temporary file - function to work with PDF files using LZW compression - (which use the uncompress program or gunzip) - - The SystemGroup directive now supports specification of - multiple groups. - - Added new Include directive to cupsd.conf, a la - Apache. - - Added new pseudo-driver/PPD called "raw" that can be - used to create/convert a raw queue. This also allows - raw queues to be created in the web interface. - - The pdftops filter didn't handle image objects that - used JPEG and Flate compression together. - - The pstops filter counted pages wrong when using the - N-up and even/odd printing options. This prevented - the page-ranges option from working properly. - - Added another fix to pstoraster for a bus error - condition caused by a lack of parenthesis in the - Ghostscript code. - - Added new "natural-scaling" option which scales the - natural size of the image (percent of natural image - size instead of percent of page size.) - - The lppasswd program is now setuid to the CUPS user - instead of root. - - The PPD functions did not allow for PPD files that - defined the page sizes and margins before the page - size options. - - The mime.types file now checks for the PJL "LANGUAGE = - Postscript" command for PostScript files. - - The scheduler did not truncate file: output files. - - The PPD file reading code did not handle options with - raw quotes (") in the human-readable names. - - The pdftops filter now remaps the space character when - (bad) PDF files contain a .notdef glyph for the space - character. - - -CHANGES IN CUPS V1.1.8 - - - Updated spec file to generate separate cups-pstoraster - package for pstoraster. - - The spec file wasn't setting LOGDIR in the install. - - The scheduler might restart a stopped printer after - stopping a print job. Thanks to Florent - Guiliani for finding this bug! - - The init script showed run level 0 for the Red Hat - chkconfig program. This is incorrect because Red Hat - doesn't use run level 0 for shutdown scripts. - - The IPP backend did not handle the - client-error-not-found error when checking the status - of the job that was sent. This caused remote queues - to stop on client machines when the server had job - history disabled. - - Added httpConnectEncrypt() function to avoid - performance penalty for setting up encrypted - connections initially. - - Use httpConnectEncrypt() in all client apps and in the - CUPS API to ensure consistent usage of encryption - throughout. - - Jobs weren't queued to remote classes (fix from - Richard Begg.) - - AIX changes from Richard Begg. - - Fixed the pstops fix for GNOME output - no longer use - the page numbers in the %%Page: comment since GNOME - puts a filename instead (!?@!#?!). There is still an - issue with N-up printing since GNOME defines its fonts - in the first page instead of the document setup section - (pages must be independent according to the DSC spec) - People with GNOME printing problems should consult bug - #54489... - - The imagetops filter produced PAGE: messages when - generating PostScript for a non-PostScript printer - (only affects page-label and Classification - options.) - - The updated pdftops filter was looking for an options - file called xpdf.conf instead of pdftops.conf. - - -CHANGES IN CUPS V1.1.7 - - - Configuration script changes, including new - "--with-docdir=/dir" option to relocate CUPS - documentation and web content according to your - favorite version of the FHS. - - Documentation updates for encryption, SLP, etc. - - New Software Test Plan and automated test script to - test CUPS prior to installation. - - All scheduler configuration files are now case - insensitive to match Apache. - - Added support for Apache ListenBackLog, LogFormat, - Require, UseCanonicalName, Satisfy, , - , LimitRequestSize, and Options - directives. - - Added support for all Apache log levels... - - Added support for "double" HostNameLookups. - - Added new "RunAsUser" directive to support non-root - configurations on the standard (priviledged) ports. - - Added support for non-root invocation of the lpd - backend (does no reserve a priviledged port, which - might not work with some LPD servers...) - - Added new PrintcapFormat directive to control the - output format of the printcap file (BSD or Solaris - formats are supported at present.) - - The CUPS directory service routines now handle - ECONNREFUSED errors gracefully rather than shutting - all browsing off. - - ippErrorString() now returns the recommended error - messages from the IPP/1.1 Model and Semantics - document. - - Fixed a minor IPP compliance issue with responses - to requests without the attributes-charset or - attributes-natural-language attributes. - - Sun fix: need httpFlush() call for chunked IPP - requests in cupsDoFileRequest(). - - httpConnect() now looks up "localhost" by name and - by address (127.0.0.1) for users the go to the - trouble of removing the required localhost entry - in /etc/hosts or on their DNS server... - - Added support for Linux 2.4.x devfs parallel port - filenames (/dev/parallel/N). - - cupsDo[File]Request() and cupsGetPPD() no longer - block trying to reconnect to a crashed or inaccessable - server. - - Added new ppdEmitJCL() function to better handle - PJL commands from PPD files. - - A bug in UpdateJob() would cause the scheduler to - consume 100% CPU until another request was submitted. - - The cancel command did not support the "-" option to - cancel all jobs on all printers. - - The cancel and lprm commands did not support cancelling - the next/current job in the queue. - - The pdftops and pstoraster filters were using unsafe - temporary file functions; while this is not a problem - in normal configurations (the CUPS temporary directory - is restricted), they now use the cupsTempFd() function. - - The mime.types file was missing the recognition rule - for Sun Raster images. - - The admin CGI was passing a printer make string to - ippSetCGIVars() that was being replaced in that - function. - - "lpoptions -l" would resave the options... - - The EPSON drivers now send the "end packet mode" - command when printing to USB devices. - - The scheduler initialized certificates before loading - the cupsd.conf file. - - The scheduler used /dev/random to collect random data, - which could block if insufficient entropy information - had been collected by the kernel. Now use - /dev/urandom. - - Fixed a bug in the whitespace skipping code in - httpGetSubField(). - - The LPD backend now supports a new "order" option: - "lpd://server/queue?order=control,data" (default) and - "lpd://server/queue?order=data,control". - - The scheduler enforced a 30 second timeout on all - clients regardless of the Timeout directive and if a - CGI was currently running. - - cupsParseOptions() now sets boolean options to - option=true or option=false. - - The "percent complete" calculations in the LPD backend - could overflow on large files, causing the percentage - to wrap to 0 every 40MB or so. - - Fixed a memory reallocation bug in pstoraster that - could cause it to crash. - - The LPD backend now sanitizes the job title to avoid - potential problems on remote LPD servers. - - The lp command did not send the requesting-user-name - attribute when altering a job. - - The pstops filter did not handle PostScript files with - lines longer than 8191 bytes. - - The scheduler no longer uses inet_addr() to convert IP - addresses in dot format (mmm.nnn.ooo.ppp) to the - 32-bit format, since it will not work for IPv6 - addresses. - - New "Classification" directive to force labeling of - the current classification on each page. - - New "page-label" attribute to add per-page labels - ("For Official Use Only", "Draft", etc.) - - The scheduler now sets the HTTPS environment variable - for CGI programs when a client connects using - encryption. - - Fixed a recursion bug in the scheduler that could - cause cupsd to crash when a printer was removed. - - The LPDEST and PRINTER environment variables didn't - support instances. - - Dropped the "file" backend from the device list that - is reported, since it is only available for *testing* - and should never be used in a production environment. - The file: device can still be used, but it won't show - up in the list of devices from lpinfo or the web - interface. - - Added support for /dev/lpa# parallel ports under *BSD. - - Added META variables to the CGI header template to - prevent caching of the results. - - Fixed an unaligned memory buffer for the pstoraster - clist states; this caused bus errors for some - combinations of printers, drivers, and options. - - Re-added black reduction for colorful colors; this - helps to prevent dark colors from getting desaturated. - (only used when converting RGB to CMYK) - - Added two new directives - MaxJobsPerPrinter and - MaxJobsPerUser - to allow an administrator to set - the maximum number of pending jobs in a queue or - submitted by a user. - - The scheduler no longer stops a printer if it can't - create the status pipe or run the filters or backend. - This will allow heavily loaded servers to service - clients or start print jobs as the load allows. - - Fixed a bug in the Set-Job-Attributes code that could - crash the scheduler (patch from Martin Zielinski) - - cupsSetDests() did not quote option values with - embedded spaces. - - Added support for the Enable-Printer and - Disable-Printer extension operations (same as - CUPS-Accept-Jobs and CUPS-Reject-Jobs.) - - The AppSocket and IPP backends now wait for the print - job to be finished before exiting; this should prevent - the loss of print jobs with older JetDirect firmware - and make consecutive print jobs print faster. - - The BMP loading code did not handle resolution values - of 0. This is a problem with BMP image files produced - by the GIMP. - - The HTTP Upgrade code (upgrade to TLS encryption) - bypassed the authentication checks. - - The HTTP Upgrade code did not send a 426 status code - to the client and end the current request. This caused - a race condition between the client and server for the - upgrade to TLS. - - Fixed a bug in the EOF and Trailer detection code in - the pstops filter. - - The imagetoraster filter did not add the margins to - the custom page size in the raster header. - - The imagetops filter did not adjust the custom page - size to the size of the printed image. - - The imagetops filter did not include DSC comments - which are required by some printers. - - The imagetops filter did not insert newlines in - Base85 encoded output, causing files to contain - lines longer than 255 characters (violation of the - DSC). - - Added support for the DeskJet 900 series duplexer - and CRET color modes in the HP driver. - - Added support for PPD-defined margins in the HP - driver. - - Fixed the debugging output from pstoraster - the - font list was not terminated by a newline. - - Some versions of the HP-UX pam_unix authentication - module apparently do not pass the appdata_ptr argument - to the conversation function, preventing the scheduler - from authenticating users using PAM under HP-UX. A - workaround using a static variable has been added to - address this problem. - - Fixed a bug in the scheduler SortPrinters() function - that could cause printers to disappear or the - scheduler to crash when adding a printer. - - Changed the pstops filter to not do per-page filtering - if the file does not conform to at least version 3.0 - of the document structuring conventions. This seems - to "fix" printing with broken apps. - - The image filters did not handle older TIFF files that - lacked the samples-per-pixel and bits-per-pixel tags. - - Added new cupsGetJobs() and cupsFreeJobs() functions - to manage print jobs. - - cupsEncodeOptions() would encode names of 0 length and - cupsAddOption() and cupsParseOptions() would add names - of 0 length. - - The scheduler might block waiting for status messages - after starting a new print job. Thanks to Florent - Guiliani for finding this bug! - - -CHANGES IN CUPS V1.1.6-3 - - - The configure script put the JPEG library before the - TIFF library; this caused problems in some - configurations since the TIFF library also supports - JPEG compression of TIFF images. - - Updated the configure script and makefiles to handle - admin man pages with the "1m" extension (HP-UX, IRIX, - Solaris, Tru64) and in odd directories (IRIX) - - The updated cupsTempFile() function did not return - the filename when called with a filename buffer of - NULL (previously it used a static buffer.) - - FreeBSD uses /dev/unlptN, but NetBSD and OpenBSD use - /dev/ulptN. - - DeletePrinter() didn't remove the printer from any - classes it was a member of. - - DeletePrinterFromClass() didn't preserve the - implicit status of a class. - - DeletePrinterFromClasses() didn't remove printers - from implicit classes. - - StartJob() didn't send the job-sheets, job-priority, - and job-hold-until attributes to remote printers. - - LoadAllJobs() was looking for job-sheets-completed - instead of job-media-sheets-completed. This would - prevent accumulation of page data after a restart - of the scheduler. - - The pstops and imagetops filters now generate copies - using the appropriate method for a Level 1, 2, or 3 - printer since some Level 2/3 printers don't support - the /#copies variable anymore. - - The man page for cups-lpd did not mention the "-o" - option. - - The IPP backend didn't handle version-not-supported - errors and revert to IPP/1.0 (previously it only checked - for a bad-request error) - - Caldera fix: lpc now reports unimplemented commands as - unimplemented, not invalid. - - Caldera fix: lpq didn't recognize BSD lpq "-a" option. - - Caldera fix: lpr didn't recognize BSD lpr "-1", "-2", - "-3", "-4", "-q", or "-U" options. - - RedHat fixes: patches to GNU Ghostscript - - SuSE fix: temp file creation patch to GNU Ghostscript - (pstoraster). - - SuSE fix: remove cgi-bin/abort.c and cgi-bin/email.c, - which are not used. - - SuSE fix: missing NULL check in cgi_initialize_post(). - - SuSE fix: potential buffer overflows in - cgi_initialize_string(). - - SuSE fix: potential buffer overflows in - ippSetCGIVars() - - SuSE fix: more NULL checks in ppdOpen(); also make - sure that all memory is freed on error to avoid memory - leaks. - - SuSE fix: Exit from child if setgid() or setuid() - fails. - - SuSE fix: Added setgroups() calls after setgid() and - setuid() calls. - - SuSE fix: potential buffer overflows in httpEncode64() - calls. - - SuSE fix: potential buffer overflows in httpSeparate() - - SuSE fix: potential buffer overflows in ippWrite() for - bad input. - - SuSE fix: potential nul skip in ppd_decode() for - missing hex digits. - - -CHANGES IN CUPS V1.1.6-2 - - - Added changes to support NetBSD startup scripts. - - Added separate compiler options for pstoraster - (Ghostscript) to avoid compiler-induced errors - from Ghostscript's twisted code. - - The mime.types file contained syntax errors. - - Updated the *BSD USB device filenames to use - the /dev/unlptN files so that the USB device - is not reset prior to printing (causes print - corruption on many printers) - - Added new cupsTempFd() function to avoid serious - security bug in glibc fopen() function. The glibc - fopen() function unlinks a file before creating it, - which opens up possible symlink attacks. - - Now reject 0-length names in add-printer and add-class - requests. - - Fix for pstoraster when ZLIB is not available. - - cupsGetPPD() didn't reconnect when a HTTP connection - was lost. - - SuSE fix: httpConnect() didn't check that the - value from gethostbyname() was a valid IPv4 address. - - SuSE fix: httpConnect() didn't allow file descriptor 0 - to be used for a socket. - - SuSE fix: ippRead() didn't confirm that all values in - a set were numeric or string types. - - SuSE fix: lppasswd race condition fixes. - - SuSE fix: directive names could overflow buffer when - reading *.conf files. - - SuSE fix: HEAD requests for PPD files did not use the - same logic as GET requests. - - SuSE fix: possible buffer overflow when adding - /index.html to requested directory name. - - SuSE fix: possible buffer overflow when converting - IPP attributes to string options for filters. - - SuSE fix: creating file: device output with mode 0666 - instead of mode 0600. - - SuSE fix: creating job info files with mode 0640 - instead of 0600. - - SuSE fix: don't rely on snprintf() for including - system name in log filenames. - - SuSE fix: add bounds checking when copying quoted - and hex strings. - - -CHANGES IN CUPS V1.1.6-1 - - - Added configure check for getting the correct - strftime() format string; %c is not Y2k safe, - and %KC and NULL are not universally supported. - - -CHANGES IN CUPS V1.1.6 - - - Fixed another possible DoS attack in httpGets() - - Added check for "LANGUAGE = PCL" and "LANGUAGE = - POSTSCRIPT" in mime.types. - - Resolution options were not being passed into the - filter programs properly. - - The default compiler options for GCC no longer include - "-g3", which apparently is deprecated in newer - versions of GCC. - - CheckJobs() could cause cupsd to crash if a job is - cancelled in StartJob(). - - The printers.conf and classes.conf files are now - written with restricted permissions. - - The round-robin algorithm used by FindAvailablePrinter() - had problems; fixes contributed by Joel Fredrikson. - - If LoadAllJobs() is unable to determine the file type - of a print job, assume "application/vnd.cups-raw". - - The web interface now provides a job_printer_name - value for any corresponding job_printer_uri value. - - The cups-lpd mini-daemon now logs the client address - and hostname as well as all commands and errors in the - syslog file. - - The IPP backend now detects the supported file formats - and only specifies the document format if it is - supported. This makes IPP printing to network print - servers and cards more reliable without affecting the - capabilities of CUPS servers. - - The time_at_xyz attributes are now converted to human- - readable dates and times for the web interfaces. - - The HP and EPSON sample drivers now correctly catch - signals and eject the current page when a job is - cancelled. - - Fixed bug in CGI code - did not ignore control - characters (e.g. newlines) in form data. This caused - sporatic web interface problems. - - The file type logging code in the scheduler referenced - the optional document-format attribute; the new code - uses the resolved MIME type instead. - - The client.conf parsing code now removes trailing - whitespace. - - The MaxJobs directive was being treated as a boolean - instead of an integer. - - The scheduler would not timeout remote printers if - BrowseInterval was set to 0. - - The lpadmin command now supports setting of options - and user-level access control. - - Added "-E" option to all printing commands to force - encryption. - - The client code did not consume the response to the - OPTIONS request when switching to secure mode. - - The scheduler did not output a Content-Length field - when responding to an OPTIONS request. - - Added documentation on using cups-lpd with xinetd - to the man page. - - The socket backend now starts retries at 5 seconds and - increases the interval to 30 seconds. This should - provide faster printing when multiple jobs/files are - queued for a printer. - - The filters and backends no longer buffer output to - stderr. This should provide much more accurate status - reporting. - - -CHANGES IN CUPS V1.1.5-2 - - - Fixed configure check for OpenSSL to work with RSA - code. - - Added configure check for , and use this - check in backend/serial.c. - - Updated configure script handling of data, - configuration, and state directories to use datadir, - sysconfdir, and localstatedir variables. - - NetBSD uses different serial port filenames than - FreeBSD and OpenBSD. - - The pdftops filter didn't need some X-specific files. - - The scheduler makefile doesn't do a chown anymore when - installing (cupsd did this automatically on startup - anyways) - - -CHANGES IN CUPS V1.1.5-1 - - - There was a typo in the top-level Makefile - - The top-level Makefile did not install an init script - for run level 5. - - The configure script did not add the "crypto" library - when checking for the OpenSSL library. - - The OKIDATA PPD files were missing. - - The config.h.in file defined the wrong version number. - - The serial backend did not define "funky_hex" under *BSD. - - Updated the Visual C++ project files and some of the - CUPS API sources to compile under Windows again. - - -CHANGES IN CUPS V1.1.5 - - - Security updates - new default configuration does - not broadcast printer information and only allows - access from the local system. - - EXPERIMENTAL encryption support - CUPS now optionally - supports TLS/SSL encryption via the OpenSSL library. - - Documentation updates. - - Makefile/configure script updates. - - The RPM spec file didn't work out-of-the-box under - RedHat or Mandrake. - - Minor code cleanup to remove extraneous compiler - warnings. - - cupsTempFile() was using %p for the temporary - filename; this should have been %08x (just 8 digit - hex) - - Deleting a printer with active print jobs would still - crash the server. - - ippWrite() and ipp_write_file() didn't send the - correct value length for name-with-language and - text-with-language attributes. - - Updated IPP code to support copied strings (that - should not be freed); this provides slightly more - efficient IPP server performance. - - Updated PDF filter to Xpdf 0.91. - - httpGets() could go into an infinite loop if a line - longer than the input buffer size was sent by a - client. This could be used in a Denial-of-Service - attack. - - The lpstat and CUPS API functions now request only the - data required when getting the list of printer or - class information. This should improve performance - with large numbers of printers on slower machines. - - The scheduler was always enforcing the FilterLimit, - even if FilterLimit was set to 0. - - Updated the Linux USB backend to support Mandrake's - /dev/usb/usblp# filenames. - - The PRINTER and LPDEST environment variables did not - override the lpoptions default printer. - - The PPD read functions incorrectly included trailing - characters (usually whitespace) after quoted string - attributes. - - The multiple-document-handling attribute handling code - did not check for the correct value for collated - copies (separate-documents-uncollated-copies). - - The EPSON driver did not work with OKIDATA printers in - EPSON emulation mode (needed change-emulation command) - - The HP-GL/2 filter did not scale the plot properly in - scale mode 2. - - Added PPD files for 9-pin and 24-pin OKIDATA printers. - - The httpSeparate() function didn't handle passwords - that started with a number. - - ippDelete() could free the character set string - multiple times in name-with-language and - text-with-language attributes. - - The scheduler would access freed memory right after - freeing it (for debug messages); these parts of the - code have been reordered to avoid this situation - which was causing sporatic errors and crashes. - - The ppdClose() function didn't free all of the strings - in the ppd_file_t structure. - - The LoadAllJobs() function in the scheduler did not - close the spool directory. - - Changed all sprintf's that use string formats to - snprintf's, even if the destination buffer is - larger than the source string(s); this protects - against buffer overflows caused outside of CUPS... - - Changed all strcpy's to strncpy's between local and - global variables, even if the destination buffer is - larger than the source string; this protects - against buffer overflows caused outside of CUPS... - - The CUPS certificate functions didn't use the - CUPS_SERVERROOT environment variable when set. - - The directory services code was copying instead of - comparing the remote printer info, resulting in - unnecessary updates of the printer attributes for - remote printers. - - Added new mime.types rules to allow automatic raw - printing of PCL and ESC/P files; PJL headers are - parsed to differentiate between PostScript and - PCL job files. This should eliminate a lot of - the reports of SAMBA printing problems due to - the missing "-oraw" or "-l" options. - - The mimeLoadType() function didn't handle the - 3-argument contains() function. - - The LoadPPDs() function in the scheduler didn't - properly set the alloc_ppds variable or handle a PPD - database containing 0 printers. - - The scheduler FindAvailablePrinter() function didn't - use the same queuing logic as the CheckJobs() - function. This caused classes to stall if a remote - printer was always busy. - - Jobs are now assigned to printers in a class - round-robin style. This should prevent the first - server in the class from bearing the brunt of the - jobs. - - The scheduler's LoadAllJobs() function didn't always - restore remote printers for queued jobs on startup. - - The serial backend didn't support the higher baud - rates with the old termios interface. It now supports - 57600 and 115200 baud. - - The serial backend now supports different types of - flow control; previously it ignored the flow=XYZ - option in the device URI. - - The serial backend now supports DTR/DSR flow control, - which is popular on dot-matrix printers (access with - "flow=dtrdsr" in the device URI) - - Added new job-originating-host-name attribute for - jobs. The new attribute provides the hostname or - IP address of the machine that submitted the job. - - The set-job-attributes code no longer allows read-only - job attributes to be changed. - - Expanded the click area for the navigation bar in the - web interface. - - Updated the lp and cancel commands to support all of - the Solaris print options (some are simply ignored - since they do not map) - - Updated the scheduler to limit the number of file - descriptors to the maximum select() set size. This - was causing problems on Solaris systems where the - max FD count was increased beyond 1024. - - The scheduler's LoadDevices() function was getting - interrupted by the SIGCHLD signal handler; now ignore - child signals while loading devices. - - Added quota and allow/deny user support for printers - and classes. - - Removed black/CMY adjustment code from the PS and - image file RIPs; it was interfering with some CUPS - driver dithering code. - - The lpc program stopped listing the queue statuses - after the first active printer. - - The cups-lpd program used an output format that the - Solaris printing system did not understand. - - Updated the lpq program to use the Solaris format - except under Tru64 UNIX. - - Some DEC PPD files incorrectly use "Off" for the null - value in UI constraints. Added "Off" to the list of - accepted null values. - - Changed the *BSD define constants to __*BSD__ in all - of the backends. - - Added support for "lpstat printername", which is an - undocumented feature in Solaris. - - The HP-GL/2 filter now only sets the plot size if it - is set in the plot file. - - The lpmove command wasn't sending the requesting - user name, causing it to always fail. - - Updated the cupsTempFile() code to use GetTempPath() - under Windows. - - The cups-lpd mini-daemon didn't limit the number of - data files accepted, didn't use cupsTempFile(), - didn't handle control file job information in any - order, and didn't free job options after printing - a file. - - The scheduler copy_banner() function did not - explicitly set the owner and permissions of the banner - files, which could prevent the banner pages from - printing on some systems. - - The lpstat program wasn't listing remote classes. - - The scheduler did not verify that the printer-uri - attribute was specified in all requests that required - it. - - -CHANGES IN CUPS v1.1.4 - - - Makefile and configure script fixes. - - **** Changed the default Printcap setting **** to - /etc/printcap. There are just too many people asking - why application XYZ doesn't see their printers! - - The web admin interface now displays an error if it - can't get the list of printer drivers from cupsd. - - The IPP backend was putting the copies option before - the other job options were set. This caused the IPP - request to contain attribute groups in the wrong - order, which prevented remote printing. - - Added checks in scheduler to free memory used for - IPP requests and language information when closing - a client connection. - - Fixed the duplex option in the HP LaserJet driver. It - should now work with all LaserJet printers (and - compatibles) - - The add-printer web interface didn't initialize the - "old info" data pointer, which caused random crashes - on many OS's. - - Fixed many page sizes defined in the Level 1 - compatibility file "gs_statd.ps" to match reality. - - Fixed another bug in the setpagedevice "code" in - Ghostscript. It should now accept all standard - Adobe attributes on all platforms. - - Fixed pstoraster so that it reallocates memory for - color depth changes as well as size/resolution - changes. This removes an ordering constraint on - the color, page size, and resolution options in - PPD files. - - The IPP backend didn't use the job's character set - when the destination printer supported it. This - caused problems when printing text files to other - CUPS servers. - - Updated the logic used to determine when to rebuild - the PPD file database. The scheduler now checks the - dates and the number of PPD files (was just checking - the dates.) - - Updated the ippSetCGIVars() function (used by the - web interfaces) to only filter valid string values. - - The PostScript filter was scaling 2-up pages - incorrectly. This caused the edges of some pages to - be clipped. - - -CHANGES IN CUPS v1.1.3 - - - Makefile fixes. - - RPM spec file changes. - - Documentation updates. - - Enabled pstoraster debug messages for everything - (only logged when LogLevel set to "debug"...) - - Changed the Input/OutputAttributes fix in - pstoraster so that it works on all platforms. - - The HP-GL/2 filter didn't set the right green - color value in encoded polylines or text. - - Updated the "fitplot" code to handle plot sizes - specified as "PSwidth,length" and "PSlength,width". - - Updated the Linux parallel and USB backends to open - the device files prior to looking in /proc for - autoprobe info. This makes sure that loadable device - driver modules are in fact loaded... - - Added new FilterLimit directive to limit the number - of processing jobs/filters on a system. - - set-job-attributes didn't change the job-state to - held/pending when the job-hold-until attribute was - specified. - - set-job-attributes didn't save the new job attributes. - - Now change the "requesting-user-name" attribute in - requests from remote systems to "remroot" when an - unauthenticated "root" user is sent. This can be - changed using the new RemoteRoot directive in - cupsd.conf. - - The cancel-job, hold-job, release-job, and restart-job - operations didn't log the authenticated username. - - The cups-lpd mini-daemon now checks for a - document-format option before forcing raw mode with - filter mode 'l'. - - The cups-lpd mini-daemon now supports "-o" options - on the command-line (passed by inetd) to set global - defaults for all print queues. - - The pstops filter assumed that a file with a Trailer - comment would also have an EOF comment. - - Added new cupsSetPasswordCB(), cupsSetServer(), - cupsSetUser(), and ippSetPort() functions to better - support client applications (especially GUIs...) - - The CUPS-add-class and CUPS-add-printer operations - didn't reset the printer-name attribute on remote - print queues that had to be renamed when a local - printer was defined with the same name. - - The lpoptions command now supports a "-r" option to - remove options for a printer or instance. - - The lpadmin and admin.cgi programs no longer allow - class and printer names to begin with a number; this - caused the command-line utilities to become confused. - - The Linux USB backend now looks for both the parallel - and usblp driver names in the device list. - - Added a new FontPath directive to cupsd.conf, and also - a "--with-fontpath" option for the configure script to - specify alternate font paths for pstoraster. - - The CUPS-move-job operation didn't update the - job-printer-uri attribute. - - The scheduler only looked up printers and classes by - name in IPP requests, instead of using the full URI. - This caused problems with KUPS and friends with - remote printers. - - The scheduler now handles better localization of - hostnames (e.g. server is host.foo.com, remote is - host.subfoo.foo.com, localized is not host.subfoo...) - - The scheduler logging functions now use a common - log file checking/rotation function (courtesy of - Crutcher Dunnavant at Red Hat) - - The scheduler could accept more client connections - than it allocated for if more than one Port or Listen - line was present in cupsd.conf. - - Other minor scheduler performance tweeks. - - The lpq and lprm commands didn't support the default - printer set using lpoptions. - - The lpoptions command now supports a "-l" option to - list the printer-specific options and their current - settings. - - The web printer and class lists now show a link to the - default printer or class at the top of the page. - - The text filter now supports pretty printing of shell - and perl scripts as well as C/C++ source files. - - The top and bottom margins were reversed for landscape - text printing. - - The lpq and lprm commands didn't understand printer - instances. - - The scheduler only selected on the first 100 file - descriptors instead of the maximum file descriptor - limit. - - The scheduler client, listener, and mainline functions - now share code to disable and enable monitoring for - new client connections. - - The imagetoraster filter didn't support all of the - required pagedevice parameters. - - The serial backend now checks for 100 serial ports - under Linux. - - The scheduler used sscanf() to pull out the remote - printer location, description, and make/model strings, - but if any of these options was empty then sscanf() - would stop processing. - - Added "debug2" log level to provide a little less - verbose debugging information at the "debug" level. - - The scheduler would crash if you stopped a printer - that was currently printing a job. - - The scheduler incorrectly allowed jobs in the cancelled, - aborted, or completed state to be cancelled. - - The image filters did not load TIFF images properly - for bottom-to-top and right-to-left orientations. - - Added new cupsEncodeOptions() function to encode - CUPS options as IPP job attributes. - - The IPP backend, LPD mini-daemon, client commands, - and CUPS API did not properly encode multiple - option values separated by commas. - - Added new scheduler malloc logging in debug mode - (provides summary of total arena size, allocated, - and free bytes once a minute) - - The EPM-based distributions didn't install the - correct symlinks for a few man pages. - - Fixed a memory leak in the scheduler - wasn't - freeing old filters when deleting or renaming - printers. - - The scheduler now queries the primary IP address - for the name of the server and maps any incoming - requests from that address to the server name. - This fixes web admin mapping problems from - server.domain.com to localhost. - - The web printer modify interface now remembers - the previous device and driver settings (except - for serial ports.) - - The job-k-octets attribute is now stored as part of - the job attributes; this preserves the information - after a job is completed when job file history is - turned off. - - Dropped option sub-group parsing code for the moment, - since many Xerox PPD files abuse this feature in PPD - files and don't follow the hierarchy rules. - - Added new wrapper code around options so that duplex - options for some HP printers don't prevent prints. - - Added support for Digital UNIX/Tru64 UNIX/OSF/1 format - for "lpstat -v" output. - - Now show the URI for remote printers instead of - /dev/null in "lpstat -v" output. - - Creating classes and adding printers to a class with - the lpadmin command didn't work. - - The banner pages and test page should now format - correctly in both portrait and landscape orientations. - - Updated banner page substitution so that { can appear - by itself without quoting. - - -CHANGES IN CUPS v1.1.2 - - - Makefile/configure fixes - - RPM spec file and EPM list file fixes - - The cupsTempFile() function now uses a different - algorithm for generating temp files and "reserves" - them to avoid possible security exploitation. - - Now use /dev/random (if available) to seed the random - number generator for certificates. - - The /var/spool/cups and /var/spool/cups/tmp directories - were incorrectly owned by root; they are now owned by - the filter user, typically "lp". - - The scheduler now resets the permissions on the spool - and temp directories as needed to match the filter - user. - - Now expose ppdCollect() as an externally callable - function. - - The image filters now support filtering from the - standard input. - - The imagetoraster filter now collects all printer - options and job patch files and applies them to the - page header as needed. - - Added format and banner options to LPD backend. - - The send-document operation didn't start a job - immediately when last-document was true. - - The set-job-attributes operation didn't correctly - replace the current job-hold-until value. - - Removed the option wrapper code from ppdEmit() and - friends since it caused problems with Ghostscript - and many PS printers. - - Was setting TZ environment variable twice for job - filters. - - Added syslog logging in cups-lpd to aide in - debugging problems. - - The HP-UX parallel port backend did not list the - available parallel ports on some systems (printf - calling problem...) - - The lp and lpr commands overrode user options if - -d/-P were specified after -o. - - The scheduler would crash with a */* filter. - - Added support for a "default" filter for unknown file - types. The example provided in the mime.types and - mime.convs file prints unknown files as if "-oraw" was - specified for the job. This functionality is disabled - by default. - - The "compatibility" mode fix for older backends did not - work for smbspool. Added a workaround for it. - - The HP-GL/2 filter didn't perform the right pen scaling - with some files and the "fitplot" option. - - New Software Performance Specification document that - describes the memory, disk, and CPU usage of all the - CUPS software. - - -CHANGES IN CUPS v1.1.1 - - - The pstoraster Makefile still referenced one of the - old PDF filter files. - - The filter Makefile used INSTALL_DATA instead of - INSTALL_LIB to install the CUPS image library. - - The administration CGI didn't work properly with - network devices. - - The BrowseACL variable was not updated after the - cupsd.conf file was loaded. - - The lpd mini-daemon didn't support printer instances. - - Now use a default umask of 077 for child processes. - - Now put temp files in /var/spool/cups/tmp for child - processes and the root user, unless TMPDIR or TempDir - is defined otherwise. - - cupsGetPPD() no longer uses easy-to-guess filenames. - - The CUPS-Delete-Class and CUPS-Delete-Printer - operations now save classes.conf file as needed. - - The lppasswd command wouldn't add a user. - - The ppdOpen() function could cause a segfault if a - 0-length PPD file was read. - - The image filters were not handling images with - different X and Y resolutions properly. - - The imagetoraster filter defaulted to RGB output - instead of black output like pstoraster. - - The pstops filter didn't handle binary data properly. - - The pstops filter didn't handle copies properly for - PS files lacking DSC comments. - - The pstops filter now appends %%EOF to the end of - documents if they don't have it. - - The cupsGetPPD() function didn't work with remote - printers lacking the @server in the name. - - The configure script didn't work right when only - --prefix was specified. - - The ppdEmit() code now wraps all printer commands so - that buggy PostScript printers will still print a file - after receiving an option that isn't available. - - Fixed the DeskJet margin bug, and disabled 600dpi - color mode until it can be fixed. - - The cupsAddDest() function didn't sort instances - correctly in all cases. - - The time-at-xyz attributes now expand to the date and - time in banner files. - - -CHANGES IN CUPS v1.1 - - - Documentation updates. - - Configuration script updates. - - Didn't map charset and language value strings to lowercase - and _ to - as required by SLP and IPP. - - ppdLoadXYZ() didn't add the list of available fonts to the - ppd_file_t structure. - - The text filter common code was freeing the PPD file data - before it was used. - - The text filter now embeds missing fonts. - - The CGI interface now maps local access to the server to - the localhost address. - - The HP-GL/2 filter didn't use the specified (or default) - color ranges, resulting in strange colors. - - The HP-GL/2 filter didn't default to no input window, which - caused unnecessary clipping of plots. - - Integrated Xpdf's pdftops filter into CUPS, which is a - lightweight and reliable replacement for Ghostscript's - PDF support. - - Removed all PDF support from Ghostscript. - - Updated HP driver to set top margin; this seems to fix - the offset problem seen on HP DeskJet printers. - - Fixed dependencies on the ZLIB and JPEG libraries in - pstoraster. - - The lpr command wasn't using the lpoptions defined by - the user. - - The lpr command would segfault if the CUPS server was - not running. - - The top-level makefile was not installing the CUPS - initialization script. It now does so if it sees there - is an init.d directory in /sbin, /etc/rc.d, or /etc. - - "lpstat -v all" didn't work. - - pstoraster would crash on some platforms doing the - setpagedevice operator. - - The web administration interface now allows you to set - the default banner pages. - - Images can now be positioned on the page using the new - "position" option. - - The AccessLog, ErrorLog, and PageLog directives now - support "%s" to insert the server name. - - Added a new BrowseShortNames directive to allow for - short remote printer names ("printer" instead of - "printer@server") when possible. - - The scheduler could crash if given an invalid PPD file - with no PageSize attributes. - - Updated the serial, parallel, and usb backends to do - multiple writes and ignore ioctl() errors as needed; - this should fix problems with serial printing on old - serial drivers and with the UltraSPARC parallel port - driver under Solaris 2.7. - - Now propagate LD_LIBRARY_PATH to child processes from - cupsd. - - New DataDir directive for installing in alternate - locations. - - New CUPS_SERVERROOT and CUPS_DATADIR environment - variables to specify installation directories as - needed. - - Queued remote jobs recreate remote printers as needed - when the scheduler is started. - - Deleting a printer also purges all jobs on that - printer. - - Old job and control files that don't belong to a - printer are automatically deleted. - - Wasn't updating time-at-processing and - time-at-completed attributes in job. - - Didn't send required multiple-operation-time-out - attribute in response to a get-printer-attributes - request. - - cups-lpd now supports options set with lpoptions. - - The job-hold-until attribute is now provided with all - jobs. For jobs that are not currently held the value - is "no-hold". - - The scheduler was not sending "unknown" values in IPP - responses. - - The lpoptions command now accumulates options from - previous runs rather than replacing all options for a - printer. - - The IPP backend now switches to IPP/1.0 if a 1.1 - request fails. - - The lpadmin and admin.cgi programs now validate new - printer and class names. - - The access_log file now includes the number of IPP bytes - received in a POST request. - - -CHANGES IN CUPS v1.1b5 - - - Documentation updates. - - The pstoraster filter didn't compile without the JPEG library. - - The cupsd server didn't support the HTTP OPTIONS request - method. - - Dropped the "CLOSE" method supported by the cupsd server. - (not defined in HTTP specification) - - Makefile/configure script fixes. - - Missing the job-restart template. - - Added IPP test suite for testing. - - Missing IPP documentation from binary distributions. - - Fixed multiple-document handling code when last-document - not specified. - - Added more checks to IPP requests to prevent bad requests - from getting through. - - Not all of the Ghostscript error output was being sent to - stderr. - - The PostScript filter now added PJL commands to set the - job name and display string, if supported. - - The scheduler would crash if the browse socket could not - be bound. Now disables browsing if port 631 (reserved for - IPP) is being used by a misbehaving daemon. - - The USB backend now looks for the older Linux 2.2.x USB - printer device filenames as well as the newer ones. - - The IPP backend now uses the UTF-8 charset exclusively, - since apparently only CUPS handles more than US-ASCII and - UTF-8... - - Wasn't quoting ( in PostScript banners... - - Send-document requests with no document-format attribute - could cause cupsd to crash. - - Old jobs in the spool directory might cause cupsd to - crash. - - CUPS now supports all of the recommended job-hold-until - keywords as well as name values of the form "HH:MM" and - "HH:MM:SS". - - Added placeholder pointer for TLS encryption to the HTTP - connection structure. - - Fixed the "fast poll" bug reported by DISA - the - status pipe wasn't being closed for multi-file jobs. - - Revamped put_params code in pstoraster to fix bitmap - allocation bug with FrameMaker output. - - Ripped out filename, etc. code from pstoraster as it - is a potential security hole. - - Added support for RIP_CACHE environment variable in the - new pstoraster. - - Fixed USB device filenames for Linux; now support new - pre-2.4 devices (/dev/usb/lp#) and 2.2 devices - (/dev/usblp#) - - Fixed accept-jobs crash with classes. - - Didn't include dot-matrix EPSON drivers in previous - release. - - -CHANGES IN CUPS v1.1b4 - - - Documentation updates. - - Many makefile and configuration script fixes (should - now compile better under *BSD.) - - The MediaPosition attribute was being mishandled by - GhostScript, causing the RIP to fail whenever a paper - tray was selected. - - The scheduler now logs the final line of log information - from a filter, even if it doesn't end with a newline; this - primarily affects GhostScript error output. - - The scheduler was saving implicit classes, so after a few - restarts you'll end up with AnyPrinter, AnyAnyPrinter, etc. - - The JPEG autodetection didn't work with some JPEG files that - came from digital cameras (JPEG but not JFIF); the new - magic types should work with all images that the JPEG library - can handle. - - Fixed a bug in the new contains() MIME type rule that could - cause cupsd to crash. - - Switched to using strtol() in the MIME type code so that you - can use hex, octal, or decimal constants as desired in the - mime.types file. - - Banner files are now treated as templates, allowing any type - of file to be used as a banner. - - Added a 30-second timeout to backend device reports so that a - hung backend will not prevent the scheduler from starting. - - Backends are once again terminated when jobs are stopped; the - CUPS-supplied backends will stay alive until the downstream - filters have had a chance to clear out old page data. - - The charset lookup in the CUPS localization support was wrong - (iso8859-x instead of iso-8859-x) - - Changed the "cpNNNN" code page files to "windows-NNNN" to match - the IANA registrations. - - New PostScript banner pages. - - Added Windows BMP and Alias PIX image file support to the image - filter. - - The PNG reading coded didn't free all of its buffers. - - Added Digest authentication support to the client and server - code. - - Added Solaris options to System V commands. - - Now support the output-bin job template attribute. - - Now log the job-billing attribute in the page_log file, and - keep track of the total number of pages in the - job-media-sheets-completed attribute. - - The penwidth option is now in micrometers to support more - accurate width specification. - - The image filters now support interlaced and transparent PNG - files. - - Didn't handle Keep-Alive for HTTP/1.0 clients. - - The BrowsePoll support didn't handle when BrowseInterval - was set to 0 (now uses 30 seconds if BrowseInterval is 0) - - The DeskJet driver now supports 600 DPI color for printers - that support it. - - New lpinfo and lpmove commands. - - The lpq command now supports the Digital UNIX output format. - - The LPD mini-daemon now supports all required LPD operations. - - Implemented timeouts for multi-file documents. - - New cupsPrintFiles() function in the CUPS API library to - print multiple files using create-job and send-document - requests (1 job ID for multiple files) - - The lp command now sends multiple files as a single job, - matching the behavior of the System V command. - - The "cancel -a" command now purges job history files. - - -CHANGES IN CUPS v1.1b3 - - - Documentation updates. - - The startup script redirected stderr before stdout, - which caused problems with some versions of Bourne - shell and Bash. - - Fixed a bug in the scheduler's PPD language reading - code. - - Fixed a bug in the scheduler's check for the - manufacturer in the PPD. - - The pstoraster filter didn't allow some input and - output attributes to be set. - - Added banner page support. - - Added missing PAM configuration file. - - Configuration script fixes for Linux and *BSD. - - The log file code was using the wrong sign for the - timezone offset. - - The default printcap file is now empty (no printcap - file is generated). - - The scheduler did not start jobs destined for remote - printers when they became available. - - The scheduler now sends jobs to remote printers - immediately. (when sending jobs to a class, the remote - printer is only used when it becomes available) - - The scheduler now supports printing of banner pages - via the job-sheets attribute (banner files go in - /usr/share/cups/banners) - - The cupsd process now forks itself into the background - (override with -f) - - Added several *BSD enhancements. - - Added UNSUPPORTED libtool option to configuration - script to allow the use of libtool. Note that this is - UNSUPPORTED by us, but added by request of the *BSD - folks. - - The parallel, serial, and usb backends now retry the - opening of their ports. This allows multiple print - queues to be associated with a single physical port, - and will allow CUPS to support several types of - parallel port auto-switches in the near future. - - Set-Job-Attributes now supports adding, changing, and - deleting job template attributes, and no longer allows - job-printer-uri to be set (see CUPS-Move-Job) - - Added CUPS-Move-Job operation to support moving of jobs. - - The CGI template functionality now supports multiple - languages (still only have templates for English) - - The CUPS-Get-Printers and CUPS-Get-Classes operations - now support filtering as defined in the IDD. - - The Get-Jobs, CUPS-Get-Printers, and CUPS-Get-Classes - operations no longer limit themselves to 1000 jobs, - printers, or classes (believe it or not, this is - needed for some sites) - - The web interfaces now support language-specific - templates. - - The web admin interface now supports class management. - - The web admin interface now shows a list of - manufacturers before selecting the PPD/driver for a - specific printer. - - The web admin interface now supports configuration of - the default printer options in the PPD file. - - The web interface now uses printer/class - authentication for the test page instead of admin - authentication. - - Updated the RPM spec file for the current release. - - Updated language support for Windows code pages. - - 8-bit character set files can now use multiple fonts - (needed for Arabic, Greek, Hebrew, etc.) - - Added basic right-to-left text support in the text - filter. - - The POSIX locale now uses ISO-8859-1 instead of - US-ASCII. - - Fixed PDF printing problems. - - Fixed PostScript RIP page device dictionary elements - that weren't getting passed in cups_get_params(). - - Added a new "contains" rule for the magic file typing. - - The "printable" rule now accepts characters from 128 to 255 - (needed for Microsoft character sets) - - Added support for ~/.cupsrc as well as /etc/cups/client.conf - so that the default server can be configured on a per-user - basis without environment variables. - - Added LPD mini-daemon to support incoming LPD jobs. - - -CHANGES IN CUPS v1.1b2 - - - Documentation updates. - - The lp command didn't always load the user-defined - destinations, preventing it from seeing the default - printer. - - Many configure script and makefile fixes. - - The Microsoft code page files were missing from the - distribution. - - Added a workaround for the HP IPP client (which is sending - an invalid printer-uri in requests) - - Fixed the encoding of text-with-language and name-with-language - to match the IPP spec. - - Added support for unknown value tags in the IPP routines - (previously they would be ignored) - - Integrated GNU GhostScript 5.50 into the pstoraster filter. - - Client hostname resolution was broken on little-endian - machines. - - Now look at client.conf file for client's default server - and printer. - - The cupsServer() function did not close the client.conf file - if it contained a ServerName directive. - - Added BrowseAllow, BrowseDeny, BrowseOrder, BrowsePoll, and - BrowseRelay directives. - - BrowseInterval 0 disables advertising of local printers, but - still receives information on remote printers. - - New browse polling daemon (for polling servers on different - networks) - - New PPD cache file for faster startup times with large numbers - of PPD files. - - The Host: field was incorrectly required for HTTP/1.0 clients. - - New set-job-attributes operation now supported. - - The mime_load_types() and mime_load_convs() functions did not - close their input files. - - -CHANGES IN CUPS v1.1b1 - - - NEW web-based administration interface. - - NEW EPSON printer drivers. - - NEW user-defined printers and options. - - NEW persistent jobs and job history - - NEW IPP/1.1 support - - NEW template-based web interfaces. - - NEW CUPS-get-devices and CUPS-get-ppds operations. - - NEW support for create-job and send-file operations. - - NEW certificate-based authentication for local - administration. - - NEW USB backend. - - The lpr command now produces human-readable error messages. - - The lpq command now produces BSD standard format output - instead of OSF/1 output. This should resolve the SAMBA - print queue problems that have been reported. - - The IPP backend did not always detect when the "raw" option - was being used. - - The "lpstat -p" command would stop after the first active - printer. - - The "lpstat -v" command would stop before the first remote - printer. - - -CHANGES IN CUPS v1.0.5 - - - The HP-GL/2 filter did not correctly set the pen color - for pens other than #1. - - The scheduler would only accept 26 simultaneous jobs - under some OS releases (mkstemp() limitation.) It now - handles up to 2^32 simultaneous jobs. - - The PostScript filter loaded the printer's PPD file - twice. - - The PAM authentication code now uses pam_strerror() to - provide a textual error message in the error_log file. - - The scheduler now copies PPD and interface script - files instead of moving them; this fixes installations - with a separate requests directory. - - The PostScript RIP did not generate correct 6-color - output. - - Several filters were marking PPD options twice when - they didn't need to. - - The scheduler did not save the printer or class state - after an accept-jobs or reject-jobs operation. - - The cupsGetDefault() function now ignores the PRINTER - environment variable if it is set to "lp". - - New ippErrorString() function to get textual error - messages. - - Better error reporting in the System V commands. - - The lpadmin and lpstat commands always tried to - connect to the default server. - - The text filter didn't load the charset files from the - correct location. - - Wasn't sending a WWW-Authenticate: field to HTTP - clients when authentication was required. - - httpSeparate() didn't always set the default port - number for known methods. - - The HP-GL/2 filter now looks for "PSwidth,length" - instead of (the correct) "PSlength,width" as - documented by HP. It appears that many major CAD - applications are broken and this change allows the - auto-rotation to work with them. - - The IPP "printer-resolution" option was not being - translated. - - The charset files did not include the Microsoft - "standard" characters from 128 to 159 (unused by the - ISO-8859-x charsets) - - The scheduler was chunking the Content-Type field from - CGI programs; this problem was most noticeable with - Microsoft Internet Explorer 5. - - By popular demand, the printers, jobs, and classes - CGIs no longer force a reload of the page every 10/30 - seconds. - - The scheduler incorrectly required that the IPP client - provide a document-format attribute for the - validate-job operation. - - Clients that sent bad IPP requests without the - required attributes-natural-language and - attributes-charset attributes would crash the - scheduler. - - -CHANGES IN CUPS v1.0.4 - - - Documentation updates. - - Jobs would get stuck in the queue and wouldn't print - until you enabled the queue. - - The lp and lpr commands now catch SIGHUP and SIGINTR. - - The lp and lpr commands now use sigaction or sigset - when available. - - CUPS library updates for WIN32/OS-2 - - -CHANGES IN CUPS v1.0.3 - - - Documentation updates. - - The lpq man page was missing. - - The configure script was not properly detecting the - image libraries. - - The top-level makefile was calling "make" instead of - "$(MAKE)". - - PostScript filter fixes for number-up, OutputOrder, - and %Trailer. - - The imagetops filter didn't end the base-85 encoding - properly if the image data was not a multiple of 4 - bytes in length. - - The imagetoraster filter didn't generate good banded - RGB or CMY data (was dividing the line width by 4 - instead of 3...) - - The imagetoraster filter now records the bounding - box of the image on the page. - - The CUPS image library cache code wasn't working as - designed; images larger than the maximum RIP cache - would eventually thrash using the same cache tile. - - The CUPS image library TIFF loading code didn't - handle unknown resolution units properly; the fixed - code uses a default resolution of 128 PPI. - - cupsGetClasses() and cupsGetPrinters() did not free - existing strings if they ran out of memory. - - The scheduler logs incorrectly contained 3 digits for - the timezone offset instead of 4. - - The scheduler now does a lookup for the default user - and group ID; the previous hardcoded values caused - problems with the LPD backend. - - The cancel-job operation now allows any user in the - system group to cancel any job. - - The cancel-job operation stopped the print queue if - the job was being printed. - - Now only stop printers if the backend fails. If the - filter fails then the failure is noted in the - error_log and printing continues with the next file in - the queue. - - Now log whether a filter fails because of a signal - or because it returned a non-zero exit status. - - The root user now always passes the system group test. - - Printers with an interface script and remote printers - and classes didn't have a printer-make-and-model - attribute. - - Added logging of lost/timed-out remote printers. - - The HP-GL/2 filter was scaling the pen width twice. - - Updated the HP-GL/2 filter to use a single SP (Set - Pen) procedure. This makes the output smaller and is - more appropriate since the filter keeps track of the - pen states already. - - The scheduler didn't handle passwords with spaces. - - The IPP backend now does multiple copies and retries - if the destination server requires it (e.g. HP - JetDirect.) - - The disable command didn't implement the "-c" option - (cancel all jobs.) - - Changed the CMYK generation function for the image file - and PostScript RIPs. - - The lp command didn't support the "-h" option as - documented. - - The AppSocket, IPP, and LPD backends now retry on all - network errors. This should prevent stopped queues - caused by a printer being disconnected from the - network or powered off. - - The scheduler now restarts a job if the corresponding - printer is modified. - - The image RIPs now rotate the image if needed to fit - on the page. - - -CHANGES IN CUPS v1.0.2 - - - The HP-GL/2 filter didn't always scale the output - correctly. - - The HP-GL/2 filter now supports changing the page size - automatically when the "fitplot" option is not used. - - The cancel-job operation was expecting a resource name - of the form "/job/#" instead of "/jobs/#"; this - prevented the cancel and lprm commands from working. - - The backends didn't log pages when files were printed - using the "-oraw" option. - - The authorization code did not work with the Slackware - long shadow password package because its crypt() can - return NULL. - - The chunking code didn't work for reading the response - of a POST request. - - cupsGetPPD() now does authentication as needed. - - The N-up code in the PostScript filter didn't work - with some printers (grestoreall would restore the - default blank page and device settings). - - The N-up code in the PostScript filter didn't scale - the pages to fit within the imageable area of the - page. - - Wasn't doing an fchown() on the request files. This - caused problems when the default root account group - and CUPS group were not the same. - - -CHANGES IN CUPS v1.0.1 - - - Documentation updates. - - Fixed a bunch of possible buffer-overflow conditions. - - The scheduler now supports authentication using PAM. - - Updated the Italian message file. - - httpEncode64() didn't add an extra "=" if there was - only one byte in the last three-byte group. - - Now drop any trailing character set from the locale - string (e.g. "en_US.ISO_8859-1" becomes "en_US") - - Fixed "timezone" vs "tm_gmtoff" usage for BSD-based - operating systems. - - Updated IPP security so that "get" operations can be - done from any resource name; this allows the CGIs to - work with printer authentication enabled so long as - authentication isn't turned on for the whole "site". - - The IPP code didn't properly handle the "unsupported" - group; this caused problems with the HP JetDirect since - it doesn't seem to support the "copies" attribute. - - The HTTP chunking code was missing a CR LF pair at the - end of a 0-length chunk. - - The httpSeparate() function didn't handle embedded - usernames and passwords in the URI properly. - - Doing "lpadmin -p printer -E" didn't restart printing - if there were pending jobs. - - The cancel-job operation now requires either a - requesting-user-name attribute or an authenticated - username. - - The add-printer code did not report errors if the - interface script or PPD file could not be renamed. - - Request files are now created without world read - permissions. - - Added a cupsLastError() function to the CUPS API to - retrieve the IPP error code from the last request. - - Options are now case-insensitive. - - The lpq command now provides 10 characters for the - username instead of the original (Berkeley standard) - 7. - - The cancel command needed a local CUPS server to work - (or the appropriate ServerName in cupsd.conf) - - The cancel and lprm commands didn't report the IPP - error if the job could not be cancelled. - - The lp and lpr commands didn't intercept SIGTERM to - remove temporary files when printing from stdin. - - The lp and lpr commands didn't report the IPP error if - the job could not be printed. + - Removed fonts and GNU Ghostscript code from base CUPS + distribution; these are now available as part of ESP + Ghostscript, or by patching GNU Ghostscript using the + patches in the pstoraster directory. diff --git a/Makefile b/Makefile index b40afe2b93..c7fc6dd34e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.31.2.2 2001/12/26 16:52:05 mike Exp $" +# "$Id: Makefile,v 1.31.2.3 2001/12/29 19:04:05 mike Exp $" # # Top-level Makefile for the Common UNIX Printing System (CUPS). # @@ -28,7 +28,7 @@ include Makedefs # Directories to make... # -DIRS = cups backend berkeley cgi-bin filter man pdftops pstoraster \ +DIRS = cups backend berkeley cgi-bin filter man pdftops \ scheduler systemv # @@ -66,8 +66,6 @@ install: (cd data; $(MAKE) $(MFLAGS) install) echo Installing in doc... (cd doc; $(MAKE) $(MFLAGS) install) - echo Installing in fonts... - (cd fonts; $(MAKE) $(MFLAGS) install) echo Installing in locale... (cd locale; $(MAKE) $(MFLAGS) install) echo Installing in ppd... @@ -143,5 +141,5 @@ tardist: epm $(EPMFLAGS) -f tardist cups # -# End of "$Id: Makefile,v 1.31.2.2 2001/12/26 16:52:05 mike Exp $". +# End of "$Id: Makefile,v 1.31.2.3 2001/12/29 19:04:05 mike Exp $". # diff --git a/conf/mime.convs b/conf/mime.convs index d5ea32c5b0..dc3d79671c 100644 --- a/conf/mime.convs +++ b/conf/mime.convs @@ -1,5 +1,5 @@ # -# "$Id: mime.convs,v 1.12 2001/03/02 22:33:58 andy Exp $" +# "$Id: mime.convs,v 1.12.2.1 2001/12/29 19:04:05 mike Exp $" # # MIME converts file for the Common UNIX Printing System (CUPS). # @@ -30,10 +30,12 @@ # # General Notes: # -# Currently the "cost" field is not used (all filters are assumed to -# be equally costly in terms of speed/memory). Also, a filter program -# *must* accept the standard command-line arguments (job-id, user, title, -# copies,options,[filename or stdin]) or this won't work. +# The "cost" field is used to find the least costly filters to run +# when converting a job file to a printable format. +# +# All filters *must* accept the standard command-line arguments +# (job-id, user, title, copies, options, [filename or stdin]) to +# work with CUPS. # ######################################################################## @@ -41,18 +43,25 @@ # PostScript filters # -#application/msword application/postscript 33 mswordtops application/pdf application/postscript 33 pdftops application/postscript application/vnd.cups-postscript 66 pstops application/vnd.hp-HPGL application/postscript 66 hpgltops image/* application/vnd.cups-postscript 66 imagetops -#text/html application/postscript 33 htmltops application/x-cshell application/postscript 33 texttops application/x-perl application/postscript 33 texttops application/x-shell application/postscript 33 texttops -text/html application/postscript 33 texttops text/plain application/postscript 33 texttops -application/vnd.cups-form application/vnd.cups-postscript 33 formtops +text/html application/postscript 33 texttops + +######################################################################## +# +# Form filter... +# +# This filter does not currently exist, but the file format is defined +# in the IDD and registered with the IANA for future use... +# + +#application/vnd.cups-form application/vnd.cups-postscript 33 formtops ######################################################################## # @@ -60,7 +69,7 @@ application/vnd.cups-form application/vnd.cups-postscript 33 formtops # image/* application/vnd.cups-raster 100 imagetoraster -application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster +# pstoraster is now included with ESP Ghostscript ######################################################################## # @@ -74,5 +83,5 @@ application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster #*/* application/vnd.cups-raw 0 - # -# End of "$Id: mime.convs,v 1.12 2001/03/02 22:33:58 andy Exp $". +# End of "$Id: mime.convs,v 1.12.2.1 2001/12/29 19:04:05 mike Exp $". # diff --git a/fonts/AvantGarde-Book b/fonts/AvantGarde-Book deleted file mode 100644 index 4d3a8b2ba7..0000000000 Binary files a/fonts/AvantGarde-Book and /dev/null differ diff --git a/fonts/AvantGarde-BookOblique b/fonts/AvantGarde-BookOblique deleted file mode 100644 index c25c6ee4cc..0000000000 Binary files a/fonts/AvantGarde-BookOblique and /dev/null differ diff --git a/fonts/AvantGarde-Demi b/fonts/AvantGarde-Demi deleted file mode 100644 index 67046dbe68..0000000000 Binary files a/fonts/AvantGarde-Demi and /dev/null differ diff --git a/fonts/AvantGarde-DemiOblique b/fonts/AvantGarde-DemiOblique deleted file mode 100644 index e0f6559e93..0000000000 Binary files a/fonts/AvantGarde-DemiOblique and /dev/null differ diff --git a/fonts/Bookman-Demi b/fonts/Bookman-Demi deleted file mode 100644 index 4e26c1cf52..0000000000 Binary files a/fonts/Bookman-Demi and /dev/null differ diff --git a/fonts/Bookman-DemiItalic b/fonts/Bookman-DemiItalic deleted file mode 100644 index 6520e718dc..0000000000 Binary files a/fonts/Bookman-DemiItalic and /dev/null differ diff --git a/fonts/Bookman-Light b/fonts/Bookman-Light deleted file mode 100644 index 7cbac2c456..0000000000 Binary files a/fonts/Bookman-Light and /dev/null differ diff --git a/fonts/Bookman-LightItalic b/fonts/Bookman-LightItalic deleted file mode 100644 index 3ef45dcbec..0000000000 Binary files a/fonts/Bookman-LightItalic and /dev/null differ diff --git a/fonts/Charter-Bold b/fonts/Charter-Bold deleted file mode 100644 index 0d82077ec4..0000000000 Binary files a/fonts/Charter-Bold and /dev/null differ diff --git a/fonts/Charter-BoldItalic b/fonts/Charter-BoldItalic deleted file mode 100644 index c7a5f8798b..0000000000 Binary files a/fonts/Charter-BoldItalic and /dev/null differ diff --git a/fonts/Charter-Italic b/fonts/Charter-Italic deleted file mode 100644 index 6abe1cdfdb..0000000000 Binary files a/fonts/Charter-Italic and /dev/null differ diff --git a/fonts/Charter-Roman b/fonts/Charter-Roman deleted file mode 100644 index b25133d510..0000000000 Binary files a/fonts/Charter-Roman and /dev/null differ diff --git a/fonts/Courier b/fonts/Courier deleted file mode 100644 index 0cadce7d13..0000000000 Binary files a/fonts/Courier and /dev/null differ diff --git a/fonts/Courier-Bold b/fonts/Courier-Bold deleted file mode 100644 index f1da6121bb..0000000000 Binary files a/fonts/Courier-Bold and /dev/null differ diff --git a/fonts/Courier-BoldOblique b/fonts/Courier-BoldOblique deleted file mode 100644 index 8b7c24ff3a..0000000000 Binary files a/fonts/Courier-BoldOblique and /dev/null differ diff --git a/fonts/Courier-Oblique b/fonts/Courier-Oblique deleted file mode 100644 index 107a513372..0000000000 Binary files a/fonts/Courier-Oblique and /dev/null differ diff --git a/fonts/Helvetica b/fonts/Helvetica deleted file mode 100644 index ff605552c9..0000000000 Binary files a/fonts/Helvetica and /dev/null differ diff --git a/fonts/Helvetica-Bold b/fonts/Helvetica-Bold deleted file mode 100644 index aec380a331..0000000000 Binary files a/fonts/Helvetica-Bold and /dev/null differ diff --git a/fonts/Helvetica-BoldOblique b/fonts/Helvetica-BoldOblique deleted file mode 100644 index 479904083a..0000000000 Binary files a/fonts/Helvetica-BoldOblique and /dev/null differ diff --git a/fonts/Helvetica-Narrow b/fonts/Helvetica-Narrow deleted file mode 100644 index f2387225df..0000000000 Binary files a/fonts/Helvetica-Narrow and /dev/null differ diff --git a/fonts/Helvetica-Narrow-Bold b/fonts/Helvetica-Narrow-Bold deleted file mode 100644 index 7ee6a2c812..0000000000 Binary files a/fonts/Helvetica-Narrow-Bold and /dev/null differ diff --git a/fonts/Helvetica-Narrow-BoldOblique b/fonts/Helvetica-Narrow-BoldOblique deleted file mode 100644 index d2e96f3b7e..0000000000 Binary files a/fonts/Helvetica-Narrow-BoldOblique and /dev/null differ diff --git a/fonts/Helvetica-Narrow-Oblique b/fonts/Helvetica-Narrow-Oblique deleted file mode 100644 index 4ff13e5f64..0000000000 Binary files a/fonts/Helvetica-Narrow-Oblique and /dev/null differ diff --git a/fonts/Helvetica-Oblique b/fonts/Helvetica-Oblique deleted file mode 100644 index 876cda876d..0000000000 Binary files a/fonts/Helvetica-Oblique and /dev/null differ diff --git a/fonts/Makefile b/fonts/Makefile deleted file mode 100644 index 81d3289efa..0000000000 --- a/fonts/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -# -# "$Id: Makefile,v 1.6 1999/05/10 17:42:00 mike Exp $" -# -# Fonts makefile for the Common UNIX Printing System (CUPS). -# -# Copyright 1993-2001 by Easy Software Products. -# -# These coded instructions, statements, and computer programs are the -# property of Easy Software Products and are protected by Federal -# copyright law. Distribution and use rights are outlined in the file -# "LICENSE.txt" which should have been included with this file. If this -# file is missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636-3111 USA -# -# Voice: (301) 373-9603 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org -# - -include ../Makedefs - -# -# Font files... -# - -FONTS = AvantGarde-Book AvantGarde-BookOblique AvantGarde-Demi \ - AvantGarde-DemiOblique Bookman-Demi Bookman-DemiItalic \ - Bookman-Light Bookman-LightItalic Charter-Bold \ - Charter-BoldItalic Charter-Italic Charter-Roman Courier \ - Courier-Bold Courier-BoldOblique Courier-Oblique \ - Helvetica Helvetica-Bold Helvetica-BoldOblique \ - Helvetica-Narrow Helvetica-Narrow-Bold \ - Helvetica-Narrow-BoldOblique Helvetica-Narrow-Oblique \ - Helvetica-Oblique NewCenturySchlbk-Bold \ - NewCenturySchlbk-BoldItalic NewCenturySchlbk-Italic \ - NewCenturySchlbk-Roman Palatino-Bold \ - Palatino-BoldItalic Palatino-Italic Palatino-Roman \ - Symbol Times-Bold Times-BoldItalic Times-Italic \ - Times-Roman Utopia-Bold Utopia-BoldItalic Utopia-Italic \ - Utopia-Regular ZapfChancery-MediumItalic ZapfDingbats - - -# -# Make everything... -# - -all: - - -# -# Clean all config and object files... -# - -clean: - - -# -# Install files... -# - -install: - $(INSTALL_DIR) $(DATADIR)/fonts - for file in $(FONTS); do \ - $(INSTALL_DATA) $$file $(DATADIR)/fonts; \ - done - - -# -# End of "$Id: Makefile,v 1.6 1999/05/10 17:42:00 mike Exp $". -# diff --git a/fonts/NewCenturySchlbk-Bold b/fonts/NewCenturySchlbk-Bold deleted file mode 100644 index 321a282f43..0000000000 Binary files a/fonts/NewCenturySchlbk-Bold and /dev/null differ diff --git a/fonts/NewCenturySchlbk-BoldItalic b/fonts/NewCenturySchlbk-BoldItalic deleted file mode 100644 index 31e589003a..0000000000 Binary files a/fonts/NewCenturySchlbk-BoldItalic and /dev/null differ diff --git a/fonts/NewCenturySchlbk-Italic b/fonts/NewCenturySchlbk-Italic deleted file mode 100644 index 2fbd616479..0000000000 Binary files a/fonts/NewCenturySchlbk-Italic and /dev/null differ diff --git a/fonts/NewCenturySchlbk-Roman b/fonts/NewCenturySchlbk-Roman deleted file mode 100644 index 6cbded3c76..0000000000 Binary files a/fonts/NewCenturySchlbk-Roman and /dev/null differ diff --git a/fonts/Palatino-Bold b/fonts/Palatino-Bold deleted file mode 100644 index 7f5df43f3d..0000000000 Binary files a/fonts/Palatino-Bold and /dev/null differ diff --git a/fonts/Palatino-BoldItalic b/fonts/Palatino-BoldItalic deleted file mode 100644 index 1c812b8391..0000000000 Binary files a/fonts/Palatino-BoldItalic and /dev/null differ diff --git a/fonts/Palatino-Italic b/fonts/Palatino-Italic deleted file mode 100644 index 8d0f820de1..0000000000 Binary files a/fonts/Palatino-Italic and /dev/null differ diff --git a/fonts/Palatino-Roman b/fonts/Palatino-Roman deleted file mode 100644 index 4101b73358..0000000000 Binary files a/fonts/Palatino-Roman and /dev/null differ diff --git a/fonts/Symbol b/fonts/Symbol deleted file mode 100644 index d0505e46cd..0000000000 Binary files a/fonts/Symbol and /dev/null differ diff --git a/fonts/Times-Bold b/fonts/Times-Bold deleted file mode 100644 index 47f8fd57da..0000000000 Binary files a/fonts/Times-Bold and /dev/null differ diff --git a/fonts/Times-BoldItalic b/fonts/Times-BoldItalic deleted file mode 100644 index 2d19d942ea..0000000000 Binary files a/fonts/Times-BoldItalic and /dev/null differ diff --git a/fonts/Times-Italic b/fonts/Times-Italic deleted file mode 100644 index aa9ff5f8ac..0000000000 Binary files a/fonts/Times-Italic and /dev/null differ diff --git a/fonts/Times-Roman b/fonts/Times-Roman deleted file mode 100644 index cbae7ed157..0000000000 Binary files a/fonts/Times-Roman and /dev/null differ diff --git a/fonts/Utopia-Bold b/fonts/Utopia-Bold deleted file mode 100644 index 06b91085a4..0000000000 Binary files a/fonts/Utopia-Bold and /dev/null differ diff --git a/fonts/Utopia-BoldItalic b/fonts/Utopia-BoldItalic deleted file mode 100644 index c36689694d..0000000000 Binary files a/fonts/Utopia-BoldItalic and /dev/null differ diff --git a/fonts/Utopia-Italic b/fonts/Utopia-Italic deleted file mode 100644 index e33f16af90..0000000000 Binary files a/fonts/Utopia-Italic and /dev/null differ diff --git a/fonts/Utopia-Regular b/fonts/Utopia-Regular deleted file mode 100644 index 1772a3a0b7..0000000000 Binary files a/fonts/Utopia-Regular and /dev/null differ diff --git a/fonts/ZapfChancery-MediumItalic b/fonts/ZapfChancery-MediumItalic deleted file mode 100644 index 28443517d3..0000000000 Binary files a/fonts/ZapfChancery-MediumItalic and /dev/null differ diff --git a/fonts/ZapfDingbats b/fonts/ZapfDingbats deleted file mode 100644 index 4a3c386d29..0000000000 Binary files a/fonts/ZapfDingbats and /dev/null differ diff --git a/pstoraster/.cvsignore b/pstoraster/.cvsignore index cf5b1a290e..e69de29bb2 100644 --- a/pstoraster/.cvsignore +++ b/pstoraster/.cvsignore @@ -1,3 +0,0 @@ -pstoraster -genarch -arch.h diff --git a/pstoraster/Dependencies b/pstoraster/Dependencies deleted file mode 100644 index 1a72580afe..0000000000 --- a/pstoraster/Dependencies +++ /dev/null @@ -1,2213 +0,0 @@ -# DO NOT DELETE - -gconfig.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gconfig.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gscdefs.h gconfigv.h -gconfig.o: gconf.h gconfig.h ../config.h gxdevice.h gxdevcli.h gscompt.h -gconfig.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gconfig.o: gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h -gconfig.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gconfig.o: gsccode.h gsparam.h gsmalloc.h gxiodev.h stat_.h - -gdevabuf.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevabuf.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxdevice.h -gdevabuf.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gdevabuf.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gdevabuf.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gdevabuf.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gdevabuf.o: gdevmem.h gxbitops.h - -gdevbbox.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gdevbbox.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gdevbbox.o: gsparam.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gdevbbox.o: gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gdevbbox.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gdevbbox.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsmalloc.h -gdevbbox.o: gsdevice.h gdevbbox.h gxdcolor.h gscsel.h gxiparam.h gxistate.h -gdevbbox.o: gxline.h gslparam.h gxmatrix.h gxtmap.h gxpaint.h gxpath.h -gdevbbox.o: gscpm.h gspenum.h gsrect.h gxcpath.h - -gdevcups.o: std.h stdpre.h arch.h gdevprn.h memory_.h string_.h gx.h stdio_.h -gdevcups.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h -gdevcups.o: gpgetenv.h gserrors.h gsmatrix.h gsutil.h gxdevice.h gxdevcli.h -gdevcups.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevcups.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -gdevcups.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevcups.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxcldev.h gxht.h -gdevcups.o: gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h strimpl.h -gdevcups.o: scommon.h scfx.h shc.h gsbittab.h srlx.h gxclist.h gscspace.h -gdevcups.o: gxband.h gxclio.h gxbcache.h gxistate.h gscsel.h gxline.h -gdevcups.o: gslparam.h gxmatrix.h gsexit.h ../filter/raster.h ../cups/ppd.h - -gdevdbit.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gdevdbit.o: gsmemory.h gsmemraw.h gdebug.h gpcheck.h gserrors.h gsbittab.h -gdevdbit.o: gsrect.h gsropt.h gxdcolor.h gscsel.h gsdcolor.h gsccolor.h -gdevdbit.o: gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gdevdbit.o: gsbitops.h gxdevice.h gxdevcli.h gscompt.h gsmatrix.h gsiparam.h -gdevdbit.o: gsrefct.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevdbit.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h gxbitops.h -gdevdbit.o: gxcpath.h - -gdevddrw.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gdevddrw.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gpcheck.h -gdevddrw.o: gserrors.h gxfixed.h gxmatrix.h gsmatrix.h gxdcolor.h gscsel.h -gdevddrw.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gdevddrw.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxdevice.h gxdevcli.h -gdevddrw.o: gscompt.h gsiparam.h gsrefct.h gsxfont.h gxcvalue.h gxtext.h -gdevddrw.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxiparam.h gxistate.h -gdevddrw.o: gxline.h gslparam.h gxtmap.h - -gdevdflt.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gdevdflt.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsropt.h gxcomp.h -gdevdflt.o: gscompt.h gsrefct.h gxbitfmt.h gxdevice.h gxdevcli.h gsdcolor.h -gdevdflt.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gdevdflt.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsxfont.h gxcvalue.h -gdevdflt.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gdevdflt.o: gxdevmem.h - -gdevdgbr.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gdevdgbr.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gxdevice.h gxdevcli.h -gdevdgbr.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevdgbr.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevdgbr.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevdgbr.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxgetbit.h -gdevdgbr.o: gxbitfmt.h gxlum.h gdevmem.h gxbitops.h - -gdevhit.o: std.h stdpre.h arch.h gserror.h gserrors.h gstypes.h gsmemory.h -gdevhit.o: gsmemraw.h gxdevice.h stdio_.h gxdevcli.h gscompt.h gsdcolor.h -gdevhit.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gdevhit.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -gdevhit.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gdevhit.o: gsparam.h gsmalloc.h - -gdevm16.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm16.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm16.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm16.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm16.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevm16.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h -gdevm16.o: gxbitops.h - -gdevm1.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm1.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm1.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm1.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevm1.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h gxbitops.h - -gdevm24.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm24.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm24.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm24.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm24.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevm24.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h -gdevm24.o: gxbitops.h - -gdevm2.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm2.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm2.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm2.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevm2.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h gxbitops.h - -gdevm32.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm32.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm32.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm32.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm32.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevm32.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h -gdevm32.o: gxbitops.h - -gdevm4.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm4.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm4.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm4.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm4.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevm4.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h gxbitops.h - -gdevm8.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevm8.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevm8.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevm8.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevm8.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gdevm8.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h gxbitops.h - -gdevmem.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevmem.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrect.h -gdevmem.o: gsstruct.h gxarith.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gdevmem.o: gsccolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gdevmem.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gdevmem.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gdevmem.o: gxgetbit.h gxbitfmt.h gxdevmem.h gdevmem.h gxbitops.h - -gdevmpla.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gdevmpla.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gdevmpla.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevmpla.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevmpla.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevmpla.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gdevmem.h -gdevmpla.o: gxbitops.h - -gdevnfwd.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gdevnfwd.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gxdevice.h gxdevcli.h -gdevnfwd.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gdevnfwd.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gdevnfwd.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevnfwd.o: gstext.h gsccode.h gsparam.h gsmalloc.h - -gdevpipe.o: errno_.h std.h stdpre.h arch.h pipe_.h stdio_.h string_.h -gdevpipe.o: gserror.h gstypes.h gsmemory.h gsmemraw.h stream.h scommon.h -gdevpipe.o: gsstruct.h gxiodev.h stat_.h - -gdevprn.o: ctype_.h std.h stdpre.h arch.h gdevprn.h memory_.h string_.h gx.h -gdevprn.o: stdio_.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h -gdevprn.o: gp.h gpgetenv.h gserrors.h gsmatrix.h gsutil.h gxdevice.h -gdevprn.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gdevprn.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h -gdevprn.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gdevprn.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxcldev.h -gdevprn.o: gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h -gdevprn.o: strimpl.h scommon.h scfx.h shc.h gsbittab.h srlx.h gxclist.h -gdevprn.o: gscspace.h gxband.h gxclio.h gxbcache.h gxistate.h gscsel.h -gdevprn.o: gxline.h gslparam.h gxmatrix.h - -gp_getnv.o: stdio_.h std.h stdpre.h arch.h string_.h gsmemory.h gsmemraw.h -gp_getnv.o: gstypes.h gp.h gpgetenv.h - -gp_nofb.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gp_nofb.o: gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h gxdevice.h -gp_nofb.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gp_nofb.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gp_nofb.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gp_nofb.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h - -gp_nsync.o: std.h stdpre.h arch.h gserror.h gserrors.h gpsync.h - -gp_unifn.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gp_unifn.o: gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h - -gp_unifs.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gp_unifs.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h -gp_unifs.o: gsstruct.h gsutil.h stat_.h dirent_.h ../config.h ../cups/cups.h -gp_unifs.o: ../cups/ipp.h ../cups/http.h ../cups/string.h ../cups/md5.h -gp_unifs.o: ../cups/ppd.h - -gp_unix.o: pipe_.h stdio_.h std.h stdpre.h arch.h string_.h time_.h -gp_unix.o: ../config.h gx.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h -gp_unix.o: gdebug.h gsexit.h gp.h gpgetenv.h - -gsalloc.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsalloc.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gserrors.h gsmdebug.h -gsalloc.o: gsstruct.h gxalloc.h gsalloc.h gxobj.h gxbitmap.h gsbitmap.h -gsalloc.o: stream.h scommon.h - -gsalpha.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsalpha.o: gsmemory.h gsmemraw.h gdebug.h gsalpha.h gxdcolor.h gscsel.h -gsalpha.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gsalpha.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gzstate.h gscpm.h -gsalpha.o: gsrefct.h gxistate.h gxcvalue.h gxfixed.h gxline.h gslparam.h -gsalpha.o: gxmatrix.h gsmatrix.h gxtmap.h gsstate.h gsdevice.h gsline.h -gsalpha.o: gscolor.h gsht.h gxstate.h - -gsargs.o: ctype_.h std.h stdpre.h arch.h stdio_.h string_.h gsexit.h -gsargs.o: gsmemory.h gsmemraw.h gsargs.h - -gsbitops.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h gstypes.h -gsbitops.o: gxbitops.h gsbitops.h - -gsbittab.o: stdpre.h gsbittab.h - -gscdefs.o: stdpre.h gscdefs.h gconfigv.h gconf.h gconfig.h ../config.h - -gscdevn.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscdevn.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrefct.h gsmatrix.h -gscdevn.o: gxcspace.h gscspace.h gsccolor.h gsstruct.h gscsel.h gxfrac.h - -gschar0.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gschar0.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gschar0.o: gsfcmap.h gsccode.h gxfixed.h gxdevice.h gxdevcli.h gscompt.h -gschar0.o: gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gschar0.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -gschar0.o: gsxfont.h gxcvalue.h gxtext.h gstext.h gsparam.h gsmalloc.h -gschar0.o: gxdevmem.h gxchar.h gschar.h gscpm.h gxfont.h gsfont.h gsuid.h -gschar0.o: gxftype.h gxfont0.h - -gschar.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gschar.o: gsmemory.h gsmemraw.h gdebug.h memory_.h string_.h gserrors.h -gschar.o: gsstruct.h gxfixed.h gxarith.h gxmatrix.h gsmatrix.h gzstate.h -gschar.o: gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h gsccolor.h -gschar.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -gschar.o: gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h -gschar.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxcoord.h gscoord.h -gschar.o: gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h gxtext.h -gschar.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxchar.h -gschar.o: gschar.h gxfont.h gsfont.h gsuid.h gxftype.h gxfont0.h gxfcache.h -gschar.o: gxbcache.h gspath.h gspenum.h gzpath.h gxpath.h gsrect.h - -gscie.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gscie.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gscie.o: gsmatrix.h gxcspace.h gscspace.h gsccolor.h gscsel.h gxfrac.h -gscie.o: gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h -gscie.o: gscie.h gsrefct.h gxctable.h gxfixed.h gxarith.h gxdevice.h -gscie.o: gxdevcli.h gscompt.h gsdcolor.h gxhttile.h gxcindex.h gsbitops.h -gscie.o: gsiparam.h gsropt.h gsxfont.h gxcvalue.h gxtext.h gstext.h gsccode.h -gscie.o: gsparam.h gsmalloc.h gxcmap.h gxfmap.h gxtmap.h gzstate.h gscpm.h -gscie.o: gxdcolor.h gxistate.h gxline.h gslparam.h gxmatrix.h gsstate.h -gscie.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h - -gsclipsr.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsclipsr.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsclipsr.h - -gscolor1.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscolor1.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h gsutil.h -gscolor1.o: gsccolor.h gxcspace.h gscspace.h gscsel.h gxfrac.h gxdcconv.h -gscolor1.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gxarith.h gxbitmap.h -gscolor1.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gscolor1.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gscolor1.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h -gscolor1.o: gxtmap.h gzstate.h gscpm.h gxdcolor.h gxistate.h gxline.h -gscolor1.o: gslparam.h gxmatrix.h gsstate.h gsdevice.h gsline.h gscolor.h -gscolor1.o: gsht.h gxstate.h gscolor1.h - -gscolor2.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gscolor2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxarith.h -gscolor2.o: gxfixed.h gxmatrix.h gsmatrix.h gxcspace.h gscspace.h gsccolor.h -gscolor2.o: gsstruct.h gscsel.h gxfrac.h gxcolor2.h gscolor2.h gsptype1.h -gscolor2.o: gspcolor.h gsuid.h gxbitmap.h gsbitmap.h gsrefct.h gzstate.h -gscolor2.o: gscpm.h gxdcolor.h gsdcolor.h gxhttile.h gxcindex.h gsbitops.h -gscolor2.o: gsropt.h gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h -gscolor2.o: gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h - -gscolor3.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscolor3.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gscspace.h gsmatrix.h -gscolor3.o: gscolor2.h gsptype1.h gspcolor.h gsccolor.h gsstruct.h gsuid.h -gscolor3.o: gxbitmap.h gsbitmap.h gscolor3.h gspath.h gspenum.h gzstate.h -gscolor3.o: gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h gxarith.h -gscolor3.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h -gscolor3.o: gxfixed.h gxline.h gslparam.h gxmatrix.h gxtmap.h gsstate.h -gscolor3.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxshade.h -gscolor3.o: gsshade.h gsdsrc.h gsfunc.h stream.h scommon.h - -gscolor.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscolor.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h gsutil.h -gscolor.o: gsccolor.h gxcspace.h gscspace.h gscsel.h gxfrac.h gxdcconv.h -gscolor.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gxarith.h gxbitmap.h -gscolor.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gscolor.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gscolor.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h gxtmap.h -gscolor.o: gzstate.h gscpm.h gxdcolor.h gxistate.h gxline.h gslparam.h -gscolor.o: gxmatrix.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h -gscolor.o: gxstate.h - -gscoord.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gscoord.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsccode.h -gscoord.o: gxfarith.h gconfigv.h gxarith.h gxfixed.h gxmatrix.h gsmatrix.h -gscoord.o: gxfont.h gsfont.h gsuid.h gsstruct.h gxftype.h gxpath.h gscpm.h -gscoord.o: gslparam.h gspenum.h gsrect.h gzstate.h gsrefct.h gxdcolor.h -gscoord.o: gscsel.h gsdcolor.h gsccolor.h gxbitmap.h gsbitmap.h gxhttile.h -gscoord.o: gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h gxline.h -gscoord.o: gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h -gscoord.o: gxcoord.h gscoord.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h -gscoord.o: gsxfont.h gxtext.h gstext.h gsparam.h gsmalloc.h - -gscparam.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gscparam.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gscparam.o: gsparam.h gsstruct.h - -gscpixel.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscpixel.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrefct.h gxcspace.h -gscpixel.o: gscspace.h gsccolor.h gsstruct.h gscsel.h gxfrac.h gscpixel.h -gscpixel.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gxarith.h gxbitmap.h -gscpixel.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gscpixel.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gscpixel.o: gsccode.h gsparam.h gsmalloc.h - -gscrdp.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gscrdp.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gsdevice.h -gscrdp.o: gserrors.h gsmatrix.h gxcspace.h gscspace.h gsccolor.h gsstruct.h -gscrdp.o: gscsel.h gxfrac.h gscolor2.h gsptype1.h gspcolor.h gsuid.h -gscrdp.o: gxbitmap.h gsbitmap.h gscrdp.h gscie.h gsrefct.h gxctable.h -gscrdp.o: gxfixed.h gsparam.h gxarith.h - -gscrd.o: math_.h std.h stdpre.h arch.h memory_.h string_.h gx.h stdio_.h -gscrd.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gscdefs.h -gscrd.o: gconfigv.h gsdevice.h gserrors.h gsmatrix.h gsparam.h gxcspace.h -gscrd.o: gscspace.h gsccolor.h gsstruct.h gscsel.h gxfrac.h gscolor2.h -gscrd.o: gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h gscrd.h gscie.h -gscrd.o: gsrefct.h gxctable.h gxfixed.h - -gscscie.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gscscie.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gscscie.o: gsmatrix.h gxcspace.h gscspace.h gsccolor.h gscsel.h gxfrac.h -gscscie.o: gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h -gscscie.o: gscie.h gsrefct.h gxctable.h gxfixed.h gxarith.h gxdevice.h -gscscie.o: gxdevcli.h gscompt.h gsdcolor.h gxhttile.h gxcindex.h gsbitops.h -gscscie.o: gsiparam.h gsropt.h gsxfont.h gxcvalue.h gxtext.h gstext.h -gscscie.o: gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h gxtmap.h -gscscie.o: gzstate.h gscpm.h gxdcolor.h gxistate.h gxline.h gslparam.h -gscscie.o: gxmatrix.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h -gscscie.o: gxstate.h - -gscsepr.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gscsepr.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrefct.h gsmatrix.h -gscsepr.o: gscsepr.h gscspace.h gxcspace.h gsccolor.h gsstruct.h gscsel.h -gscsepr.o: gxfrac.h gxfixed.h gxcolor2.h gscolor2.h gsptype1.h gspcolor.h -gscsepr.o: gsuid.h gxbitmap.h gsbitmap.h gzstate.h gscpm.h gxdcolor.h -gscsepr.o: gsdcolor.h gxarith.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -gscsepr.o: gxistate.h gxcvalue.h gxline.h gslparam.h gxmatrix.h gxtmap.h -gscsepr.o: gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h - -gscspace.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gscspace.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gscspace.o: gsccolor.h gxcspace.h gscspace.h gscsel.h gxfrac.h gxistate.h -gscspace.o: gsrefct.h gsropt.h gxcvalue.h gxfixed.h gxline.h gslparam.h -gscspace.o: gxmatrix.h gsmatrix.h gxtmap.h - -gsdevice.o: ctype_.h std.h stdpre.h arch.h memory_.h string_.h gx.h stdio_.h -gsdevice.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h -gsdevice.o: gscdefs.h gconfigv.h gserrors.h gp.h gpgetenv.h gsstruct.h -gsdevice.o: gspath.h gspenum.h gspaint.h gsmatrix.h gscoord.h gzstate.h -gsdevice.o: gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h gsccolor.h -gsdevice.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gsdevice.o: gsropt.h gxistate.h gxcvalue.h gxfixed.h gxline.h gslparam.h -gsdevice.o: gxmatrix.h gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h -gsdevice.o: gsht.h gxstate.h gxcmap.h gxfmap.h gxfrac.h gxdevice.h gxdevcli.h -gsdevice.o: gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h -gsdevice.o: gsparam.h gsmalloc.h gxdevmem.h - -gsdevmem.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gsdevmem.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gsdevmem.o: gxarith.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gsdevmem.o: gsstruct.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gsdevmem.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gsdevmem.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gsdevmem.o: gxdevmem.h - -gsdparam.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gsdparam.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gsdparam.o: gsparam.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gsdparam.o: gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gsdparam.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gsdparam.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsmalloc.h - -gsdps1.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsdps1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmatrix.h -gsdps1.o: gscoord.h gspaint.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gsdps1.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gsdps1.o: gxcindex.h gsbitops.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gsdps1.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gsdps1.o: gsmalloc.h gxmatrix.h gspath.h gspenum.h gspath2.h gzpath.h -gsdps1.o: gxpath.h gscpm.h gslparam.h gsrect.h gzcpath.h gxcpath.h gzstate.h -gsdps1.o: gxdcolor.h gscsel.h gxistate.h gxline.h gxtmap.h gsstate.h -gsdps1.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h - -gsdsrc.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsdsrc.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gsdsrc.h gsstruct.h -gsdsrc.o: gserrors.h stream.h scommon.h - -gsfcmap.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsfcmap.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h gxfcmap.h -gsfcmap.o: gsfcmap.h gsccode.h gsuid.h - -gsfont0.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsfont0.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gsfont0.o: gxfixed.h gsmatrix.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gsfont0.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gsfont0.o: gsbitops.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gsfont0.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gsfont0.o: gxchar.h gschar.h gscpm.h gxfcache.h gsuid.h gxbcache.h gxftype.h -gsfont0.o: gxfont.h gsfont.h gxfont0.h - -gsfont.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsfont.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gserrors.h gsstruct.h -gsfont.o: gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h gsrefct.h -gsfont.o: gxdcolor.h gscsel.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -gsfont.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h -gsfont.o: gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h gsdevice.h -gsfont.o: gsline.h gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h gscompt.h -gsfont.o: gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h -gsfont.o: gsmalloc.h gschar.h gxfont.h gsfont.h gsuid.h gxftype.h gxfcache.h -gsfont.o: gxbcache.h - -gsfunc0.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsfunc0.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsfunc0.h -gsfunc0.o: gsfunc.h gsdsrc.h gsstruct.h gxfarith.h gconfigv.h gxarith.h -gsfunc0.o: gxfunc.h - -gsfunc3.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsfunc3.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsfunc3.h -gsfunc3.o: gsfunc.h gsdsrc.h gsstruct.h gxfunc.h - -gsfunc.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsfunc.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gxfunc.h gsfunc.h -gsfunc.o: gsstruct.h - -gshsb.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gshsb.o: gsmemory.h gsmemraw.h gdebug.h gscolor.h gxtmap.h gshsb.h gxfrac.h - -gsht1.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsht1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gsht1.o: gsutil.h gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h -gsht1.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gsht1.o: gsbitops.h gsropt.h gxistate.h gxcvalue.h gxfixed.h gxline.h -gsht1.o: gslparam.h gxmatrix.h gsmatrix.h gxtmap.h gsstate.h gsdevice.h -gsht1.o: gsline.h gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h gscompt.h -gsht1.o: gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h -gsht1.o: gsmalloc.h gzht.h gxht.h gscsepnm.h gsht1.h gxhttype.h gxfmap.h -gsht1.o: gxfrac.h gxdht.h - -gshtscr.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gshtscr.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gshtscr.o: gxarith.h gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h -gshtscr.o: gsdcolor.h gsccolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gshtscr.o: gsbitops.h gsropt.h gxistate.h gxcvalue.h gxfixed.h gxline.h -gshtscr.o: gslparam.h gxmatrix.h gsmatrix.h gxtmap.h gsstate.h gsdevice.h -gshtscr.o: gsline.h gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h -gshtscr.o: gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h -gshtscr.o: gsparam.h gsmalloc.h gzht.h gxht.h gscsepnm.h gsht1.h gxhttype.h -gshtscr.o: gxfmap.h gxfrac.h gxdht.h - -gsht.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsht.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gsht.o: gsutil.h gxarith.h gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h -gsht.o: gsdcolor.h gsccolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gsht.o: gsbitops.h gsropt.h gxistate.h gxcvalue.h gxfixed.h gxline.h -gsht.o: gslparam.h gxmatrix.h gsmatrix.h gxtmap.h gsstate.h gsdevice.h -gsht.o: gsline.h gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h gscompt.h -gsht.o: gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gsht.o: gzht.h gxht.h gscsepnm.h gsht1.h gxhttype.h gxfmap.h gxfrac.h gxdht.h - -gsimage.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsimage.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gsimage.o: gscspace.h gsmatrix.h gsimage.h gsiparam.h gxarith.h gxdevice.h -gsimage.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxbitmap.h gsbitmap.h -gsimage.o: gxhttile.h gxcindex.h gsbitops.h gsrefct.h gsropt.h gsxfont.h -gsimage.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gsimage.o: gsmalloc.h gxiparam.h gxpath.h gscpm.h gslparam.h gspenum.h -gsimage.o: gsrect.h gzstate.h gxdcolor.h gscsel.h gxistate.h gxline.h -gsimage.o: gxmatrix.h gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h -gsimage.o: gxstate.h - -gsimpath.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsimpath.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmatrix.h gsstate.h -gsimpath.o: gsdevice.h gsline.h gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h -gsimpath.o: gspath.h gspenum.h - -gsinit.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h gscdefs.h -gsinit.o: gconfigv.h gsmemory.h gsmemraw.h gsmalloc.h gp.h gpgetenv.h gslib.h - -gsiodev.o: errno_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gsiodev.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gp.h -gsiodev.o: gpgetenv.h gscdefs.h gconfigv.h gsparam.h gsstruct.h gxiodev.h -gsiodev.o: stat_.h - -gsline.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gsline.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gsline.o: gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h gsrefct.h -gsline.o: gxdcolor.h gscsel.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gsline.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -gsline.o: gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h -gsline.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gzline.h - -gsmalloc.o: malloc_.h std.h stdpre.h arch.h gdebug.h gstypes.h gsmemory.h -gsmalloc.o: gsmemraw.h gsmdebug.h gsstruct.h gsmalloc.h - -gsmatrix.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gsmatrix.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxfarith.h -gsmatrix.o: gconfigv.h gxarith.h gxfixed.h gxmatrix.h gsmatrix.h - -gsmemory.o: memory_.h std.h stdpre.h arch.h gstypes.h gsmemory.h gsmemraw.h -gsmemory.o: gsmdebug.h gsrefct.h gsstruct.h - -gsmisc.o: ctype_.h std.h stdpre.h arch.h malloc_.h math_.h memory_.h -gsmisc.o: string_.h gx.h stdio_.h gserror.h gsio.h gstypes.h gsmemory.h -gsmisc.o: gsmemraw.h gdebug.h gpcheck.h gserrors.h gconfigv.h gxfarith.h -gsmisc.o: gxarith.h gxfixed.h - -gsnorop.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsnorop.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrop.h gsropt.h -gsnorop.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gsnorop.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gsnorop.o: gsiparam.h gsrefct.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gsnorop.o: gstext.h gsccode.h gdevmrop.h - -gspaint.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gspaint.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gpcheck.h gserrors.h -gspaint.o: gsropt.h gxfixed.h gxmatrix.h gsmatrix.h gspaint.h gspath.h -gspaint.o: gspenum.h gzpath.h gxpath.h gscpm.h gslparam.h gsrect.h gsrefct.h -gspaint.o: gsstruct.h gxpaint.h gzstate.h gxdcolor.h gscsel.h gsdcolor.h -gspaint.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gspaint.o: gsbitops.h gxistate.h gxcvalue.h gxline.h gxtmap.h gsstate.h -gspaint.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxdevice.h -gspaint.o: gxdevcli.h gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h -gspaint.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxcpath.h - -gsparams.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsparams.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gserrors.h gsparams.h -gsparams.o: stream.h scommon.h gsstruct.h gsparam.h - -gsparam.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gsparam.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gsparam.o: gsparam.h gsstruct.h - -gspath1.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gspath1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gspath1.o: gxfixed.h gxfarith.h gconfigv.h gxarith.h gxmatrix.h gsmatrix.h -gspath1.o: gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h -gspath1.o: gsccolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gspath1.o: gsropt.h gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h -gspath1.o: gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gspath.h -gspath1.o: gspenum.h gzpath.h gxpath.h gsrect.h gscoord.h - -gspath.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gspath.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gxfixed.h gxmatrix.h -gspath.o: gsmatrix.h gscoord.h gzstate.h gscpm.h gsrefct.h gxdcolor.h -gspath.o: gscsel.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gspath.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h -gspath.o: gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h gsdevice.h -gspath.o: gsline.h gscolor.h gsht.h gxstate.h gzpath.h gxpath.h gspenum.h -gspath.o: gsrect.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -gspath.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gspath.o: gzcpath.h gxcpath.h - -gspcolor.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gspcolor.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrop.h -gspcolor.o: gsropt.h gsstruct.h gsutil.h gxarith.h gxfixed.h gxmatrix.h -gspcolor.o: gsmatrix.h gxcoord.h gscoord.h gxcspace.h gscspace.h gsccolor.h -gspcolor.o: gscsel.h gxfrac.h gxcolor2.h gscolor2.h gsptype1.h gspcolor.h -gspcolor.o: gsuid.h gxbitmap.h gsbitmap.h gsrefct.h gxdcolor.h gsdcolor.h -gspcolor.o: gxhttile.h gxcindex.h gsbitops.h gxdevice.h gxdevcli.h gscompt.h -gspcolor.o: gsiparam.h gsxfont.h gxcvalue.h gxtext.h gstext.h gsccode.h -gspcolor.o: gsparam.h gsmalloc.h gxdevmem.h gxclip2.h gxmclip.h gxclip.h -gspcolor.o: gspath.h gspenum.h gxpath.h gscpm.h gslparam.h gsrect.h -gspcolor.o: gxp1fill.h gxpcolor.h gxpcache.h gzstate.h gxistate.h gxline.h -gspcolor.o: gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h -gspcolor.o: gsimage.h gsiparm4.h - -gsshade.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsshade.o: gsmemory.h gsmemraw.h gdebug.h gscspace.h gserrors.h gsstruct.h -gsshade.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -gsshade.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gsshade.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gsshade.o: gstext.h gsccode.h gxcpath.h gxistate.h gscsel.h gxline.h -gsshade.o: gslparam.h gxmatrix.h gxtmap.h gxpath.h gscpm.h gspenum.h gsrect.h -gsshade.o: gxshade.h gsshade.h gsdsrc.h gsfunc.h stream.h scommon.h - -gsstate.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gsstate.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gserrors.h gsstruct.h -gsstate.o: gsutil.h gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h -gsstate.o: gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gsstate.o: gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h gxfixed.h -gsstate.o: gxline.h gslparam.h gxmatrix.h gsmatrix.h gxtmap.h gsstate.h -gsstate.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxcspace.h -gsstate.o: gscspace.h gxfrac.h gsalpha.h gscolor2.h gsptype1.h gspcolor.h -gsstate.o: gsuid.h gscoord.h gscie.h gxctable.h gxcmap.h gxfmap.h gxdevice.h -gsstate.o: gxdevcli.h gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h -gsstate.o: gsccode.h gsparam.h gsmalloc.h gxpcache.h gzht.h gxht.h gscsepnm.h -gsstate.o: gsht1.h gxhttype.h gxdht.h gzline.h gspath.h gspenum.h gzpath.h -gsstate.o: gxpath.h gsrect.h gzcpath.h gxcpath.h - -gstext.o: std.h stdpre.h arch.h gstypes.h gdebug.h gserror.h gserrors.h -gstext.o: gsmemory.h gsmemraw.h gsstruct.h gxdevcli.h gscompt.h gsdcolor.h -gstext.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gstext.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gstext.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gxpath.h gscpm.h -gstext.o: gslparam.h gspenum.h gsrect.h gzstate.h gxdcolor.h gscsel.h -gstext.o: gxistate.h gxline.h gxmatrix.h gxtmap.h gsstate.h gsdevice.h -gstext.o: gsline.h gscolor.h gsht.h gxstate.h - -gstrap.o: string_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gstrap.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gstrap.h -gstrap.o: gsparam.h - -gstype1.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gstype1.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gstype1.o: gsstruct.h gxarith.h gxfixed.h gxmatrix.h gsmatrix.h gxcoord.h -gstype1.o: gscoord.h gxistate.h gscsel.h gsrefct.h gsropt.h gxcvalue.h -gstype1.o: gxline.h gslparam.h gxtmap.h gzpath.h gxpath.h gscpm.h gspenum.h -gstype1.o: gsrect.h gxfont.h gsccode.h gsfont.h gsuid.h gxftype.h gxfont1.h -gstype1.o: gxtype1.h gscrypt1.h gstype1.h gxop1.h - -gstype2.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gstype2.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gstype2.o: gsstruct.h gxarith.h gxfixed.h gxmatrix.h gsmatrix.h gxcoord.h -gstype2.o: gscoord.h gxistate.h gscsel.h gsrefct.h gsropt.h gxcvalue.h -gstype2.o: gxline.h gslparam.h gxtmap.h gzpath.h gxpath.h gscpm.h gspenum.h -gstype2.o: gsrect.h gxfont.h gsccode.h gsfont.h gsuid.h gxftype.h gxfont1.h -gstype2.o: gxtype1.h gscrypt1.h gstype1.h gxop1.h - -gstype42.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gstype42.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gstype42.o: gsccode.h gsmatrix.h gxfixed.h gxpath.h gscpm.h gslparam.h -gstype42.o: gspenum.h gsrect.h gxfont.h gsfont.h gsuid.h gxftype.h gxfont42.h -gstype42.o: gxistate.h gscsel.h gsrefct.h gsropt.h gxcvalue.h gxline.h -gstype42.o: gxmatrix.h gxtmap.h - -gsutil.o: string_.h std.h stdpre.h arch.h memory_.h gstypes.h gconfigv.h -gsutil.o: gsmemory.h gsmemraw.h gsrect.h gsuid.h gsutil.h - -gxacpath.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxacpath.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrop.h gsropt.h -gxacpath.o: gsstruct.h gsutil.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -gxacpath.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gxdevice.h gxdevcli.h -gxacpath.o: gscompt.h gsmatrix.h gsiparam.h gsrefct.h gsxfont.h gxcvalue.h -gxacpath.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gxacpath.o: gzpath.h gxpath.h gscpm.h gslparam.h gspenum.h gsrect.h gxpaint.h -gxacpath.o: gzcpath.h gxcpath.h gzacpath.h - -gxbcache.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxbcache.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gsmdebug.h gxbcache.h -gxbcache.o: gxbitmap.h gsbitmap.h gsstruct.h - -gxccache.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxccache.o: gsmemory.h gsmemraw.h gdebug.h gpcheck.h gserrors.h gsstruct.h -gxccache.o: gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h gsrefct.h -gxccache.o: gxdcolor.h gscsel.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -gxccache.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h -gxccache.o: gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h gsdevice.h -gxccache.o: gsline.h gscolor.h gsht.h gxstate.h gzpath.h gxpath.h gspenum.h -gxccache.o: gsrect.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -gxccache.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gxccache.o: gzcpath.h gxcpath.h gxchar.h gschar.h gxfont.h gsfont.h gsuid.h -gxccache.o: gxftype.h gxfcache.h gxbcache.h gxxfont.h gscspace.h gsimage.h - -gxccman.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxccman.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gpcheck.h gserrors.h -gxccman.o: gsstruct.h gsbitops.h gsutil.h gxfixed.h gxmatrix.h gsmatrix.h -gxccman.o: gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h gsdcolor.h -gxccman.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxccman.o: gsropt.h gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h -gxccman.o: gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gzpath.h -gxccman.o: gxpath.h gspenum.h gsrect.h gxdevice.h gxdevcli.h gscompt.h -gxccman.o: gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h -gxccman.o: gsmalloc.h gxdevmem.h gxchar.h gschar.h gxfont.h gsfont.h gsuid.h -gxccman.o: gxftype.h gxfcache.h gxbcache.h gxxfont.h - -gxcht.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxcht.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsutil.h -gxcht.o: gxarith.h gxfixed.h gxmatrix.h gsmatrix.h gxdevice.h gxdevcli.h -gxcht.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxbitmap.h gsbitmap.h -gxcht.o: gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h gsropt.h -gxcht.o: gsxfont.h gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h -gxcht.o: gsmalloc.h gxcmap.h gscsel.h gxfmap.h gxfrac.h gxtmap.h gxdcolor.h -gxcht.o: gxistate.h gxline.h gslparam.h gzht.h gxht.h gscsepnm.h gsht1.h -gxcht.o: gsht.h gxhttype.h gxdht.h - -gxclbits.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclbits.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gpcheck.h gserrors.h -gxclbits.o: gsbitops.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gxclbits.o: gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxclbits.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gxclbits.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gxclbits.o: gxdevmem.h gxcldev.h gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h -gxclbits.o: gxtmap.h gxdht.h strimpl.h scommon.h scfx.h shc.h gsbittab.h -gxclbits.o: srlx.h gxclist.h gscspace.h gxband.h gxclio.h gp.h gpgetenv.h -gxclbits.o: gxbcache.h gxistate.h gscsel.h gxline.h gslparam.h gxmatrix.h -gxclbits.o: gxfmap.h gxfrac.h - -gxclimag.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gxclimag.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gxclimag.o: gscspace.h gxarith.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxclimag.o: gsccolor.h gsstruct.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxclimag.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gxclimag.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gxclimag.o: gsmalloc.h gxdevmem.h gxcldev.h gxht.h gscsepnm.h gsht1.h gsht.h -gxclimag.o: gxhttype.h gxtmap.h gxdht.h strimpl.h scommon.h scfx.h shc.h -gxclimag.o: gsbittab.h srlx.h gxclist.h gxband.h gxclio.h gp.h gpgetenv.h -gxclimag.o: gxbcache.h gxistate.h gscsel.h gxline.h gslparam.h gxmatrix.h -gxclimag.o: gxclpath.h gxfmap.h gxfrac.h gxiparam.h gxpath.h gscpm.h -gxclimag.o: gspenum.h gsrect.h siscale.h gconfigv.h - -gxclip2.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclip2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gxclip2.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h -gxclip2.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gxclip2.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gxclip2.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gxclip2.o: gxclip2.h gxmclip.h gxclip.h - -gxclipm.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclipm.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h -gxclipm.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gxclipm.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h -gxclipm.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gxclipm.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxclipm.h -gxclipm.o: gxmclip.h gxclip.h - -gxclip.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxclip.o: gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h gscompt.h -gxclip.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gxclip.o: gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h -gxclip.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gxclip.o: gsparam.h gsmalloc.h gxclip.h gzpath.h gxpath.h gscpm.h gslparam.h -gxclip.o: gspenum.h gsrect.h gzcpath.h gxcpath.h - -gxclist.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gxclist.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h -gxclist.o: gpcheck.h gserrors.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxclist.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gxclist.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -gxclist.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gxclist.o: gsparam.h gsmalloc.h gxdevmem.h gxcldev.h gxht.h gscsepnm.h -gxclist.o: gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h strimpl.h scommon.h -gxclist.o: scfx.h shc.h gsbittab.h srlx.h gxclist.h gscspace.h gxband.h -gxclist.o: gxclio.h gxbcache.h gxistate.h gscsel.h gxline.h gslparam.h -gxclist.o: gxmatrix.h gxclpath.h gsparams.h stream.h - -gxclmem.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclmem.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmalloc.h -gxclmem.o: gxclmem.h gxclio.h gp.h gpgetenv.h strimpl.h scommon.h gsstruct.h -gxclmem.o: ../config.h - -gxclpage.o: gdevprn.h memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h -gxclpage.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h -gxclpage.o: gpgetenv.h gserrors.h gsmatrix.h gsutil.h gxdevice.h gxdevcli.h -gxclpage.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gxclpage.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -gxclpage.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gxclpage.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxcldev.h gxht.h -gxclpage.o: gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h strimpl.h -gxclpage.o: scommon.h scfx.h shc.h gsbittab.h srlx.h gxclist.h gscspace.h -gxclpage.o: gxband.h gxclio.h gxbcache.h gxistate.h gscsel.h gxline.h -gxclpage.o: gslparam.h gxmatrix.h gxclpage.h - -gxclpath.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gxclpath.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gpcheck.h -gxclpath.o: gserrors.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gxclpath.o: gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxclpath.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gxclpath.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gxclpath.o: gsmalloc.h gxdevmem.h gxcldev.h gxht.h gscsepnm.h gsht1.h gsht.h -gxclpath.o: gxhttype.h gxtmap.h gxdht.h strimpl.h scommon.h scfx.h shc.h -gxclpath.o: gsbittab.h srlx.h gxclist.h gscspace.h gxband.h gxclio.h gp.h -gxclpath.o: gpgetenv.h gxbcache.h gxistate.h gscsel.h gxline.h gslparam.h -gxclpath.o: gxmatrix.h gxclpath.h gxcolor2.h gscolor2.h gsptype1.h gspcolor.h -gxclpath.o: gsuid.h gxpaint.h gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h -gxclpath.o: gzcpath.h gxcpath.h - -gxclrast.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclrast.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h -gxclrast.o: gpcheck.h gserrors.h gsbitops.h gsparams.h stream.h scommon.h -gxclrast.o: gsstruct.h gsparam.h gsstate.h gsdevice.h gsline.h gslparam.h -gxclrast.o: gscolor.h gxtmap.h gsht.h gscsel.h gxdcolor.h gsdcolor.h -gxclrast.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxclrast.o: gsropt.h gxdevice.h gxdevcli.h gscompt.h gsmatrix.h gsiparam.h -gxclrast.o: gsrefct.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gxclrast.o: gsccode.h gsmalloc.h gscoord.h gxdevmem.h gxcldev.h gxht.h -gxclrast.o: gscsepnm.h gsht1.h gxhttype.h gxdht.h strimpl.h scfx.h shc.h -gxclrast.o: gsbittab.h srlx.h gxclist.h gscspace.h gxband.h gxclio.h -gxclrast.o: gxbcache.h gxistate.h gxline.h gxmatrix.h gxclpath.h gxcmap.h -gxclrast.o: gxfmap.h gxfrac.h gxcspace.h gxgetbit.h gxbitfmt.h gxpaint.h -gxclrast.o: gdevht.h gzht.h gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h -gxclrast.o: gzcpath.h gxcpath.h gzacpath.h - -gxclread.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxclread.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h -gxclread.o: gpcheck.h gserrors.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxclread.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gxclread.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -gxclread.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gxclread.o: gsparam.h gsmalloc.h gscoord.h gsdevice.h gxdevmem.h gxcldev.h -gxclread.o: gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h -gxclread.o: strimpl.h scommon.h scfx.h shc.h gsbittab.h srlx.h gxclist.h -gxclread.o: gscspace.h gxband.h gxclio.h gxbcache.h gxistate.h gscsel.h -gxclread.o: gxline.h gslparam.h gxmatrix.h gxgetbit.h gxbitfmt.h gdevht.h -gxclread.o: gzht.h gxfmap.h gxfrac.h stream.h - -gxclrect.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxclrect.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsutil.h gxdevice.h -gxclrect.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gxclrect.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gxclrect.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gxclrect.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxdevmem.h -gxclrect.o: gxcldev.h gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h -gxclrect.o: gxdht.h strimpl.h scommon.h scfx.h shc.h gsbittab.h srlx.h -gxclrect.o: gxclist.h gscspace.h gxband.h gxclio.h gp.h gpgetenv.h gxbcache.h -gxclrect.o: gxistate.h gscsel.h gxline.h gslparam.h gxmatrix.h - -gxclutil.o: memory_.h std.h stdpre.h arch.h string_.h gx.h stdio_.h gserror.h -gxclutil.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gp.h gpgetenv.h -gxclutil.o: gpcheck.h gserrors.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxclutil.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -gxclutil.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -gxclutil.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gxclutil.o: gsparam.h gsmalloc.h gxdevmem.h gxcldev.h gxht.h gscsepnm.h -gxclutil.o: gsht1.h gsht.h gxhttype.h gxtmap.h gxdht.h strimpl.h scommon.h -gxclutil.o: scfx.h shc.h gsbittab.h srlx.h gxclist.h gscspace.h gxband.h -gxclutil.o: gxclio.h gxbcache.h gxistate.h gscsel.h gxline.h gslparam.h -gxclutil.o: gxmatrix.h gxclpath.h gsparams.h stream.h - -gxclzlib.o: ../config.h std.h stdpre.h arch.h gstypes.h gsmemory.h gsmemraw.h -gxclzlib.o: gxclmem.h gxclio.h gp.h gpgetenv.h strimpl.h scommon.h gsstruct.h -gxclzlib.o: szlibx.h - -gxcmap.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxcmap.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsccolor.h gsstruct.h -gxcmap.o: gxalpha.h gxcspace.h gscspace.h gscsel.h gxfrac.h gxfarith.h -gxcmap.o: gconfigv.h gxarith.h gxdcconv.h gxdevice.h gxdevcli.h gscompt.h -gxcmap.o: gsdcolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxcmap.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gxcmap.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h -gxcmap.o: gxfmap.h gxtmap.h gxlum.h gzstate.h gscpm.h gxdcolor.h gxistate.h -gxcmap.o: gxline.h gslparam.h gxmatrix.h gsstate.h gsdevice.h gsline.h -gxcmap.o: gscolor.h gsht.h gxstate.h gxdither.h - -gxcpath.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxcpath.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h gsutil.h -gxcpath.o: gsline.h gslparam.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxcpath.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxcpath.o: gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -gxcpath.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gxcpath.o: gsmalloc.h gscoord.h gxstate.h gzpath.h gxpath.h gscpm.h gspenum.h -gxcpath.o: gsrect.h gzcpath.h gxcpath.h - -gxctable.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxctable.o: gsmemory.h gsmemraw.h gdebug.h gxfixed.h gxfrac.h gxctable.h - -gxdcconv.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxdcconv.o: gsmemory.h gsmemraw.h gdebug.h gsdcolor.h gsccolor.h gsstruct.h -gxdcconv.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxdcconv.o: gxdcconv.h gxfrac.h gxdevice.h gxdevcli.h gscompt.h gsmatrix.h -gxdcconv.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gxdcconv.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h -gxdcconv.o: gscsel.h gxfmap.h gxtmap.h gxfarith.h gconfigv.h gxlum.h -gxdcconv.o: gxistate.h gxline.h gslparam.h gxmatrix.h - -gxdcolor.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxdcolor.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsbittab.h gxdcolor.h -gxdcolor.o: gscsel.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gxdcolor.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h gxdevice.h -gxdcolor.o: gxdevcli.h gscompt.h gsmatrix.h gsiparam.h gsrefct.h gsxfont.h -gxdcolor.o: gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h -gxdcolor.o: gsmalloc.h - -gxdither.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxdither.o: gsmemory.h gsmemraw.h gdebug.h gsstruct.h gsdcolor.h gsccolor.h -gxdither.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxdither.o: gxdevice.h gxdevcli.h gscompt.h gsmatrix.h gsiparam.h gsrefct.h -gxdither.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gxdither.o: gsccode.h gsparam.h gsmalloc.h gxlum.h gxcmap.h gscsel.h gxfmap.h -gxdither.o: gxfrac.h gxtmap.h gxdither.h gzht.h gxht.h gscsepnm.h gsht1.h -gxdither.o: gsht.h gxhttype.h gxdht.h - -gxfill.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxfill.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gxfill.o: gxfixed.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -gxfill.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxfill.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gxfill.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gzpath.h gxpath.h -gxfill.o: gscpm.h gslparam.h gspenum.h gsrect.h gzcpath.h gxcpath.h -gxfill.o: gxdcolor.h gscsel.h gxistate.h gxline.h gxmatrix.h gxtmap.h -gxfill.o: gxpaint.h - -gxhint1.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxhint1.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gxarith.h gxfixed.h -gxhint1.o: gxmatrix.h gsmatrix.h gxfont.h gsccode.h gsfont.h gsuid.h -gxhint1.o: gsstruct.h gxftype.h gxfont1.h gxtype1.h gscrypt1.h gstype1.h -gxhint1.o: gxop1.h - -gxhint2.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxhint2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxarith.h -gxhint2.o: gxfixed.h gxmatrix.h gsmatrix.h gxfont.h gsccode.h gsfont.h -gxhint2.o: gsuid.h gsstruct.h gxftype.h gxfont1.h gxtype1.h gscrypt1.h -gxhint2.o: gstype1.h gxop1.h - -gxhint3.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxhint3.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxarith.h -gxhint3.o: gxfixed.h gxmatrix.h gsmatrix.h gxfont.h gsccode.h gsfont.h -gxhint3.o: gsuid.h gsstruct.h gxftype.h gxfont1.h gxtype1.h gscrypt1.h -gxhint3.o: gstype1.h gxop1.h gzpath.h gxpath.h gscpm.h gslparam.h gspenum.h -gxhint3.o: gsrect.h gsrefct.h - -gxht.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxht.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h -gxht.o: gsbitops.h gsutil.h gxdcolor.h gscsel.h gsdcolor.h gsccolor.h -gxht.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsropt.h -gxht.o: gxfixed.h gxdevice.h gxdevcli.h gscompt.h gsmatrix.h gsiparam.h -gxht.o: gsrefct.h gsxfont.h gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h -gxht.o: gsmalloc.h gxistate.h gxline.h gslparam.h gxmatrix.h gxtmap.h gzht.h -gxht.o: gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxfmap.h gxfrac.h gxdht.h - -gxi12bit.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxi12bit.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gpcheck.h gserrors.h -gxi12bit.o: gxfixed.h gxfrac.h gxarith.h gxmatrix.h gsmatrix.h gsccolor.h -gxi12bit.o: gsstruct.h gspaint.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gxi12bit.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h -gxi12bit.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxtext.h gstext.h -gxi12bit.o: gsccode.h gsparam.h gsmalloc.h gxcmap.h gscsel.h gxfmap.h -gxi12bit.o: gxtmap.h gxdcolor.h gxistate.h gxline.h gslparam.h gzpath.h -gxi12bit.o: gxpath.h gscpm.h gspenum.h gsrect.h gxdevmem.h gxcpath.h -gxi12bit.o: gximage.h gxcspace.h gscspace.h strimpl.h scommon.h siscale.h -gxi12bit.o: gconfigv.h gxdda.h gxiparam.h gxsample.h - -gxicolor.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxicolor.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gpcheck.h gserrors.h -gxicolor.o: gxfixed.h gxfrac.h gxarith.h gxmatrix.h gsmatrix.h gsccolor.h -gxicolor.o: gsstruct.h gspaint.h gzstate.h gscpm.h gsrefct.h gxdcolor.h -gxicolor.o: gscsel.h gsdcolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxicolor.o: gsbitops.h gsropt.h gxistate.h gxcvalue.h gxline.h gslparam.h -gxicolor.o: gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h -gxicolor.o: gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h gxtext.h -gxicolor.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h -gxicolor.o: gxdcconv.h gzpath.h gxpath.h gspenum.h gsrect.h gxdevmem.h -gxicolor.o: gxcpath.h gximage.h gxcspace.h gscspace.h strimpl.h scommon.h -gxicolor.o: siscale.h gconfigv.h gxdda.h gxiparam.h gxsample.h - -gxidata.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxidata.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gserrors.h gxdevice.h -gxidata.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gxidata.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsmatrix.h -gxidata.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h -gxidata.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxcpath.h -gxidata.o: gximage.h gxcspace.h gscspace.h gscsel.h gxfrac.h strimpl.h -gxidata.o: scommon.h siscale.h gconfigv.h gxdda.h gxiparam.h gxsample.h - -gxifast.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxifast.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gpcheck.h gsbittab.h -gxifast.o: gserrors.h gxfixed.h gxarith.h gxmatrix.h gsmatrix.h gsccolor.h -gxifast.o: gsstruct.h gspaint.h gsutil.h gxdevice.h gxdevcli.h gscompt.h -gxifast.o: gsdcolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxifast.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxtext.h -gxifast.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gscsel.h gxfmap.h -gxifast.o: gxfrac.h gxtmap.h gxdcolor.h gxistate.h gxline.h gslparam.h -gxifast.o: gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h gxdevmem.h gdevmem.h -gxifast.o: gxbitops.h gxcpath.h gximage.h gxcspace.h gscspace.h strimpl.h -gxifast.o: scommon.h siscale.h gconfigv.h gxdda.h gxiparam.h gxsample.h -gxifast.o: gzht.h gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxdht.h - -gxiinit.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxiinit.o: gsmemory.h gsmemraw.h gdebug.h math_.h memory_.h gpcheck.h -gxiinit.o: gserrors.h gsstruct.h gsutil.h gxfixed.h gxfrac.h gxarith.h -gxiinit.o: gxmatrix.h gsmatrix.h gsccolor.h gspaint.h gzstate.h gscpm.h -gxiinit.o: gsrefct.h gxdcolor.h gscsel.h gsdcolor.h gxbitmap.h gsbitmap.h -gxiinit.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h -gxiinit.o: gxline.h gslparam.h gxtmap.h gsstate.h gsdevice.h gsline.h -gxiinit.o: gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h gscompt.h -gxiinit.o: gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h -gxiinit.o: gsmalloc.h gzpath.h gxpath.h gspenum.h gsrect.h gzcpath.h -gxiinit.o: gxcpath.h gxdevmem.h gximage.h gxcspace.h gscspace.h strimpl.h -gxiinit.o: scommon.h siscale.h gconfigv.h gxdda.h gxiparam.h gxsample.h -gxiinit.o: gdevmrop.h - -gximage3.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gximage3.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gximage3.o: gsbitops.h gscspace.h gsiparm3.h gsiparam.h gsmatrix.h gsstruct.h -gximage3.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h -gximage3.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsrefct.h gsropt.h -gximage3.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -gximage3.o: gsparam.h gsmalloc.h gxdevmem.h gxclipm.h gxmclip.h gxclip.h -gximage3.o: gxiparam.h gxistate.h gscsel.h gxline.h gslparam.h gxmatrix.h -gximage3.o: gxtmap.h - -gximage4.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gximage4.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gscspace.h -gximage4.o: gsiparm3.h gsiparam.h gsmatrix.h gsiparm4.h gxiparam.h gxdevcli.h -gximage4.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -gximage4.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsrefct.h gsropt.h -gximage4.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h - -gximono.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gximono.o: gsmemory.h gsmemraw.h gdebug.h memory_.h gpcheck.h gserrors.h -gximono.o: gxfixed.h gxarith.h gxmatrix.h gsmatrix.h gsccolor.h gsstruct.h -gximono.o: gspaint.h gsutil.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -gximono.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h -gximono.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxtext.h gstext.h -gximono.o: gsccode.h gsparam.h gsmalloc.h gxcmap.h gscsel.h gxfmap.h gxfrac.h -gximono.o: gxtmap.h gxdcolor.h gxistate.h gxline.h gslparam.h gzpath.h -gximono.o: gxpath.h gscpm.h gspenum.h gsrect.h gxdevmem.h gdevmem.h -gximono.o: gxbitops.h gxcpath.h gximage.h gxcspace.h gscspace.h strimpl.h -gximono.o: scommon.h siscale.h gconfigv.h gxdda.h gxiparam.h gxsample.h -gximono.o: gzht.h gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxdht.h - -gxiscale.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxiscale.o: gsmemory.h gsmemraw.h gdebug.h math_.h memory_.h gpcheck.h -gxiscale.o: gserrors.h gxfixed.h gxfrac.h gxarith.h gxmatrix.h gsmatrix.h -gxiscale.o: gsccolor.h gsstruct.h gspaint.h gxdevice.h gxdevcli.h gscompt.h -gxiscale.o: gsdcolor.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -gxiscale.o: gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxtext.h -gxiscale.o: gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gscsel.h -gxiscale.o: gxfmap.h gxtmap.h gxdcolor.h gxistate.h gxline.h gslparam.h -gxiscale.o: gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h gxdevmem.h gxcpath.h -gxiscale.o: gximage.h gxcspace.h gscspace.h strimpl.h scommon.h siscale.h -gxiscale.o: gconfigv.h gxdda.h gxiparam.h gxsample.h - -gxmclip.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxmclip.o: gsmemory.h gsmemraw.h gdebug.h gxdevice.h gxdevcli.h gscompt.h -gxmclip.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gxmclip.o: gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h -gxmclip.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gxmclip.o: gsccode.h gsparam.h gsmalloc.h gxdevmem.h gxmclip.h gxclip.h - -gxp1fill.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxp1fill.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrop.h -gxp1fill.o: gsropt.h gsmatrix.h gxcspace.h gscspace.h gsccolor.h gsstruct.h -gxp1fill.o: gscsel.h gxfrac.h gxcolor2.h gscolor2.h gsptype1.h gspcolor.h -gxp1fill.o: gsuid.h gxbitmap.h gsbitmap.h gsrefct.h gxdcolor.h gsdcolor.h -gxp1fill.o: gxarith.h gxhttile.h gxcindex.h gsbitops.h gxdevcli.h gscompt.h -gxp1fill.o: gsiparam.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -gxp1fill.o: gsccode.h gxdevmem.h gxclip2.h gxmclip.h gxclip.h gxpcolor.h -gxp1fill.o: gxpcache.h gxp1fill.h - -gxpaint.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxpaint.o: gsmemory.h gsmemraw.h gdebug.h gzstate.h gscpm.h gsrefct.h -gxpaint.o: gxdcolor.h gscsel.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h -gxpaint.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -gxpaint.o: gxistate.h gxcvalue.h gxfixed.h gxline.h gslparam.h gxmatrix.h -gxpaint.o: gsmatrix.h gxtmap.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h -gxpaint.o: gxstate.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -gxpaint.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxpaint.h -gxpaint.o: gxpath.h gspenum.h gsrect.h - -gxpath2.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxpath2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gxfixed.h -gxpath2.o: gxarith.h gzpath.h gxpath.h gscpm.h gslparam.h gspenum.h gsrect.h -gxpath2.o: gsmatrix.h gsrefct.h gsstruct.h - -gxpath.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxpath.o: gsmemory.h gsmemraw.h gdebug.h gserrors.h gsstruct.h gxfixed.h -gxpath.o: gzpath.h gxpath.h gscpm.h gslparam.h gspenum.h gsrect.h gsmatrix.h -gxpath.o: gsrefct.h - -gxpcmap.o: math_.h std.h stdpre.h arch.h memory_.h gx.h stdio_.h gserror.h -gxpcmap.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -gxpcmap.o: gsstruct.h gsutil.h gxfixed.h gxmatrix.h gsmatrix.h gxcspace.h -gxpcmap.o: gscspace.h gsccolor.h gscsel.h gxfrac.h gxcolor2.h gscolor2.h -gxpcmap.o: gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h gsrefct.h -gxpcmap.o: gxdcolor.h gsdcolor.h gxarith.h gxhttile.h gxcindex.h gsbitops.h -gxpcmap.o: gsropt.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -gxpcmap.o: gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -gxpcmap.o: gxdevmem.h gxpcolor.h gxpcache.h gzstate.h gscpm.h gxistate.h -gxpcmap.o: gxline.h gslparam.h gxtmap.h gsstate.h gsdevice.h gsline.h -gxpcmap.o: gscolor.h gsht.h gxstate.h gzpath.h gxpath.h gspenum.h gsrect.h -gxpcmap.o: gzcpath.h gxcpath.h - -gxpcopy.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxpcopy.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gconfigv.h -gxpcopy.o: gxfixed.h gxfarith.h gxarith.h gzpath.h gxpath.h gscpm.h -gxpcopy.o: gslparam.h gspenum.h gsrect.h gsmatrix.h gsrefct.h gsstruct.h - -gxpdash.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxpdash.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gsmatrix.h gscoord.h -gxpdash.o: gxfixed.h gsline.h gslparam.h gzline.h gxline.h gzpath.h gxpath.h -gxpdash.o: gscpm.h gspenum.h gsrect.h gsrefct.h gsstruct.h - -gxpflat.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxpflat.o: gsmemory.h gsmemraw.h gdebug.h gxarith.h gxfixed.h gzpath.h -gxpflat.o: gxpath.h gscpm.h gslparam.h gspenum.h gsrect.h gsmatrix.h -gxpflat.o: gsrefct.h gsstruct.h - -gxsample.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -gxsample.o: gsmemory.h gsmemraw.h gdebug.h gxsample.h - -gxshade1.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxshade1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmatrix.h -gxshade1.o: gscoord.h gspath.h gspenum.h gxcspace.h gscspace.h gsccolor.h -gxshade1.o: gsstruct.h gscsel.h gxfrac.h gxdcolor.h gsdcolor.h gxarith.h -gxshade1.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -gxshade1.o: gxfarith.h gconfigv.h gxfixed.h gxistate.h gsrefct.h gxcvalue.h -gxshade1.o: gxline.h gslparam.h gxmatrix.h gxtmap.h gxpath.h gscpm.h gsrect.h -gxshade1.o: gxshade.h gsshade.h gsdsrc.h gsfunc.h stream.h scommon.h - -gxshade4.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxshade4.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmatrix.h -gxshade4.o: gscoord.h gxcspace.h gscspace.h gsccolor.h gsstruct.h gscsel.h -gxshade4.o: gxfrac.h gxdcolor.h gsdcolor.h gxarith.h gxbitmap.h gsbitmap.h -gxshade4.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxdevcli.h gscompt.h -gxshade4.o: gsiparam.h gsrefct.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h -gxshade4.o: gstext.h gsccode.h gxistate.h gxline.h gslparam.h gxmatrix.h -gxshade4.o: gxtmap.h gxpath.h gscpm.h gspenum.h gsrect.h gxshade.h gsshade.h -gxshade4.o: gsdsrc.h gsfunc.h stream.h scommon.h gxshade4.h - -gxshade6.o: memory_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxshade6.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsmatrix.h -gxshade6.o: gscoord.h gxcspace.h gscspace.h gsccolor.h gsstruct.h gscsel.h -gxshade6.o: gxfrac.h gxdcolor.h gsdcolor.h gxarith.h gxbitmap.h gsbitmap.h -gxshade6.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h gsrefct.h -gxshade6.o: gxcvalue.h gxfixed.h gxline.h gslparam.h gxmatrix.h gxtmap.h -gxshade6.o: gxshade.h gsshade.h gsdsrc.h gsfunc.h stream.h scommon.h -gxshade6.o: gxshade4.h gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h - -gxshade.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxshade.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsrect.h -gxshade.o: gxcspace.h gscspace.h gsccolor.h gsstruct.h gscsel.h gxfrac.h -gxshade.o: gscie.h gsrefct.h gxctable.h gxfixed.h gxdevcli.h gscompt.h -gxshade.o: gsdcolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -gxshade.o: gsbitops.h gsmatrix.h gsiparam.h gsropt.h gsxfont.h gxcvalue.h -gxshade.o: gxtext.h gstext.h gsccode.h gxistate.h gxline.h gslparam.h -gxshade.o: gxmatrix.h gxtmap.h gxdht.h gscsepnm.h gxhttype.h gxpaint.h -gxshade.o: gxshade.h gsshade.h gsdsrc.h gsfunc.h stream.h scommon.h - -gxstroke.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxstroke.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gpcheck.h gserrors.h -gxstroke.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -gxstroke.o: gxhttile.h gxcindex.h gsbitops.h gxfixed.h gxfarith.h gconfigv.h -gxstroke.o: gxmatrix.h gsmatrix.h gscoord.h gsdevice.h gxdevice.h gxdevcli.h -gxstroke.o: gscompt.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -gxstroke.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxistate.h -gxstroke.o: gscsel.h gxline.h gslparam.h gxtmap.h gzline.h gzpath.h gxpath.h -gxstroke.o: gscpm.h gspenum.h gsrect.h gzcpath.h gxcpath.h gxpaint.h - -gxtype1.o: math_.h std.h stdpre.h arch.h gx.h stdio_.h gserror.h gsio.h -gxtype1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h gsccode.h -gxtype1.o: gsline.h gslparam.h gsstruct.h gxarith.h gxfixed.h gxistate.h -gxtype1.o: gscsel.h gsrefct.h gsropt.h gxcvalue.h gxline.h gxmatrix.h -gxtype1.o: gsmatrix.h gxtmap.h gxcoord.h gscoord.h gxfont.h gsfont.h gsuid.h -gxtype1.o: gxftype.h gxfont1.h gxtype1.h gscrypt1.h gstype1.h gxop1.h -gxtype1.o: gzpath.h gxpath.h gscpm.h gspenum.h gsrect.h - -ialloc.o: gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -ialloc.o: gsmemory.h gsmemraw.h gdebug.h memory_.h errors.h gsstruct.h -ialloc.o: gxarith.h iref.h iastate.h gxalloc.h gsalloc.h gxobj.h gxbitmap.h -ialloc.o: gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h gsgc.h ipacked.h -ialloc.o: iutil.h store.h - -ibnum.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -ibnum.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -ibnum.o: errors.h stream.h scommon.h gsstruct.h ibnum.h imemory.h ivmspace.h -ibnum.o: gsgc.h gsalloc.h iutil.h - -iccinit0.o: stdpre.h - -iconfig.o: stdio_.h std.h stdpre.h arch.h gstypes.h gsmemory.h gsmemraw.h -iconfig.o: gconf.h gconfig.h ../config.h iref.h ivmspace.h gsgc.h opdef.h -iconfig.o: iminst.h - -icontext.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -icontext.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsstruct.h -icontext.o: gxalloc.h gsalloc.h gxobj.h gxbitmap.h gsbitmap.h errors.h -icontext.o: stream.h scommon.h files.h idict.h igstate.h gsstate.h gsdevice.h -icontext.o: gsline.h gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h -icontext.o: istruct.h icontext.h icstate.h imemory.h ivmspace.h gsgc.h -icontext.o: interp.h isave.h dstack.h idstack.h istack.h estack.h iestack.h -icontext.o: ostack.h iostack.h store.h ialloc.h - -idebug.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -idebug.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h ialloc.h -idebug.o: imemory.h ivmspace.h gsgc.h gsalloc.h idebug.h idict.h iname.h -idebug.o: inames.h ipacked.h istack.h iutil.h opdef.h - -idict.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -idict.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h errors.h -idict.o: imemory.h ivmspace.h gsgc.h gsalloc.h idebug.h inamedef.h inames.h -idict.o: gconfigv.h gsstruct.h iname.h ipacked.h isave.h store.h ialloc.h -idict.o: idict.h idictdef.h iutil.h idstack.h istack.h - -idparam.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -idparam.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -idparam.o: errors.h gsmatrix.h gsuid.h idict.h idparam.h ilevel.h imemory.h -idparam.o: ivmspace.h gsgc.h gsalloc.h iname.h inames.h iutil.h oper.h -idparam.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h store.h -idparam.o: ialloc.h - -idstack.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -idstack.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h idict.h idictdef.h -idstack.o: idstack.h istack.h inamedef.h inames.h gconfigv.h gsstruct.h -idstack.o: iname.h ipacked.h iutil.h ivmspace.h gsgc.h - -igcref.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -igcref.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsexit.h -igcref.o: gsstruct.h iname.h inames.h iastate.h gxalloc.h gsalloc.h gxobj.h -igcref.o: gxbitmap.h gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h -igcref.o: gsgc.h idebug.h igc.h ipacked.h store.h - -igcstr.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -igcstr.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsmdebug.h -igcstr.o: gsstruct.h iastate.h gxalloc.h gsalloc.h gxobj.h gxbitmap.h -igcstr.o: gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h gsgc.h igcstr.h - -igc.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h gsio.h -igc.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h errors.h gsexit.h -igc.o: gsmdebug.h gsstruct.h gsutil.h iastate.h gxalloc.h gsalloc.h gxobj.h -igc.o: gxbitmap.h gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h gsgc.h -igc.o: isave.h isstate.h idict.h ipacked.h igc.h igcstr.h inamedef.h inames.h -igc.o: gconfigv.h opdef.h - -iinit.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -iinit.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gscdefs.h -iinit.o: gconfigv.h gsexit.h gsstruct.h errors.h ialloc.h imemory.h -iinit.o: ivmspace.h gsgc.h gsalloc.h idict.h dstack.h idstack.h istack.h -iinit.o: ilevel.h iname.h inames.h interp.h ipacked.h iparray.h iutil.h -iinit.o: opdef.h store.h - -ilocate.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -ilocate.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h memory_.h errors.h -ilocate.o: gsexit.h gsstruct.h iastate.h gxalloc.h gsalloc.h gxobj.h -ilocate.o: gxbitmap.h gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h -ilocate.o: gsgc.h idict.h igc.h igcstr.h iname.h inames.h ipacked.h isstate.h -ilocate.o: iutil.h store.h - -imainarg.o: ctype_.h std.h stdpre.h arch.h memory_.h string_.h ghost.h gx.h -imainarg.o: stdio_.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h -imainarg.o: gdebug.h iref.h gp.h gpgetenv.h gsargs.h gscdefs.h gconfigv.h -imainarg.o: gsmalloc.h gsmdebug.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -imainarg.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -imainarg.o: gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h gsropt.h -imainarg.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -imainarg.o: gsparam.h gxdevmem.h gsdevice.h stream.h scommon.h errors.h -imainarg.o: estack.h iestack.h istack.h ialloc.h imemory.h ivmspace.h gsgc.h -imainarg.o: gsalloc.h strimpl.h sfilter.h ostack.h iostack.h iscan.h sa85x.h -imainarg.o: sstring.h imain.h gsexit.h imainarg.h iminst.h iname.h inames.h -imainarg.o: store.h files.h interp.h iutil.h - -imain.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -imain.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -imain.o: gp.h gpgetenv.h gslib.h gsmatrix.h gsutil.h gxdevice.h gxdevcli.h -imain.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -imain.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -imain.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -imain.o: gsparam.h gsmalloc.h errors.h oper.h ostack.h iostack.h istack.h -imain.o: opdef.h opextern.h opcheck.h iutil.h idebug.h idict.h iname.h -imain.o: inames.h dstack.h idstack.h estack.h iestack.h stream.h scommon.h -imain.o: files.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h strimpl.h -imain.o: sfilter.h iscan.h sa85x.h sstring.h main.h imain.h gsexit.h iminst.h -imain.o: store.h isave.h interp.h - -iname.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -iname.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -iname.o: gsstruct.h gxobj.h gxbitmap.h gsbitmap.h errors.h inamedef.h -iname.o: inames.h gconfigv.h imemory.h ivmspace.h gsgc.h gsalloc.h isave.h -iname.o: store.h ialloc.h - -interp.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -interp.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -interp.o: gsstruct.h stream.h scommon.h errors.h estack.h iestack.h istack.h -interp.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h iastruct.h gxobj.h -interp.o: gxbitmap.h gsbitmap.h icontext.h icstate.h inamedef.h inames.h -interp.o: gconfigv.h iname.h interp.h ipacked.h ostack.h iostack.h strimpl.h -interp.o: sfilter.h iscan.h sa85x.h sstring.h idict.h isave.h iutil.h -interp.o: dstack.h idstack.h files.h oper.h opdef.h opextern.h opcheck.h -interp.o: store.h - -iparam.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -iparam.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -iparam.o: errors.h oper.h ostack.h iostack.h istack.h opdef.h opextern.h -iparam.o: opcheck.h iutil.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -iparam.o: idict.h iname.h inames.h iparam.h gsparam.h store.h - -ireclaim.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -ireclaim.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h errors.h -ireclaim.o: gsstruct.h iastate.h gxalloc.h gsalloc.h gxobj.h gxbitmap.h -ireclaim.o: gsbitmap.h istruct.h ialloc.h imemory.h ivmspace.h gsgc.h -ireclaim.o: icontext.h icstate.h interp.h isave.h isstate.h dstack.h -ireclaim.o: idstack.h istack.h estack.h iestack.h ostack.h iostack.h opdef.h -ireclaim.o: store.h - -isave.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -isave.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h memory_.h errors.h -isave.o: gsexit.h gsstruct.h stream.h scommon.h iastate.h gxalloc.h gsalloc.h -isave.o: gxobj.h gxbitmap.h gsbitmap.h istruct.h ialloc.h imemory.h -isave.o: ivmspace.h gsgc.h inamedef.h inames.h gconfigv.h iname.h ipacked.h -isave.o: isave.h isstate.h store.h gsutil.h - -iscanbin.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -iscanbin.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -iscanbin.o: gsutil.h stream.h scommon.h gsstruct.h strimpl.h sfilter.h -iscanbin.o: errors.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h -iscanbin.o: dstack.h idstack.h istack.h ostack.h iostack.h iname.h inames.h -iscanbin.o: iscan.h sa85x.h sstring.h iutil.h store.h btoken.h ibnum.h - -iscannum.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -iscannum.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h errors.h -iscannum.o: scommon.h gsstruct.h iscannum.h scanchar.h store.h ialloc.h -iscannum.o: imemory.h ivmspace.h gsgc.h gsalloc.h - -iscan.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -iscan.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h memory_.h stream.h -iscan.o: scommon.h gsstruct.h errors.h files.h ialloc.h imemory.h ivmspace.h -iscan.o: gsgc.h gsalloc.h idict.h dstack.h idstack.h istack.h ilevel.h -iscan.o: iname.h inames.h ipacked.h iparray.h strimpl.h sfilter.h ostack.h -iscan.o: iostack.h iscan.h sa85x.h sstring.h iscannum.h istream.h istruct.h -iscan.o: iutil.h store.h scanchar.h - -istack.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -istack.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsstruct.h -istack.o: gsutil.h errors.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -istack.o: istack.h istruct.h iutil.h store.h - -iutil2.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -iutil2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -iutil2.o: errors.h opcheck.h gsparam.h gsutil.h idict.h imemory.h ivmspace.h -iutil2.o: gsgc.h gsalloc.h iutil.h iutil2.h - -iutil.o: math_.h std.h stdpre.h arch.h memory_.h string_.h ghost.h gx.h -iutil.o: stdio_.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h -iutil.o: iref.h errors.h idict.h imemory.h ivmspace.h gsgc.h gsalloc.h -iutil.o: iname.h inames.h ipacked.h iutil.h oper.h ostack.h iostack.h -iutil.o: istack.h opdef.h opextern.h opcheck.h store.h ialloc.h gsccode.h -iutil.o: gsmatrix.h gsutil.h gxfont.h gsfont.h gsuid.h gsstruct.h gxftype.h - -sbcp.o: stdio_.h std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h -sbcp.o: gsmemraw.h gstypes.h gsstruct.h sfilter.h - -sbhc.o: memory_.h std.h stdpre.h arch.h stdio_.h gdebug.h strimpl.h scommon.h -sbhc.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h sbhc.h shc.h gsbittab.h -sbhc.o: shcgen.h - -sbwbs.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h strimpl.h -sbwbs.o: scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h sfilter.h -sbwbs.o: sbwbs.h - -scantab.o: stdpre.h scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h -scantab.o: scanchar.h - -scfdtab.o: std.h stdpre.h arch.h scommon.h gsmemory.h gsmemraw.h gstypes.h -scfdtab.o: gsstruct.h scf.h shc.h gsbittab.h - -scfd.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h strimpl.h scommon.h -scfd.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h scf.h shc.h gsbittab.h -scfd.o: scfx.h - -scfetab.o: std.h stdpre.h arch.h scommon.h gsmemory.h gsmemraw.h gstypes.h -scfetab.o: gsstruct.h scf.h shc.h gsbittab.h - -scfe.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h strimpl.h scommon.h -scfe.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h scf.h shc.h gsbittab.h -scfe.o: scfx.h - -scfparam.o: std.h stdpre.h arch.h gserror.h gserrors.h gstypes.h gsmemory.h -scfparam.o: gsmemraw.h gsparam.h scommon.h gsstruct.h scf.h shc.h gsbittab.h -scfparam.o: scfx.h - -sdcparam.o: ../config.h memory_.h std.h stdpre.h arch.h gserror.h gserrors.h -sdcparam.o: gstypes.h gsmemory.h gsmemraw.h gsparam.h strimpl.h scommon.h -sdcparam.o: gsstruct.h sdct.h sdcparam.h sjpeg.h - -sdctc.o: ../config.h stdio_.h std.h stdpre.h arch.h gsmemory.h gsmemraw.h -sdctc.o: gsmalloc.h strimpl.h scommon.h gstypes.h gsstruct.h sdct.h - -sdctd.o: ../config.h memory_.h std.h stdpre.h arch.h stdio_.h gdebug.h -sdctd.o: gsmemory.h gsmemraw.h gsmalloc.h strimpl.h scommon.h gstypes.h -sdctd.o: gsstruct.h sdct.h sjpeg.h - -sdcte.o: ../config.h memory_.h std.h stdpre.h arch.h stdio_.h gdebug.h -sdcte.o: gsmemory.h gsmemraw.h gsmalloc.h strimpl.h scommon.h gstypes.h -sdcte.o: gsstruct.h sdct.h sjpeg.h - -sddparam.o: ../config.h std.h stdpre.h arch.h gserror.h gserrors.h gstypes.h -sddparam.o: gsmemory.h gsmemraw.h gsparam.h strimpl.h scommon.h gsstruct.h -sddparam.o: sdct.h sdcparam.h sjpeg.h - -sdeparam.o: ../config.h memory_.h std.h stdpre.h arch.h gserror.h gserrors.h -sdeparam.o: gstypes.h gsmemory.h gsmemraw.h gsparam.h strimpl.h scommon.h -sdeparam.o: gsstruct.h sdct.h sdcparam.h sjpeg.h - -seexec.o: stdio_.h std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h -seexec.o: gsmemraw.h gstypes.h gsstruct.h sfilter.h gscrypt1.h scanchar.h - -sfilter1.o: stdio_.h std.h stdpre.h arch.h memory_.h strimpl.h scommon.h -sfilter1.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h sfilter.h - -sfilter2.o: stdio_.h std.h stdpre.h arch.h memory_.h strimpl.h scommon.h -sfilter2.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h sa85x.h sbtx.h -sfilter2.o: scanchar.h - -sfxstdio.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h gpcheck.h -sfxstdio.o: stream.h scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h -sfxstdio.o: strimpl.h - -shcgen.o: memory_.h std.h stdpre.h arch.h stdio_.h gdebug.h gserror.h -shcgen.o: gserrors.h gsmemory.h gsmemraw.h scommon.h gstypes.h gsstruct.h -shcgen.o: shc.h gsbittab.h shcgen.h - -shc.o: std.h stdpre.h arch.h scommon.h gsmemory.h gsmemraw.h gstypes.h -shc.o: gsstruct.h shc.h gsbittab.h - -siscale.o: math_.h std.h stdpre.h arch.h memory_.h stdio_.h strimpl.h -siscale.o: scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h siscale.h -siscale.o: gconfigv.h - -sjpegc.o: ../config.h stdio_.h std.h stdpre.h arch.h string_.h gx.h gserror.h -sjpegc.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -sjpegc.o: strimpl.h scommon.h gsstruct.h sdct.h sjpeg.h - -sjpegd.o: ../config.h stdio_.h std.h stdpre.h arch.h string_.h gx.h gserror.h -sjpegd.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -sjpegd.o: strimpl.h scommon.h gsstruct.h sdct.h sjpeg.h - -sjpegerr.o: ../config.h stdio_.h std.h stdpre.h arch.h - -sjpege.o: ../config.h stdio_.h std.h stdpre.h arch.h string_.h gx.h gserror.h -sjpege.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h gserrors.h -sjpege.o: strimpl.h scommon.h gsstruct.h sdct.h sjpeg.h - -slzwce.o: stdio_.h std.h stdpre.h arch.h gdebug.h strimpl.h scommon.h -slzwce.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h slzwx.h - -slzwc.o: std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h gsmemraw.h -slzwc.o: gstypes.h gsstruct.h slzwx.h - -slzwd.o: stdio_.h std.h stdpre.h arch.h gdebug.h strimpl.h scommon.h -slzwd.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h slzwx.h - -smtf.o: stdio_.h std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h -smtf.o: gsmemraw.h gstypes.h gsstruct.h smtf.h - -spcxd.o: stdio_.h std.h stdpre.h arch.h memory_.h strimpl.h scommon.h -spcxd.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h spcxx.h - -spdiff.o: stdio_.h std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h -spdiff.o: gsmemraw.h gstypes.h gsstruct.h spdiffx.h - -spngp.o: memory_.h std.h stdpre.h arch.h strimpl.h scommon.h gsmemory.h -spngp.o: gsmemraw.h gstypes.h gsstruct.h spngpx.h - -srld.o: stdio_.h std.h stdpre.h arch.h memory_.h strimpl.h scommon.h -srld.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h srlx.h - -srle.o: stdio_.h std.h stdpre.h arch.h memory_.h strimpl.h scommon.h -srle.o: gsmemory.h gsmemraw.h gstypes.h gsstruct.h srlx.h - -sstring.o: stdio_.h std.h stdpre.h arch.h memory_.h string_.h strimpl.h -sstring.o: scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h sstring.h -sstring.o: scanchar.h - -stream.o: stdio_.h std.h stdpre.h arch.h memory_.h gdebug.h gpcheck.h -stream.o: stream.h scommon.h gsmemory.h gsmemraw.h gstypes.h gsstruct.h -stream.o: strimpl.h - -szlibc.o: ../config.h std.h stdpre.h arch.h gserror.h gserrors.h gstypes.h -szlibc.o: gsmemory.h gsmemraw.h gsmalloc.h gsstruct.h strimpl.h scommon.h -szlibc.o: szlibxx.h szlibx.h - -szlibd.o: ../config.h std.h stdpre.h arch.h gsmemory.h gsmemraw.h gsmalloc.h -szlibd.o: strimpl.h scommon.h gstypes.h gsstruct.h szlibxx.h szlibx.h - -szlibe.o: ../config.h std.h stdpre.h arch.h gsmemory.h gsmemraw.h gsmalloc.h -szlibe.o: strimpl.h scommon.h gstypes.h gsstruct.h szlibxx.h szlibx.h - -zarith.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zarith.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zarith.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zarith.o: iutil.h store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zarray.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zarray.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h ialloc.h -zarray.o: imemory.h ivmspace.h gsgc.h gsalloc.h ipacked.h oper.h errors.h -zarray.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zarray.o: store.h - -zbseq.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zbseq.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zbseq.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zbseq.o: iutil.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h btoken.h -zbseq.o: store.h - -zcfont.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcfont.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcfont.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcfont.o: gschar.h gsccode.h gscpm.h gsmatrix.h gxfixed.h gxfont.h gsfont.h -zcfont.o: gsuid.h gsstruct.h gxftype.h gxchar.h gxtext.h gstext.h gsrefct.h -zcfont.o: estack.h iestack.h ichar.h ifont.h igstate.h gsstate.h gsdevice.h -zcfont.o: gsline.h gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h -zcfont.o: istruct.h store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zchar1.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zchar1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zchar1.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zchar1.o: gsstruct.h gxfixed.h gxmatrix.h gsmatrix.h gxchar.h gschar.h -zchar1.o: gsccode.h gscpm.h gxtext.h gstext.h gsrefct.h gxdevice.h gxdevcli.h -zchar1.o: gscompt.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h -zchar1.o: gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsropt.h gsxfont.h -zchar1.o: gxcvalue.h gsparam.h gsmalloc.h gxfont.h gsfont.h gsuid.h gxftype.h -zchar1.o: gxfont1.h gxtype1.h gscrypt1.h gstype1.h gxop1.h gzstate.h -zchar1.o: gxdcolor.h gscsel.h gxistate.h gxline.h gslparam.h gxtmap.h -zchar1.o: gsstate.h gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gspaint.h -zchar1.o: gspath.h gspenum.h estack.h iestack.h ialloc.h imemory.h ivmspace.h -zchar1.o: gsgc.h gsalloc.h ichar.h icharout.h idict.h ifont.h igstate.h -zchar1.o: istruct.h iname.h inames.h store.h - -zchar2.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zchar2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zchar2.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zchar2.o: gschar.h gsccode.h gscpm.h gsmatrix.h gsstruct.h gxfixed.h gxfont.h -zchar2.o: gsfont.h gsuid.h gxftype.h gxchar.h gxtext.h gstext.h gsrefct.h -zchar2.o: estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zchar2.o: ichar.h ifont.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zchar2.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h iname.h -zchar2.o: inames.h store.h stream.h scommon.h ibnum.h gspath.h gspenum.h - -zchar32.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zchar32.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zchar32.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zchar32.o: gsccode.h gsmatrix.h gsutil.h gxfixed.h gxchar.h gschar.h gscpm.h -zchar32.o: gxtext.h gstext.h gsrefct.h gxfont.h gsfont.h gsuid.h gsstruct.h -zchar32.o: gxftype.h gxfcache.h gsxfont.h gxbcache.h gxbitmap.h gsbitmap.h -zchar32.o: ifont.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zchar32.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h store.h -zchar32.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zchar42.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zchar42.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zchar42.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zchar42.o: gsmatrix.h gspaint.h gspath.h gspenum.h gxfixed.h gxchar.h -zchar42.o: gschar.h gsccode.h gscpm.h gxtext.h gstext.h gsrefct.h gxfont.h -zchar42.o: gsfont.h gsuid.h gsstruct.h gxftype.h gxfont42.h gxistate.h -zchar42.o: gscsel.h gsropt.h gxcvalue.h gxline.h gslparam.h gxmatrix.h -zchar42.o: gxtmap.h gxpath.h gsrect.h gzstate.h gxdcolor.h gsdcolor.h -zchar42.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -zchar42.o: gsbitops.h gsstate.h gsdevice.h gsline.h gscolor.h gsht.h -zchar42.o: gxstate.h dstack.h idstack.h estack.h iestack.h ichar.h icharout.h -zchar42.o: ifont.h igstate.h istruct.h store.h ialloc.h imemory.h ivmspace.h -zchar42.o: gsgc.h gsalloc.h - -zcharout.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcharout.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcharout.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcharout.o: gschar.h gsccode.h gscpm.h gxdevice.h gxdevcli.h gscompt.h -zcharout.o: gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h -zcharout.o: gxhttile.h gxcindex.h gsbitops.h gsmatrix.h gsiparam.h gsrefct.h -zcharout.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -zcharout.o: gsparam.h gsmalloc.h gxfont.h gsfont.h gsuid.h gxftype.h dstack.h -zcharout.o: idstack.h estack.h iestack.h ichar.h icharout.h idict.h ifont.h -zcharout.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zcharout.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h store.h ialloc.h -zcharout.o: imemory.h ivmspace.h gsgc.h gsalloc.h - -zchar.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zchar.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zchar.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zchar.o: gsstruct.h gxarith.h gxfixed.h gxmatrix.h gsmatrix.h gxchar.h -zchar.o: gschar.h gsccode.h gscpm.h gxtext.h gstext.h gsrefct.h gxdevice.h -zchar.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxbitmap.h gsbitmap.h -zchar.o: gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsropt.h gsxfont.h -zchar.o: gxcvalue.h gsparam.h gsmalloc.h gxfont.h gsfont.h gsuid.h gxftype.h -zchar.o: gzpath.h gxpath.h gslparam.h gspenum.h gsrect.h gzstate.h gxdcolor.h -zchar.o: gscsel.h gxistate.h gxline.h gxtmap.h gsstate.h gsdevice.h gsline.h -zchar.o: gscolor.h gsht.h gxstate.h dstack.h idstack.h estack.h iestack.h -zchar.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h ichar.h idict.h -zchar.o: ifont.h igstate.h istruct.h ilevel.h iname.h inames.h ipacked.h -zchar.o: store.h - -zcid.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcid.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcid.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcid.o: gsmatrix.h gsccode.h gxfont.h gsfont.h gsuid.h gsstruct.h gxftype.h -zcid.o: bfont.h ifont.h iname.h inames.h store.h ialloc.h imemory.h -zcid.o: ivmspace.h gsgc.h gsalloc.h - -zcie.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -zcie.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zcie.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zcie.o: opcheck.h iutil.h gsstruct.h gxcspace.h gscspace.h gsccolor.h -zcie.o: gscsel.h gxfrac.h gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h -zcie.o: gsbitmap.h gscie.h gsrefct.h gxctable.h gxfixed.h estack.h iestack.h -zcie.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h idparam.h -zcie.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h gxtmap.h -zcie.o: gsht.h gxstate.h istruct.h icie.h isave.h store.h - -zcolor1.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcolor1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcolor1.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcolor1.o: estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zcolor1.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zcolor1.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h store.h -zcolor1.o: gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h gsrefct.h -zcolor1.o: gxdcolor.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h -zcolor1.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h -zcolor1.o: gxline.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -zcolor1.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h -zcolor1.o: gxfrac.h gscolor1.h gxcspace.h gscspace.h icolor.h iimage.h - -zcolor2.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcolor2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcolor2.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcolor2.o: gscolor.h gxtmap.h gsmatrix.h gsstruct.h gxcspace.h gscspace.h -zcolor2.o: gsccolor.h gscsel.h gxfrac.h gxfixed.h gxcolor2.h gscolor2.h -zcolor2.o: gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h gsrefct.h -zcolor2.o: gxdcolor.h gsdcolor.h gxarith.h gxhttile.h gxcindex.h gsbitops.h -zcolor2.o: gsropt.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -zcolor2.o: gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -zcolor2.o: gxdevmem.h gxpcolor.h gxpcache.h estack.h iestack.h ialloc.h -zcolor2.o: imemory.h ivmspace.h gsgc.h gsalloc.h istruct.h idict.h idparam.h -zcolor2.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gsht.h -zcolor2.o: gxstate.h store.h - -zcolor.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcolor.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcolor.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcolor.o: estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zcolor.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zcolor.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h store.h -zcolor.o: gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h gsrefct.h -zcolor.o: gxdcolor.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h -zcolor.o: gxhttile.h gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h -zcolor.o: gxline.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -zcolor.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gxcmap.h gxfmap.h -zcolor.o: gxfrac.h icolor.h - -zcontrol.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zcontrol.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h stream.h -zcontrol.o: scommon.h gsstruct.h oper.h errors.h ostack.h iostack.h istack.h -zcontrol.o: opdef.h opextern.h opcheck.h iutil.h estack.h iestack.h files.h -zcontrol.o: ipacked.h store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zcrd.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h gsio.h -zcrd.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcrd.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcrd.o: gsstruct.h gscspace.h gscolor2.h gsptype1.h gspcolor.h gsccolor.h -zcrd.o: gsuid.h gxbitmap.h gsbitmap.h gscrd.h gscie.h gsrefct.h gxctable.h -zcrd.o: gxfixed.h gxfrac.h estack.h iestack.h ialloc.h imemory.h ivmspace.h -zcrd.o: gsgc.h gsalloc.h idict.h idparam.h igstate.h gsstate.h gsdevice.h -zcrd.o: gsline.h gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h -zcrd.o: istruct.h icie.h store.h - -zcsdevn.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcsdevn.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcsdevn.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcsdevn.o: gxcspace.h gscspace.h gsccolor.h gsstruct.h gscsel.h gxfrac.h -zcsdevn.o: gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h -zcsdevn.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zcsdevn.o: gxtmap.h gsht.h gxstate.h istruct.h ialloc.h imemory.h ivmspace.h -zcsdevn.o: gsgc.h gsalloc.h iname.h inames.h - -zcsindex.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zcsindex.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zcsindex.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zcsindex.o: iutil.h gsstruct.h gscolor.h gxtmap.h gsmatrix.h gxcspace.h -zcsindex.o: gscspace.h gsccolor.h gscsel.h gxfrac.h gxfixed.h gxcolor2.h -zcsindex.o: gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h -zcsindex.o: gsrefct.h estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h -zcsindex.o: gsalloc.h icsmap.h igstate.h gsstate.h gsdevice.h gsline.h -zcsindex.o: gslparam.h gsht.h gxstate.h istruct.h store.h - -zcspixel.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcspixel.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcspixel.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcspixel.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zcspixel.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h -zcspixel.o: gscspace.h gsmatrix.h gscolor2.h gsptype1.h gspcolor.h gsccolor.h -zcspixel.o: gsuid.h gxbitmap.h gsbitmap.h gscpixel.h - -zcssepr.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zcssepr.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zcssepr.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zcssepr.o: gsstruct.h gscolor.h gxtmap.h gsmatrix.h gscsepr.h gscspace.h -zcssepr.o: gxcspace.h gsccolor.h gscsel.h gxfrac.h gxfixed.h gxcolor2.h -zcssepr.o: gscolor2.h gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h -zcssepr.o: gsrefct.h estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h -zcssepr.o: gsalloc.h icsmap.h igstate.h gsstate.h gsdevice.h gsline.h -zcssepr.o: gslparam.h gsht.h gxstate.h istruct.h store.h - -zdevcal.o: time_.h std.h stdpre.h arch.h ../config.h ghost.h gx.h stdio_.h -zdevcal.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zdevcal.o: gxiodev.h stat_.h istack.h iparam.h gsparam.h - -zdevice2.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -zdevice2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zdevice2.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zdevice2.o: opcheck.h iutil.h dstack.h idstack.h estack.h iestack.h idict.h -zdevice2.o: idparam.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zdevice2.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h -zdevice2.o: iname.h inames.h store.h ialloc.h imemory.h ivmspace.h gsgc.h -zdevice2.o: gsalloc.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -zdevice2.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -zdevice2.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -zdevice2.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h - -zdevice.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zdevice.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zdevice.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zdevice.o: iutil.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h -zdevice.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zdevice.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h iname.h -zdevice.o: inames.h interp.h iparam.h gsparam.h gsmatrix.h gxdevice.h -zdevice.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -zdevice.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -zdevice.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -zdevice.o: gsccode.h gsmalloc.h gxgetbit.h gxbitfmt.h store.h - -zdict.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zdict.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zdict.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zdict.o: idict.h dstack.h idstack.h ilevel.h iname.h inames.h ipacked.h -zdict.o: ivmspace.h gsgc.h store.h ialloc.h imemory.h gsalloc.h - -zdps1.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zdps1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zdps1.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zdps1.o: gsmatrix.h gspath.h gspenum.h gspath2.h gsstate.h gsdevice.h -zdps1.o: gsline.h gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h ialloc.h -zdps1.o: imemory.h ivmspace.h gsgc.h gsalloc.h igstate.h gxstate.h istruct.h -zdps1.o: gsstruct.h store.h stream.h scommon.h ibnum.h - -zfbcp.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfbcp.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfbcp.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfbcp.o: iutil.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfbcp.o: stream.h scommon.h strimpl.h sfilter.h ifilter.h istream.h - -zfcmap.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfcmap.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zfcmap.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zfcmap.o: gsmatrix.h gsstruct.h gsutil.h gxfcmap.h gsfcmap.h gsccode.h -zfcmap.o: gsuid.h gxfont.h gsfont.h gxftype.h ialloc.h imemory.h ivmspace.h -zfcmap.o: gsgc.h gsalloc.h idict.h idparam.h ifont.h iname.h inames.h store.h - -zfdctd.o: ../config.h memory_.h std.h stdpre.h arch.h stdio_.h ghost.h gx.h -zfdctd.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zfdctd.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zfdctd.o: opcheck.h iutil.h gsmalloc.h strimpl.h scommon.h gsstruct.h sdct.h -zfdctd.o: sjpeg.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h ifilter.h -zfdctd.o: istream.h iparam.h gsparam.h - -zfdcte.o: ../config.h memory_.h std.h stdpre.h arch.h stdio_.h ghost.h gx.h -zfdcte.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zfdcte.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zfdcte.o: opcheck.h iutil.h gsmalloc.h ialloc.h imemory.h ivmspace.h gsgc.h -zfdcte.o: gsalloc.h idict.h idparam.h strimpl.h scommon.h gsstruct.h sdct.h -zfdcte.o: sjpeg.h ifilter.h istream.h iparam.h gsparam.h - -zfdecode.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfdecode.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfdecode.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfdecode.o: iutil.h gsparam.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h -zfdecode.o: gsalloc.h idict.h idparam.h ilevel.h iparam.h store.h stream.h -zfdecode.o: scommon.h strimpl.h sfilter.h sa85x.h scfx.h shc.h gsbittab.h -zfdecode.o: scf.h slzwx.h spdiffx.h spngpx.h ifilter.h istream.h - -zfileio.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfileio.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gp.h gpgetenv.h -zfileio.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zfileio.o: opcheck.h iutil.h stream.h scommon.h gsstruct.h files.h store.h -zfileio.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h strimpl.h ifilter.h -zfileio.o: istream.h gsmatrix.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -zfileio.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -zfileio.o: gsbitops.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -zfileio.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -zfileio.o: gxdevmem.h - -zfile.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -zfile.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zfile.o: gscdefs.h gconfigv.h gp.h gpgetenv.h gsstruct.h gxalloc.h gsalloc.h -zfile.o: gxobj.h gxbitmap.h gsbitmap.h oper.h errors.h ostack.h iostack.h -zfile.o: istack.h opdef.h opextern.h opcheck.h iutil.h estack.h iestack.h -zfile.o: ialloc.h imemory.h ivmspace.h gsgc.h ilevel.h interp.h isave.h -zfile.o: stream.h scommon.h strimpl.h sfilter.h gxiodev.h stat_.h files.h -zfile.o: fname.h main.h imain.h gsexit.h iminst.h store.h - -zfilter2.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfilter2.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfilter2.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfilter2.o: iutil.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfilter2.o: idict.h idparam.h store.h strimpl.h scommon.h sfilter.h scfx.h -zfilter2.o: shc.h gsbittab.h slzwx.h spdiffx.h spngpx.h ifilter.h istream.h - -zfilterx.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfilterx.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfilterx.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfilterx.o: iutil.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfilterx.o: idict.h idparam.h store.h strimpl.h scommon.h sfilter.h sbwbs.h -zfilterx.o: sbhc.h shc.h gsbittab.h sbtx.h shcgen.h smtf.h spcxx.h ifilter.h -zfilterx.o: istream.h - -zfilter.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfilter.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfilter.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfilter.o: iutil.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfilter.o: idict.h idparam.h ilevel.h stream.h scommon.h strimpl.h sfilter.h -zfilter.o: srlx.h sstring.h ifilter.h istream.h files.h - -zfname.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfname.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfname.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfname.o: iutil.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h stream.h -zfname.o: scommon.h gsstruct.h gxiodev.h stat_.h fname.h - -zfont0.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfont0.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zfont0.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zfont0.o: gsstruct.h gxfixed.h gxmatrix.h gsmatrix.h gzstate.h gscpm.h -zfont0.o: gsrefct.h gxdcolor.h gscsel.h gsdcolor.h gsccolor.h gxarith.h -zfont0.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsropt.h -zfont0.o: gxistate.h gxcvalue.h gxline.h gslparam.h gxtmap.h gsstate.h -zfont0.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxdevice.h -zfont0.o: gxdevcli.h gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h -zfont0.o: gsccode.h gsparam.h gsmalloc.h gschar.h gxfcmap.h gsfcmap.h gsuid.h -zfont0.o: gxfont.h gsfont.h gxftype.h gxfont0.h bfont.h ifont.h ialloc.h -zfont0.o: imemory.h ivmspace.h gsgc.h gsalloc.h idict.h idparam.h igstate.h -zfont0.o: istruct.h iname.h inames.h store.h - -zfont1.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfont1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zfont1.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zfont1.o: gxfixed.h gsmatrix.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -zfont1.o: gsccolor.h gsstruct.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -zfont1.o: gxcindex.h gsbitops.h gsiparam.h gsrefct.h gsropt.h gsxfont.h -zfont1.o: gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -zfont1.o: gschar.h gscpm.h gxfont.h gsfont.h gsuid.h gxftype.h gxfont1.h -zfont1.o: bfont.h ifont.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfont1.o: idict.h idparam.h store.h - -zfont2.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -zfont2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zfont2.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zfont2.o: opcheck.h iutil.h gxfixed.h gsmatrix.h gxdevice.h gxdevcli.h -zfont2.o: gscompt.h gsdcolor.h gsccolor.h gsstruct.h gxarith.h gxbitmap.h -zfont2.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -zfont2.o: gsropt.h gsxfont.h gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h -zfont2.o: gsmalloc.h gschar.h gscpm.h gxfont.h gsfont.h gsuid.h gxftype.h -zfont2.o: bfont.h ifont.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zfont2.o: idict.h idparam.h ilevel.h iname.h inames.h interp.h ipacked.h -zfont2.o: istruct.h store.h - -zfont32.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfont32.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zfont32.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zfont32.o: gsccode.h gsmatrix.h gsutil.h gxfixed.h gxchar.h gschar.h gscpm.h -zfont32.o: gxtext.h gstext.h gsrefct.h gxfont.h gsfont.h gsuid.h gsstruct.h -zfont32.o: gxftype.h bfont.h ifont.h store.h ialloc.h imemory.h ivmspace.h -zfont32.o: gsgc.h gsalloc.h - -zfont42.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfont42.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfont42.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfont42.o: iutil.h gsccode.h gsmatrix.h gxfont.h gsfont.h gsuid.h gsstruct.h -zfont42.o: gxftype.h gxfont42.h bfont.h ifont.h idict.h idparam.h store.h -zfont42.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zfont.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zfont.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zfont.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zfont.o: gsstruct.h gzstate.h gscpm.h gsrefct.h gxdcolor.h gscsel.h -zfont.o: gsdcolor.h gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h -zfont.o: gxcindex.h gsbitops.h gsropt.h gxistate.h gxcvalue.h gxfixed.h -zfont.o: gxline.h gslparam.h gxmatrix.h gsmatrix.h gxtmap.h gsstate.h -zfont.o: gsdevice.h gsline.h gscolor.h gsht.h gxstate.h gxdevice.h gxdevcli.h -zfont.o: gscompt.h gsiparam.h gsxfont.h gxtext.h gstext.h gsccode.h gsparam.h -zfont.o: gsmalloc.h gschar.h gxfont.h gsfont.h gsuid.h gxftype.h gxfcache.h -zfont.o: gxbcache.h bfont.h ifont.h ialloc.h imemory.h ivmspace.h gsgc.h -zfont.o: gsalloc.h idict.h igstate.h istruct.h iname.h inames.h isave.h -zfont.o: store.h - -zfproc.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfproc.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfproc.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfproc.o: iutil.h estack.h iestack.h gsstruct.h ialloc.h imemory.h ivmspace.h -zfproc.o: gsgc.h gsalloc.h istruct.h stream.h scommon.h strimpl.h ifilter.h -zfproc.o: istream.h files.h store.h - -zfreuse.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfreuse.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfreuse.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfreuse.o: iutil.h stream.h scommon.h gsstruct.h strimpl.h sfilter.h files.h -zfreuse.o: idict.h idparam.h iname.h inames.h store.h ialloc.h imemory.h -zfreuse.o: ivmspace.h gsgc.h gsalloc.h - -zfunc0.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfunc0.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfunc0.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfunc0.o: iutil.h gsdsrc.h gsstruct.h gsfunc.h gsfunc0.h stream.h scommon.h -zfunc0.o: files.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h -zfunc0.o: idparam.h ifunc.h - -zfunc3.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfunc3.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfunc3.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfunc3.o: iutil.h gsfunc3.h gsfunc.h gsdsrc.h gsstruct.h stream.h scommon.h -zfunc3.o: files.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h -zfunc3.o: idparam.h ifunc.h store.h - -zfunc.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zfunc.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfunc.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfunc.o: iutil.h gsfunc.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h -zfunc.o: gsalloc.h idict.h idparam.h ifunc.h store.h - -zfzlib.o: ../config.h ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h -zfzlib.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zfzlib.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zfzlib.o: iutil.h idict.h strimpl.h scommon.h gsstruct.h spdiffx.h spngpx.h -zfzlib.o: szlibx.h ifilter.h istream.h ivmspace.h gsgc.h - -zgeneric.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zgeneric.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zgeneric.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zgeneric.o: iutil.h estack.h iestack.h idict.h iname.h inames.h ipacked.h -zgeneric.o: ivmspace.h gsgc.h store.h ialloc.h imemory.h gsalloc.h - -zgstate.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zgstate.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zgstate.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zgstate.o: iutil.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h -zgstate.o: istruct.h gsstruct.h igstate.h gsstate.h gsdevice.h gsline.h -zgstate.o: gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h gsmatrix.h -zgstate.o: store.h - -zhsb.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zhsb.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zhsb.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zhsb.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h gxtmap.h -zhsb.o: gsht.h gscsel.h gxstate.h istruct.h gsstruct.h store.h ialloc.h -zhsb.o: imemory.h ivmspace.h gsgc.h gsalloc.h gshsb.h - -zht1.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zht1.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h memory_.h oper.h -zht1.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zht1.o: iutil.h estack.h iestack.h gsstruct.h ialloc.h imemory.h ivmspace.h -zht1.o: gsgc.h gsalloc.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zht1.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsmatrix.h -zht1.o: gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h -zht1.o: gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h -zht1.o: gsrefct.h gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h -zht1.o: gsccode.h gsparam.h gsmalloc.h gzht.h gxht.h gscsepnm.h gsht1.h -zht1.o: gxhttype.h gxfmap.h gxfrac.h gxdht.h iht.h store.h - -zht2.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zht2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zht2.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zht2.o: gsstruct.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h gsccolor.h -zht2.o: gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h gsbitops.h -zht2.o: gsmatrix.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -zht2.o: gxfixed.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gzht.h -zht2.o: gscsel.h gxht.h gscsepnm.h gsht1.h gsht.h gxhttype.h gxtmap.h -zht2.o: gxfmap.h gxfrac.h gxdht.h estack.h iestack.h ialloc.h imemory.h -zht2.o: ivmspace.h gsgc.h gsalloc.h idict.h idparam.h igstate.h gsstate.h -zht2.o: gsdevice.h gsline.h gslparam.h gscolor.h gxstate.h istruct.h icolor.h -zht2.o: iht.h store.h - -zht.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h gstypes.h -zht.o: gsmemory.h gsmemraw.h gdebug.h iref.h memory_.h oper.h errors.h -zht.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zht.o: estack.h iestack.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h -zht.o: gsalloc.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zht.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsmatrix.h gxdevice.h -zht.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -zht.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsiparam.h gsrefct.h -zht.o: gsropt.h gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h -zht.o: gsparam.h gsmalloc.h gzht.h gxht.h gscsepnm.h gsht1.h gxhttype.h -zht.o: gxfmap.h gxfrac.h gxdht.h iht.h store.h - -zimage2.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -zimage2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zimage2.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zimage2.o: opcheck.h iutil.h gscolor.h gxtmap.h gscspace.h gscolor2.h -zimage2.o: gsptype1.h gspcolor.h gsccolor.h gsstruct.h gsuid.h gxbitmap.h -zimage2.o: gsbitmap.h gsmatrix.h gsimage.h gsiparam.h gxfixed.h idict.h -zimage2.o: idparam.h iimage.h iimage2.h ilevel.h igstate.h gsstate.h -zimage2.o: gsdevice.h gsline.h gslparam.h gsht.h gscsel.h gxstate.h istruct.h - -zimage3.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zimage3.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zimage3.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zimage3.o: iutil.h gscspace.h gscolor2.h gsptype1.h gspcolor.h gsccolor.h -zimage3.o: gsstruct.h gsuid.h gxbitmap.h gsbitmap.h gsiparm3.h gsiparam.h -zimage3.o: gsmatrix.h gsiparm4.h gxiparam.h gxdevcli.h gscompt.h gsdcolor.h -zimage3.o: gxarith.h gxhttile.h gxcindex.h gsbitops.h gsrefct.h gsropt.h -zimage3.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h idict.h -zimage3.o: idparam.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zimage3.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h iimage.h -zimage3.o: iimage2.h - -zimage.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zimage.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zimage.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zimage.o: estack.h iestack.h gsstruct.h ialloc.h imemory.h ivmspace.h gsgc.h -zimage.o: gsalloc.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zimage.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h ilevel.h -zimage.o: store.h gscspace.h gsmatrix.h gsimage.h gsiparam.h gxiparam.h -zimage.o: gxdevcli.h gscompt.h gsdcolor.h gsccolor.h gxarith.h gxbitmap.h -zimage.o: gsbitmap.h gxhttile.h gxcindex.h gsbitops.h gsrefct.h gsropt.h -zimage.o: gsxfont.h gxcvalue.h gxfixed.h gxtext.h gstext.h gsccode.h stream.h -zimage.o: scommon.h ifilter.h istream.h iimage.h - -ziodev2.o: string_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -ziodev2.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gp.h -ziodev2.o: gpgetenv.h oper.h errors.h ostack.h iostack.h istack.h opdef.h -ziodev2.o: opextern.h opcheck.h iutil.h stream.h scommon.h gsstruct.h -ziodev2.o: gxiodev.h stat_.h dstack.h idstack.h files.h iparam.h gsparam.h -ziodev2.o: iutil2.h store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -ziodev.o: memory_.h std.h stdpre.h arch.h stdio_.h string_.h ghost.h gx.h -ziodev.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -ziodev.o: gp.h gpgetenv.h gpcheck.h gsstruct.h oper.h errors.h ostack.h -ziodev.o: iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h stream.h -ziodev.o: scommon.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h iscan.h -ziodev.o: sa85x.h sstring.h gxiodev.h stat_.h files.h scanchar.h store.h - -zmath.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h gsio.h -zmath.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gxfarith.h -zmath.o: gconfigv.h gxarith.h oper.h errors.h ostack.h iostack.h istack.h -zmath.o: opdef.h opextern.h opcheck.h iutil.h store.h ialloc.h imemory.h -zmath.o: ivmspace.h gsgc.h gsalloc.h - -zmatrix.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zmatrix.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zmatrix.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zmatrix.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zmatrix.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h gsmatrix.h -zmatrix.o: gscoord.h store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zmedia2.o: math_.h std.h stdpre.h arch.h memory_.h ghost.h gx.h stdio_.h -zmedia2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zmedia2.o: gsmatrix.h oper.h errors.h ostack.h iostack.h istack.h opdef.h -zmedia2.o: opextern.h opcheck.h iutil.h idict.h idparam.h iname.h inames.h -zmedia2.o: store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zmisc1.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zmisc1.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zmisc1.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zmisc1.o: iutil.h gscrypt1.h stream.h scommon.h gsstruct.h strimpl.h -zmisc1.o: sfilter.h idict.h idparam.h ifilter.h istream.h ivmspace.h gsgc.h - -zmisc2.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -zmisc2.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zmisc2.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zmisc2.o: opcheck.h iutil.h estack.h iestack.h idict.h idparam.h iparam.h -zmisc2.o: gsparam.h dstack.h idstack.h ilevel.h iname.h inames.h iutil2.h -zmisc2.o: ivmspace.h gsgc.h store.h ialloc.h imemory.h gsalloc.h - -zmisc3.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zmisc3.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsclipsr.h oper.h -zmisc3.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zmisc3.o: iutil.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zmisc3.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h -zmisc3.o: store.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h - -zmisc.o: errno_.h std.h stdpre.h arch.h memory_.h string_.h ghost.h gx.h -zmisc.o: stdio_.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h -zmisc.o: iref.h gscdefs.h gconfigv.h gp.h gpgetenv.h oper.h errors.h ostack.h -zmisc.o: iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h ialloc.h -zmisc.o: imemory.h ivmspace.h gsgc.h gsalloc.h idict.h dstack.h idstack.h -zmisc.o: iname.h inames.h ipacked.h store.h - -zpacked.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zpacked.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h ialloc.h imemory.h -zpacked.o: ivmspace.h gsgc.h gsalloc.h idict.h iname.h inames.h istack.h -zpacked.o: ipacked.h iparray.h oper.h errors.h ostack.h iostack.h opdef.h -zpacked.o: opextern.h opcheck.h iutil.h store.h - -zpaint.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zpaint.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zpaint.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zpaint.o: gspaint.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zpaint.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h - -zpath1.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zpath1.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zpath1.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zpath1.o: iutil.h estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h -zpath1.o: gsalloc.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zpath1.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h -zpath1.o: gspath.h gspenum.h store.h - -zpath.o: math_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h gsio.h -zpath.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zpath.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zpath.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gscolor.h -zpath.o: gxtmap.h gsht.h gscsel.h gxstate.h istruct.h gsstruct.h gsmatrix.h -zpath.o: gspath.h gspenum.h store.h ialloc.h imemory.h ivmspace.h gsgc.h -zpath.o: gsalloc.h - -zpcolor.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zpcolor.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zpcolor.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zpcolor.o: gscolor.h gxtmap.h gsmatrix.h gsstruct.h gxcspace.h gscspace.h -zpcolor.o: gsccolor.h gscsel.h gxfrac.h gxfixed.h gxcolor2.h gscolor2.h -zpcolor.o: gsptype1.h gspcolor.h gsuid.h gxbitmap.h gsbitmap.h gsrefct.h -zpcolor.o: gxdcolor.h gsdcolor.h gxarith.h gxhttile.h gxcindex.h gsbitops.h -zpcolor.o: gsropt.h gxdevice.h gxdevcli.h gscompt.h gsiparam.h gsxfont.h -zpcolor.o: gxcvalue.h gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h -zpcolor.o: gxdevmem.h gxpcolor.h gxpcache.h estack.h iestack.h ialloc.h -zpcolor.o: imemory.h ivmspace.h gsgc.h gsalloc.h istruct.h idict.h idparam.h -zpcolor.o: igstate.h gsstate.h gsdevice.h gsline.h gslparam.h gsht.h -zpcolor.o: gxstate.h store.h - -zrelbit.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zrelbit.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zrelbit.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zrelbit.o: gsutil.h idict.h store.h ialloc.h imemory.h ivmspace.h gsgc.h -zrelbit.o: gsalloc.h - -zshade.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zshade.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h -zshade.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zshade.o: iutil.h gscolor3.h gscspace.h gscolor2.h gsptype1.h gspcolor.h -zshade.o: gsccolor.h gsstruct.h gsuid.h gxbitmap.h gsbitmap.h gsfunc3.h -zshade.o: gsfunc.h gsdsrc.h gsshade.h gsmatrix.h stream.h scommon.h files.h -zshade.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h idict.h idparam.h -zshade.o: ifunc.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zshade.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h store.h - -zstack.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zstack.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h ialloc.h -zstack.o: imemory.h ivmspace.h gsgc.h gsalloc.h istack.h oper.h errors.h -zstack.o: ostack.h iostack.h opdef.h opextern.h opcheck.h iutil.h store.h - -zstring.o: memory_.h std.h stdpre.h arch.h ghost.h gx.h stdio_.h gserror.h -zstring.o: gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsutil.h -zstring.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h iname.h inames.h -zstring.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zstring.o: opcheck.h iutil.h store.h - -zsysvm.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zsysvm.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zsysvm.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zsysvm.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h store.h - -ztoken.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -ztoken.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -ztoken.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -ztoken.o: estack.h iestack.h gsstruct.h stream.h scommon.h files.h store.h -ztoken.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h strimpl.h sfilter.h -ztoken.o: iscan.h sa85x.h sstring.h - -ztrap.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -ztrap.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -ztrap.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -ztrap.o: ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h iparam.h gsparam.h -ztrap.o: gstrap.h - -ztype.o: math_.h std.h stdpre.h arch.h memory_.h string_.h gsexit.h ghost.h -ztype.o: gx.h stdio_.h gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h -ztype.o: gdebug.h iref.h oper.h errors.h ostack.h iostack.h istack.h opdef.h -ztype.o: opextern.h opcheck.h iutil.h imemory.h ivmspace.h gsgc.h gsalloc.h -ztype.o: idict.h iname.h inames.h stream.h scommon.h gsstruct.h strimpl.h -ztype.o: sfilter.h iscan.h sa85x.h sstring.h dstack.h idstack.h store.h -ztype.o: ialloc.h - -zupath.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zupath.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zupath.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zupath.o: idict.h dstack.h idstack.h igstate.h gsstate.h gsdevice.h gsline.h -zupath.o: gslparam.h gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h -zupath.o: gsstruct.h iname.h inames.h store.h ialloc.h imemory.h ivmspace.h -zupath.o: gsgc.h gsalloc.h stream.h scommon.h ibnum.h gsmatrix.h gscoord.h -zupath.o: gspaint.h gxfixed.h gxdevice.h gxdevcli.h gscompt.h gsdcolor.h -zupath.o: gsccolor.h gxarith.h gxbitmap.h gsbitmap.h gxhttile.h gxcindex.h -zupath.o: gsbitops.h gsiparam.h gsrefct.h gsropt.h gsxfont.h gxcvalue.h -zupath.o: gxtext.h gstext.h gsccode.h gsparam.h gsmalloc.h gspath.h gspenum.h -zupath.o: gzpath.h gxpath.h gscpm.h gsrect.h gzstate.h gxdcolor.h gxistate.h -zupath.o: gxline.h gxmatrix.h - -zusparam.o: memory_.h std.h stdpre.h arch.h string_.h ghost.h gx.h stdio_.h -zusparam.o: gserror.h gsio.h gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h -zusparam.o: oper.h errors.h ostack.h iostack.h istack.h opdef.h opextern.h -zusparam.o: opcheck.h iutil.h gscdefs.h gconfigv.h gsstruct.h gsfont.h gxht.h -zusparam.o: gscsepnm.h gsht1.h gsht.h gsrefct.h gxhttype.h gxtmap.h gsutil.h -zusparam.o: estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zusparam.o: icontext.h icstate.h idict.h idparam.h iparam.h gsparam.h -zusparam.o: dstack.h idstack.h iname.h inames.h iutil2.h store.h - -zvmem2.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zvmem2.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h oper.h errors.h -zvmem2.o: ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h iutil.h -zvmem2.o: estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h gsalloc.h -zvmem2.o: store.h - -zvmem.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -zvmem.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h gsstruct.h oper.h -zvmem.o: errors.h ostack.h iostack.h istack.h opdef.h opextern.h opcheck.h -zvmem.o: iutil.h estack.h iestack.h ialloc.h imemory.h ivmspace.h gsgc.h -zvmem.o: gsalloc.h idict.h igstate.h gsstate.h gsdevice.h gsline.h gslparam.h -zvmem.o: gscolor.h gxtmap.h gsht.h gscsel.h gxstate.h istruct.h isave.h -zvmem.o: dstack.h idstack.h stream.h scommon.h files.h store.h gsmalloc.h -zvmem.o: gsmatrix.h - -genarch.o: stdpre.h - -pstoraster.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/string.h -pstoraster.o: ../config.h ../cups/md5.h ../cups/ppd.h ../cups/string.h -pstoraster.o: ghost.h gx.h stdio_.h std.h stdpre.h arch.h gserror.h gsio.h -pstoraster.o: gstypes.h gsmemory.h gsmemraw.h gdebug.h iref.h imain.h -pstoraster.o: gsexit.h iminst.h istack.h interp.h ostack.h iostack.h -pstoraster.o: opextern.h gscdefs.h gconfigv.h store.h ialloc.h imemory.h -pstoraster.o: ivmspace.h gsgc.h gsalloc.h diff --git a/pstoraster/Fontmap b/pstoraster/Fontmap deleted file mode 100644 index 80641e3e31..0000000000 --- a/pstoraster/Fontmap +++ /dev/null @@ -1,98 +0,0 @@ -% -% "$Id: Fontmap,v 1.4 1999/07/30 12:57:12 mike Exp $" -% -% Fontmap file for the Common UNIX Printing System (CUPS). -% -% Copyright 1997-1999 by Easy Software Products, all rights reserved. -% -% These coded instructions, statements, and computer programs are the -% property of Easy Software Products and are protected by Federal -% copyright law. Distribution and use rights are outlined in the file -% "LICENSE.txt" which should have been included with this file. If this -% file is missing or damaged please contact Easy Software Products -% at: -% -% Attn: CUPS Licensing Information -% Easy Software Products -% 44145 Airport View Drive, Suite 204 -% Hollywood, Maryland 20636-3111 USA -% -% Voice: (301) 373-9603 -% EMail: cups-info@cups.org -% WWW: http://www.cups.org -% - -% -% The Fontmap file takes lines in the following formats: -% -% /FontName /RealFontName [for aliases] -% /FontName (FileName) [for actual font files] -% -% All Type1 fonts in the "fonts" directory (usually /usr/share/cups/fonts) -% are automagically added with the names in the font files (that is, the -% font filename doesn't matter, it looks at the file header instead). -% - -% -% The standard fonts included with ESP Print are the free GhostScript fonts, -% which don't use the standard names. These aliases map the standard 39 -% fonts to the free fonts. -% - -/Bookman-Demi /URWBookmanL-DemiBold ; -/Bookman-DemiItalic /URWBookmanL-DemiBoldItal ; -/Bookman-Light /URWBookmanL-Ligh ; -/Bookman-LightItalic /URWBookmanL-LighItal ; - -/Courier /NimbusMonL-Regu ; -/Courier-Oblique /NimbusMonL-ReguObli ; -/Courier-Bold /NimbusMonL-Bold ; -/Courier-BoldOblique /NimbusMonL-BoldObli ; - -/AvantGarde-Book /URWGothicL-Book ; -/AvantGarde-BookOblique /URWGothicL-BookObli ; -/AvantGarde-Demi /URWGothicL-Demi ; -/AvantGarde-DemiOblique /URWGothicL-DemiObli ; - -/Helvetica /NimbusSanL-Regu ; -/Helvetica-Oblique /NimbusSanL-ReguItal ; -/Helvetica-Bold /NimbusSanL-Bold ; -/Helvetica-BoldOblique /NimbusSanL-BoldItal ; - -/Helvetica-Narrow /NimbusSanL-ReguCond ; -/Helvetica-Narrow-Oblique /NimbusSanL-ReguCondItal ; -/Helvetica-Narrow-Bold /NimbusSanL-BoldCond ; -/Helvetica-Narrow-BoldOblique /NimbusSanL-BoldCondItal ; - -/Palatino-Roman /URWPalladioL-Roma ; -/Palatino-Italic /URWPalladioL-Ital ; -/Palatino-Bold /URWPalladioL-Bold ; -/Palatino-BoldItalic /URWPalladioL-BoldItal ; - -/NewCenturySchlbk-Roman /CenturySchL-Roma ; -/NewCenturySchlbk-Italic /CenturySchL-Ital ; -/NewCenturySchlbk-Bold /CenturySchL-Bold ; -/NewCenturySchlbk-BoldItalic /CenturySchL-BoldItal ; - -/Times-Roman /NimbusRomNo9L-Regu ; -/Times-Italic /NimbusRomNo9L-ReguItal ; -/Times-Bold /NimbusRomNo9L-Medi ; -/Times-BoldItalic /NimbusRomNo9L-MediItal ; - -/Symbol /StandardSymL ; - -/ZapfChancery-MediumItalic /URWChanceryL-MediItal ; - -/ZapfDingbats /Dingbats ; - -% -% This alias is for less-intelligent PC programs like Quark and -% Freehand which insist on using "Times" as the name for the -% "Times-Roman" font. Go figure. -% - -/Times /Times-Roman ; - -% -% End of "$Id: Fontmap,v 1.4 1999/07/30 12:57:12 mike Exp $". -% diff --git a/pstoraster/Makefile b/pstoraster/Makefile deleted file mode 100644 index fbc39912e7..0000000000 --- a/pstoraster/Makefile +++ /dev/null @@ -1,454 +0,0 @@ -# -# "$Id: Makefile,v 1.31.2.2 2001/12/26 16:52:48 mike Exp $" -# -# GNU Ghostscript makefile for the Common UNIX Printing System (CUPS). -# -# Copyright 1993-2001 by Easy Software Products. -# -# These coded instructions, statements, and computer programs are the -# property of Easy Software Products and are protected by Federal -# copyright law. Distribution and use rights are outlined in the file -# "LICENSE.txt" which should have been included with this file. If this -# file is missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636-3111 USA -# -# Voice: (301) 373-9603 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org -# -# This makefile and any derivative of it may be used and distributed -# freely under the terms of the GNU General Public License when -# used with GNU Ghostscript or its derivatives. Use of the makefile -# (or any derivative of it) with software other than GNU GhostScript -# (or its derivatives) is governed by the CUPS license agreement. -# - -include ../Makedefs - - -# -# Object files... -# - -LIBOBJS = gconfig.o \ - gdevabuf.o \ - gdevbbox.o \ - gdevcups.o \ - gdevdbit.o \ - gdevddrw.o \ - gdevdflt.o \ - gdevdgbr.o \ - gdevhit.o \ - gdevm16.o \ - gdevm1.o \ - gdevm24.o \ - gdevm2.o \ - gdevm32.o \ - gdevm4.o \ - gdevm8.o \ - gdevmem.o \ - gdevmpla.o \ - gdevnfwd.o \ - gdevpipe.o \ - gdevprn.o \ - gp_getnv.o \ - gp_nofb.o \ - gp_nsync.o \ - gp_unifn.o \ - gp_unifs.o \ - gp_unix.o \ - gsalloc.o \ - gsalpha.o \ - gsargs.o \ - gsbitops.o \ - gsbittab.o \ - gscdefs.o \ - gscdevn.o \ - gschar0.o \ - gschar.o \ - gscie.o \ - gsclipsr.o \ - gscolor1.o \ - gscolor2.o \ - gscolor3.o \ - gscolor.o \ - gscoord.o \ - gscparam.o \ - gscpixel.o \ - gscrdp.o \ - gscrd.o \ - gscscie.o \ - gscsepr.o \ - gscspace.o \ - gsdevice.o \ - gsdevmem.o \ - gsdparam.o \ - gsdps1.o \ - gsdsrc.o \ - gsfcmap.o \ - gsfont0.o \ - gsfont.o \ - gsfunc0.o \ - gsfunc3.o \ - gsfunc.o \ - gshsb.o \ - gsht1.o \ - gshtscr.o \ - gsht.o \ - gsimage.o \ - gsimpath.o \ - gsinit.o \ - gsiodev.o \ - gsline.o \ - gsmalloc.o \ - gsmatrix.o \ - gsmemory.o \ - gsmisc.o \ - gsnorop.o \ - gspaint.o \ - gsparams.o \ - gsparam.o \ - gspath1.o \ - gspath.o \ - gspcolor.o \ - gsshade.o \ - gsstate.o \ - gstext.o \ - gstrap.o \ - gstype1.o \ - gstype2.o \ - gstype42.o \ - gsutil.o \ - gxacpath.o \ - gxbcache.o \ - gxccache.o \ - gxccman.o \ - gxcht.o \ - gxclbits.o \ - gxclimag.o \ - gxclip2.o \ - gxclipm.o \ - gxclip.o \ - gxclist.o \ - gxclmem.o \ - gxclpage.o \ - gxclpath.o \ - gxclrast.o \ - gxclread.o \ - gxclrect.o \ - gxclutil.o \ - gxclzlib.o \ - gxcmap.o \ - gxcpath.o \ - gxctable.o \ - gxdcconv.o \ - gxdcolor.o \ - gxdither.o \ - gxfill.o \ - gxhint1.o \ - gxhint2.o \ - gxhint3.o \ - gxht.o \ - gxi12bit.o \ - gxicolor.o \ - gxidata.o \ - gxifast.o \ - gxiinit.o \ - gximage3.o \ - gximage4.o \ - gximono.o \ - gxiscale.o \ - gxmclip.o \ - gxp1fill.o \ - gxpaint.o \ - gxpath2.o \ - gxpath.o \ - gxpcmap.o \ - gxpcopy.o \ - gxpdash.o \ - gxpflat.o \ - gxsample.o \ - gxshade1.o \ - gxshade4.o \ - gxshade6.o \ - gxshade.o \ - gxstroke.o \ - gxtype1.o \ - ialloc.o \ - ibnum.o \ - iccinit0.o \ - iconfig.o \ - icontext.o \ - idebug.o \ - idict.o \ - idparam.o \ - idstack.o \ - igcref.o \ - igcstr.o \ - igc.o \ - iinit.o \ - ilocate.o \ - imainarg.o \ - imain.o \ - iname.o \ - interp.o \ - iparam.o \ - ireclaim.o \ - isave.o \ - iscanbin.o \ - iscannum.o \ - iscan.o \ - istack.o \ - iutil2.o \ - iutil.o \ - sbcp.o \ - sbhc.o \ - sbwbs.o \ - scantab.o \ - scfdtab.o \ - scfd.o \ - scfetab.o \ - scfe.o \ - scfparam.o \ - sdcparam.o \ - sdctc.o \ - sdctd.o \ - sdcte.o \ - sddparam.o \ - sdeparam.o \ - seexec.o \ - sfilter1.o \ - sfilter2.o \ - sfxstdio.o \ - shcgen.o \ - shc.o \ - siscale.o \ - sjpegc.o \ - sjpegd.o \ - sjpegerr.o \ - sjpege.o \ - slzwce.o \ - slzwc.o \ - slzwd.o \ - smtf.o \ - spcxd.o \ - spdiff.o \ - spngp.o \ - srld.o \ - srle.o \ - sstring.o \ - stream.o \ - szlibc.o \ - szlibd.o \ - szlibe.o \ - zarith.o \ - zarray.o \ - zbseq.o \ - zcfont.o \ - zchar1.o \ - zchar2.o \ - zchar32.o \ - zchar42.o \ - zcharout.o \ - zchar.o \ - zcid.o \ - zcie.o \ - zcolor1.o \ - zcolor2.o \ - zcolor.o \ - zcontrol.o \ - zcrd.o \ - zcsdevn.o \ - zcsindex.o \ - zcspixel.o \ - zcssepr.o \ - zdevcal.o \ - zdevice2.o \ - zdevice.o \ - zdict.o \ - zdps1.o \ - zfbcp.o \ - zfcmap.o \ - zfdctd.o \ - zfdcte.o \ - zfdecode.o \ - zfileio.o \ - zfile.o \ - zfilter2.o \ - zfilterx.o \ - zfilter.o \ - zfname.o \ - zfont0.o \ - zfont1.o \ - zfont2.o \ - zfont32.o \ - zfont42.o \ - zfont.o \ - zfproc.o \ - zfreuse.o \ - zfunc0.o \ - zfunc3.o \ - zfunc.o \ - zfzlib.o \ - zgeneric.o \ - zgstate.o \ - zhsb.o \ - zht1.o \ - zht2.o \ - zht.o \ - zimage2.o \ - zimage3.o \ - zimage.o \ - ziodev2.o \ - ziodev.o \ - zmath.o \ - zmatrix.o \ - zmedia2.o \ - zmisc1.o \ - zmisc2.o \ - zmisc3.o \ - zmisc.o \ - zpacked.o \ - zpaint.o \ - zpath1.o \ - zpath.o \ - zpcolor.o \ - zrelbit.o \ - zshade.o \ - zstack.o \ - zstring.o \ - zsysvm.o \ - ztoken.o \ - ztrap.o \ - ztype.o \ - zupath.o \ - zusparam.o \ - zvmem2.o \ - zvmem.o - -OBJS = $(LIBOBJS) genarch.o pstoraster.o - -# -# Data files... -# - -DFILES = Fontmap \ - gs_btokn.ps gs_ccfnt.ps gs_cff.ps gs_cidfn.ps \ - gs_cmap.ps gs_cmdl.ps gs_dbt_e.ps gs_diskf.ps \ - gs_dpnxt.ps gs_dps1.ps gs_dps2.ps gs_dps.ps gs_epsf.ps \ - gs_fform.ps gs_fonts.ps gs_init.ps gs_iso_e.ps \ - gs_kanji.ps gs_ksb_e.ps gs_lev2.ps gs_ll3.ps \ - gs_mex_e.ps gs_mro_e.ps gs_pfile.ps gs_res.ps \ - gs_setpd.ps gs_statd.ps gs_std_e.ps gs_sym_e.ps \ - gs_ttf.ps gs_typ32.ps gs_typ42.ps gs_type1.ps \ - gs_wan_e.ps gs_wl1_e.ps gs_wl2_e.ps gs_wl5_e.ps - - -# -# Targets... -# - -TARGETS = genarch arch.h libgs.a pstoraster - - -# -# Make everything... -# - -all: $(TARGETS) - -# -# Clean all config and object files... -# - -clean: - $(RM) $(TARGETS) - $(RM) $(OBJS) - - -# -# Install files... -# - -install: $(TARGETS) - $(INSTALL_DIR) $(SERVERBIN)/filter - $(INSTALL_BIN) pstoraster $(SERVERBIN)/filter - $(INSTALL_DIR) $(DATADIR)/pstoraster - for file in $(DFILES); do \ - $(INSTALL_DATA) $$file $(DATADIR)/pstoraster; \ - done - - -# -# genarch - generate the architecture configuration file. -# - -genarch: genarch.o - echo Linking $@... - $(CC) $(LDFLAGS) -o genarch genarch.o -arch.h: genarch - echo Generating $@... - ./genarch arch.h - - -# -# libgs.a - GhostScript interpreter library... -# - -libgs.a: $(LIBOBJS) ../Makedefs - echo Archiving $@... - $(RM) $@ - $(AR) $(ARFLAGS) $@ $(LIBOBJS) - $(RANLIB) $@ - - -# -# pstoraster - PostScript RIP filter. -# - -pstoraster: pstoraster.o libgs.a ../Makedefs ../cups/$(LIBCUPS) - echo Linking $@... - $(CC) $(LDFLAGS) -o pstoraster pstoraster.o libgs.a \ - $(LINKCUPSIMAGE) $(IMGLIBS) $(DSOLIBS) $(LIBS) -lm - - -# -# purify - target to test Ghostscript to see how leaky it is... -# - -purify: pstoraster.o libgs.a ../Makedefs ../cups/$(LIBCUPS) - echo Linking $@... - purify $(CC) $(LDFLAGS) -o pstoraster.pure pstoraster.o libgs.a \ - $(LINKCUPSIMAGE) $(IMGLIBS) $(DSOLIBS) $(LIBS) -lm - - -# -# Generate dependencies for Ghostscript source files... -# - -depend: - rm -f Dependencies - touch Dependencies - for file in $(OBJS:.o=.c); do \ - echo $$file; \ - makedepend -a -fDependencies -I.. -Y $$file >/dev/null 2>&1; \ - done - - -# -# Dependencies... -# - -$(OBJS): ../Makedefs - -include Dependencies - - -# -# End of "$Id: Makefile,v 1.31.2.2 2001/12/26 16:52:48 mike Exp $". -# diff --git a/pstoraster/README.pstoraster b/pstoraster/README.pstoraster new file mode 100644 index 0000000000..640bcfa565 --- /dev/null +++ b/pstoraster/README.pstoraster @@ -0,0 +1,74 @@ +README.pstoraster - 12/29/2001 +------------------------------ + +INTRODUCTION + + This directory contains the CUPS "driver" for GNU + Ghostscript 6.52, the pstoraster script that is used to run + Ghostscript as a CUPS filter, the pstoraster.convs file that + defines the PostScript to raster filter for CUPS drivers, a + makefile fragment that adds the CUPS driver, and the + required patch against GNU Ghostscript which fixes critical + bugs in the current release. + + This software is also available as part of the ESP + Ghostscript distribution, which is available from: + + http://espgs.sourceforge.net/ + + +COMPILING GHOSTSCRIPT WITH THE CUPS DRIVER + + The easiest way to add the CUPS driver to Ghostscript is to + run the "patchgs.sh" shell script: + + ./patchgs.sh /path/to/ghostscript + + The patch script runs the following commands: + + cp pstoraster pstoraster.convs /path/to/ghostscript + cp cups.mak gdevcups.c /path/to/ghostscript/src + cd /path/to/ghostscript + patch -p1 - -#endif /* ctype__INCLUDED */ diff --git a/pstoraster/cups.mak b/pstoraster/cups.mak new file mode 100644 index 0000000000..078daf96a9 --- /dev/null +++ b/pstoraster/cups.mak @@ -0,0 +1,18 @@ +### ----------------- CUPS Ghostscript Driver ---------------------- ### + +cups_= $(GLOBJ)gdevcups.$(OBJ) + +$(DD)cups.dev: $(cups_) $(GLD)page.dev + $(ADDMOD) $(DD)cups -lib cupsimage -lib cups + $(SETPDEV2) $(DD)cups $(cups_) + +$(GLOBJ)gdevcups.$(OBJ): $(GLSRC)gdevcups.c $(PDEVH) + $(GLCC) $(GLOBJ)gdevcups.$(OBJ) $(C_) $(GLSRC)gdevcups.c + +install: install-cups + +install-cups: + -mkdir -p `cups-config --serverbin`/filter + $(INSTALL_PROGRAM) pstoraster `cups-config --serverbin`/filter + -mkdir -p `cups-config --serverroot` + $(INSTALL_PROGRAM) pstoraster.convs `cups-config --serverroot` diff --git a/pstoraster/dirent_.h b/pstoraster/dirent_.h deleted file mode 100644 index 5bca645ea8..0000000000 --- a/pstoraster/dirent_.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 1993-2001 by Easy Software Products. - Copyright 1993, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: dirent_.h,v 1.5 2001/01/22 15:03:54 mike Exp $ */ -/* Generic substitute for Unix dirent.h */ - -#ifndef dirent__INCLUDED -# define dirent__INCLUDED - -/* We must include std.h before any file that includes sys/types.h. */ -#include "std.h" - -#include - -/* - * Directory entries may be defined in quite a number of different - * header files. The following switches are defined in gconfig_.h. - */ -#ifdef HAVE_DIRENT_H -# include -typedef struct dirent dir_entry; - -#else /* sys/ndir or ndir or sys/dir, i.e., no dirent */ -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -typedef struct direct dir_entry; - -#endif /* sys/ndir or ndir or sys/dir */ - -#endif /* dirent__INCLUDED */ diff --git a/pstoraster/dstack.h b/pstoraster/dstack.h deleted file mode 100644 index eb98806a92..0000000000 --- a/pstoraster/dstack.h +++ /dev/null @@ -1,236 +0,0 @@ -/* Copyright (C) 1992, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: dstack.h,v 1.2 2000/03/08 23:14:20 mike Exp $ */ -/* Definitions for the interpreter's dictionary stack */ - -#ifndef dstack_INCLUDED -# define dstack_INCLUDED - -#include "idstack.h" - -/* Define the (currently static) dictionary stack instance. */ -extern dict_stack_t idict_stack; - -#define d_stack (idict_stack.stack) - -/* Define the interpreter-specific versions of the generic dstack API. */ -#define min_dstack_size (idict_stack.min_size) -#define dstack_userdict_index (idict_stack.userdict_index) -#define dsspace (idict_stack.def_space) -#define dtop_can_store(pvalue) ((int)r_space(pvalue) <= dsspace) -#define dtop_keys (idict_stack.top_keys) -#define dtop_npairs (idict_stack.top_npairs) -#define dtop_values (idict_stack.top_values) -#define dict_set_top() dstack_set_top(&idict_stack); -#define dict_is_permanent_on_dstack(pdict)\ - dstack_dict_is_permanent(&idict_stack, pdict) -#define dicts_gc_cleanup() dstack_gc_cleanup(&idict_stack) -#define systemdict (&idict_stack.system_dict) - -/* Define the dictionary stack pointers. */ -#define dsbot (d_stack.bot) -#define dsp (d_stack.p) -#define dstop (d_stack.top) - -/* Macro to ensure enough room on the dictionary stack */ -#define check_dstack(n)\ - if ( dstop - dsp < (n) )\ - { d_stack.requested = (n); return_error(e_dictstackoverflow); } - -/* - * The dictionary stack is implemented as a linked list of blocks; - * operators that access the entire d-stack must take this into account. - * These are: - * countdictstack dictstack - * In addition, name lookup requires searching the entire stack, not just - * the top block, and the underflow check for the dictionary stack - * (`end' operator) is not just a check for underflowing the top block. - */ - -/* Name lookup */ -#define dict_find_name_by_index(nidx)\ - dstack_find_name_by_index(&idict_stack, nidx) -#define dict_find_name(pnref) dict_find_name_by_index(name_index(pnref)) -#define dict_find_name_by_index_inline(nidx, htemp)\ - dstack_find_name_by_index_inline(&idict_stack, nidx, htemp) -#define if_dict_find_name_by_index_top(nidx, htemp, pvslot)\ - if_dstack_find_name_by_index_top(&idict_stack, nidx, htemp, pvslot) - -/* - Notes on dictionary lookup performance - -------------------------------------- - - We mark heavily used operations with a * below; moderately heavily used - operations with a +. - - The following operations change the dictionary stack: - +begin, +end - readonly (on a dictionary that is on the stack) - noaccess (on a dictionary that is on the stack) - We implement cleardictstack as a series of ends. - - The following operations change the contents of dictionaries: - *def, +put - undef - restore - .setmaxlength - We implement store in PostScript, and copy as a series of puts. Many - other operators also do puts (e.g., ScaleMatrix in makefont, - Implementation in makepattern, ...). Note that put can do an implicit - .setmaxlength (if it has to grow the dictionary). - - The following operations look up keys on the dictionary stack: - *(interpreter name lookup) - load - where - - Current design - -------------- - - Each name has a pointer that has one of 3 states: - - This name has no definitions. - - This name has exactly one definition, in systemdict or userdict. - In this case, the pointer points to the value slot. - - This name has some other status. - - We cache some pointers to the top dictionary on the stack if it is a - readable dictionary with packed keys, which allows us to do fast, - single-probe lookups in this dictionary. We also cache a value that - allows us to do a fast check for stores into the top dictionary - (writability + space check). - - Full shallow binding - -------------------- - - We implement shallow binding with a pointer in each name that points to - the value slot that holds the name's definition. If the name is - undefined, or if we don't know where the slot is, the binding pointer - points to a ref with a special type t__invalid, which cannot occur - anywhere else. "Clearing" the pointer means setting it to point to this - ref. - - We also maintain a pair of pointers that bracket the value region of the - top dictionary on the stack, for fast checking in def. If the top - dictionary is readonly or noaccess, the pointers designate an empty area. - We call this the "def region" cache. - - We implement the above operations as follows: - begin - push the dictionary on the stack; set the pointers of - all name keys to point to the corresponding value slots. - end - pop the stack; clear the pointers of all name keys. - readonly - if the dictionary is the top one on the stack, - reset the def region cache. - noaccess - clear the pointers of all name keys. (This is overly - conservative, but this is a very rare operation.) - Also reset the def region cache if the dictionary is - the top one on the stack. - def - if the key is a name and its pointer points within the cached - def region, store the value through the pointer; otherwise, - look up the key in the top dictionary, store the value, - and if the key is a name, set its pointer to the value slot. - put - if the key is a name and wasn't in the dictionary before, - clear its pointer. (Conservative, but rare.) - undef - if the key is a name, clear its pointer. (Overly - conservative, but rare.) - restore - if either the old or the new value of a change is a name - (possibly in a packed array), clear its pointer. This is - conservative, but easy to detect, and probably not *too* - conservative. - .setmaxlength - clear all the pointers, like noaccess. - (name lookup) - fetch the value through the pointer and dispatch - on its type; if the type is t__invalid, do a full search - and set the pointer. This avoids a separate check for a - clear pointer in the usual case where the pointer is valid. - load - if the pointer is clear, do a search and set the pointer; - then fetch the value. - where - always do a full search and set the pointer. - (Conservative, but rare.) - - One place where shallow binding will result in major new overhead is the - extra push of systemdict for loading fonts. This probably isn't a problem - in real life. - - Adaptive shallow binding - ------------------------ - - We do validity checking for the name value cache using an epoch counter. - For each dictionary D, we keep an on-stack flag F. Each dictionary stack - entry is where D is the actual dictionary, M is a mark vector of - V bits (V is a system constant, probably 64), F is D's former on-stack - flag, and E is the epoch at which the entry was made. For each name K, we - keep a cache where P is a pointer to the dictionary value slot that - holds the current value of K, and E is an epoch value; the cache is valid - if K->E >= dsp->E. Here is what happens for each operation: - - ****** Still need to handle names defined only in systemdict or userdict? - - To initialize: - Epoch = 0 - To clear the cache entry for K: - *K = - begin(D): - *++dsp = F, ++Epoch> - set D->F - value = lookup(K): - if K->E >= dsp->E - value = *K->P - else - do lookup as usual - *K = - set dp->M[i mod V] where dp is the dstack slot of the dictionary - where K was found and i is the index within that dictionary - end: - for each i such that dsp->M[i] is set, - clear the cache entry for dsp->D->keys[i, i+V, ...] - dsp->D->F = dsp->F - --dsp - noaccess(D): - if D->F is set, - clear the cache entries for all name keys of D - readonly(D): - << nothing >> - .setmaxlength(D,N): - same as noaccess - restore: - If either the old or the new value of a change is a name - (possibly in a packed array), clear its cache entry. This is - conservative, but easy to detect, and probably not *too* - conservative. - def(K,V): - if K->P points into dsp->D - *K->P = V - else - put the new value in dsp->D - set *K and dsp->M[i mod V] as for a lookup - put(D,K,V): - if K is already defined in D, do nothing special - otherwise, if D->F isn't set, do nothing special - otherwise, clear K's cache entry - undef(D,K): - if D->F is set, - clear K's cache entry - */ - -#endif /* dstack_INCLUDED */ diff --git a/pstoraster/errno_.h b/pstoraster/errno_.h deleted file mode 100644 index 8c5c21e7de..0000000000 --- a/pstoraster/errno_.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1993, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: errno_.h,v 1.2 2000/03/08 23:14:20 mike Exp $ */ -/* Generic substitute for Unix errno.h */ - -#ifndef errno__INCLUDED -# define errno__INCLUDED - -/* We must include std.h before any file that includes sys/types.h. */ -#include "std.h" - -/* All environments provide errno.h, but in some of them, errno.h */ -/* only defines the error numbers, and doesn't declare errno. */ -#include -#ifndef errno /* in case it was #defined (very implausible!) */ -extern int errno; - -#endif - -#endif /* errno__INCLUDED */ diff --git a/pstoraster/errors.h b/pstoraster/errors.h deleted file mode 100644 index 4aca7ac459..0000000000 --- a/pstoraster/errors.h +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright (C) 1989, 1995, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: errors.h,v 1.2 2000/03/08 23:14:20 mike Exp $ */ -/* Definition of error codes */ - -#ifndef errors_INCLUDED -# define errors_INCLUDED - -/* - * A procedure that may return an error always returns - * a non-negative value (zero, unless otherwise noted) for success, - * or negative for failure. - * We use ints rather than an enum to avoid a lot of casting. - */ - -/* Define the error name table */ -extern const char *const gs_error_names[]; - - /* ------ PostScript Level 1 errors ------ */ - -#define e_unknownerror (-1) /* unknown error */ -#define e_dictfull (-2) -#define e_dictstackoverflow (-3) -#define e_dictstackunderflow (-4) -#define e_execstackoverflow (-5) -#define e_interrupt (-6) -/* We also need to define gs_error_interrupt, for gpcheck.h. */ -#undef gs_error_interrupt -#define gs_error_interrupt e_interrupt -#define e_invalidaccess (-7) -#define e_invalidexit (-8) -#define e_invalidfileaccess (-9) -#define e_invalidfont (-10) -#define e_invalidrestore (-11) -#define e_ioerror (-12) -#define e_limitcheck (-13) -#define e_nocurrentpoint (-14) -#define e_rangecheck (-15) -#define e_stackoverflow (-16) -#define e_stackunderflow (-17) -#define e_syntaxerror (-18) -#define e_timeout (-19) -#define e_typecheck (-20) -#define e_undefined (-21) -#define e_undefinedfilename (-22) -#define e_undefinedresult (-23) -#define e_unmatchedmark (-24) -#define e_VMerror (-25) - -#define LEVEL1_ERROR_NAMES\ - "unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\ - "execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\ - "invalidfileaccess", "invalidfont", "invalidrestore", "ioerror",\ - "limitcheck", "nocurrentpoint", "rangecheck", "stackoverflow",\ - "stackunderflow", "syntaxerror", "timeout", "typecheck", "undefined",\ - "undefinedfilename", "undefinedresult", "unmatchedmark", "VMerror" - - /* ------ Additional Level 2 and DPS errors ------ */ - -#define e_configurationerror (-26) -#define e_invalidcontext (-27) -#define e_undefinedresource (-28) -#define e_unregistered (-29) -/* invalidid is for the NeXT DPS extension. */ -#define e_invalidid (-30) - -#define LEVEL2_ERROR_NAMES\ - "configurationerror", "invalidcontext", "undefinedresource",\ - "unregistered", "invalidid" - -#define ERROR_NAMES LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES - - /* ------ Pseudo-errors used internally ------ */ - -/* - * Internal code for a fatal error. - * gs_interpret also returns this for a .quit with a positive exit code. - */ -#define e_Fatal (-100) - -/* - * Internal code for the .quit operator. - * The real quit code is an integer on the operand stack. - * gs_interpret returns this only for a .quit with a zero exit code. - */ -#define e_Quit (-101) - -/* - * Internal code for a normal exit from the interpreter. - * Do not use outside of interp.c. - */ -#define e_InterpreterExit (-102) - -/* - * Internal code that indicates that a procedure has been inserted - * on the e-stack at (former) esp+2, to be executed before retrying - * the current token. This is used for color remapping - * involving a call back into the interpreter -- inelegant, but effective. - */ -#define e_InsertProc (-103) - -/* - * Internal code to indicate we have underflowed the top block - * of the e-stack. - */ -#define e_ExecStackUnderflow (-104) - -/* - * Internal code for the vmreclaim operator with a positive operand. - * We need to handle this as an error because otherwise the interpreter - * won't reload enough of its state when the operator returns. - */ -#define e_VMreclaim (-105) - -/* - * Internal code for requesting more input from run_string. - */ -#define e_NeedInput (-106) - -/* - * Define which error codes require re-executing the current object. - */ -#define error_is_interrupt(ecode)\ - ((ecode) == e_interrupt || (ecode) == e_timeout) - -#endif /* errors_INCLUDED */ diff --git a/pstoraster/espgs.patch b/pstoraster/espgs.patch new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pstoraster/estack.h b/pstoraster/estack.h deleted file mode 100644 index 83642c7bc3..0000000000 --- a/pstoraster/estack.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (C) 1989, 1992, 1993, 1994, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: estack.h,v 1.2 2000/03/08 23:14:20 mike Exp $ */ -/* Definitions for the execution stack */ - -#ifndef estack_INCLUDED -# define estack_INCLUDED - -#include "iestack.h" - -/* There's only one exec stack right now.... */ -#define esfile (iexec_stack.current_file) -#define esfile_clear_cache() (esfile = 0) -#define esfile_set_cache(pref) (esfile = (pref)) -#define esfile_check_cache()\ - if ( r_has_type_attrs(esp, t_file, a_executable) )\ - esfile_set_cache(esp) - -/* Define the execution stack pointers. */ -extern exec_stack_t iexec_stack; - -#define e_stack (iexec_stack.stack) -#define esbot (e_stack.bot) -#define esp (e_stack.p) -#define estop (e_stack.top) - -/* - * The execution stack is used for three purposes: - * - * - Procedures being executed are held here. They always have - * type = t_array, t_mixedarray, or t_shortarray, with a_executable set. - * More specifically, the e-stack holds the as yet unexecuted tail of the - * procedure. - * - * - if, ifelse, etc. push arguments to be executed here. - * They may be any kind of object whatever. - * - * - Control operators (filenameforall, for, repeat, loop, forall, - * pathforall, run, stopped, ...) mark the stack by pushing whatever state - * they need to save or keep track of and then an object with type = t_null, - * attrs = a_executable, size = es_xxx (see below), and value.opproc = a - * cleanup procedure that will get called whenever the execution stack is - * about to get cut back beyond this point because of an error, stop, exit, - * or quit. (Executable null objects can't ever appear on the e-stack - * otherwise: if a control operator pushes one, it gets popped immediately.) - * The cleanup procedure is called with esp pointing just BELOW the mark, - * i.e., the mark has already been popped. - * - * The loop operators also push whatever state they need, - * followed by an operator object that handles continuing the loop. - * - * Note that there are many internal operators that need to be handled like - * looping operators -- for example, all the 'show' operators, since they - * may call out to BuildChar procedures. - */ - -/* Macro for marking the execution stack */ -#define make_mark_estack(ep, es_idx, proc)\ - make_tasv(ep, t_null, a_executable, es_idx, opproc, proc) -#define push_mark_estack(es_idx, proc)\ - (++esp, make_mark_estack(esp, es_idx, proc)) -#define r_is_estack_mark(ep)\ - r_has_type_attrs(ep, t_null, a_executable) -#define estack_mark_index(ep) r_size(ep) -#define set_estack_mark_index(ep, es_idx) r_set_size(ep, es_idx) - -/* Macro for pushing an operator on the execution stack */ -/* to represent a continuation procedure */ -#define make_op_estack(ep, proc)\ - make_oper(ep, 0, proc) -#define push_op_estack(proc)\ - (++esp, make_op_estack(esp, proc)) - -/* Macro to ensure enough room on the execution stack */ -#define check_estack(n)\ - if ( esp > estop - (n) )\ - { int es_code_ = ref_stack_extend(&e_stack, n);\ - if ( es_code_ < 0 ) return es_code_;\ - } - -/* Macro to ensure enough entries on the execution stack */ -#define check_esp(n)\ - if ( esp < esbot + ((n) - 1) )\ - { e_stack.requested = (n); return_error(e_ExecStackUnderflow); } - -/* Define the various kinds of execution stack marks. */ -#define es_other 0 /* internal use */ -#define es_show 1 /* show operators */ -#define es_for 2 /* iteration operators */ -#define es_stopped 3 /* stopped operator */ - -/* - * Pop a given number of elements off the execution stack, - * executing cleanup procedures as necessary. - */ -void pop_estack(P1(uint)); - -/* - * The execution stack is implemented as a linked list of blocks; - * operators that can push or pop an unbounded number of values, or that - * access the entire e-stack, must take this into account. These are: - * exit .stop .instopped countexecstack execstack currentfile - * .execn - * pop_estack(exit, stop, error recovery) - * gs_show_find(all the show operators) - * In addition, for e-stack entries created by control operators, we must - * ensure that the mark and its data are never separated. We do this - * by ensuring that when splitting the top block, at least N items - * are kept in the new top block above the bottommost retained mark, - * where N is the largest number of data items associated with a mark. - * Finally, in order to avoid specific checks for underflowing a block, - * we put a guard entry at the bottom of each block except the top one - * that contains a procedure that returns an internal "exec stack block - * underflow" error. - */ - -#endif /* estack_INCLUDED */ diff --git a/pstoraster/files.h b/pstoraster/files.h deleted file mode 100644 index 19f61f5cc2..0000000000 --- a/pstoraster/files.h +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: files.h,v 1.2 2000/03/08 23:14:20 mike Exp $ */ -/* Requires stream.h */ - -#ifndef files_INCLUDED -# define files_INCLUDED - -/* - * File objects store a pointer to a stream in value.pfile. - * A file object is valid if its "size" matches the read_id or write_id - * (as appropriate) in the stream it points to. This arrangement - * allows us to detect closed files reliably, while allowing us to - * reuse closed streams for new files. - */ -#define fptr(pref) (pref)->value.pfile -#define make_file(pref,a,id,s)\ - make_tasv(pref,t_file,a,id,pfile,s) - -/* The stdxxx files. We have to access them through procedures, */ -/* because they might have to be opened when referenced. */ -int zget_stdin(P1(stream **)); -int zget_stdout(P1(stream **)); -int zget_stderr(P1(stream **)); -extern bool gs_stdin_is_interactive; - -/* Export the stdio refs for switching contexts. */ -extern ref ref_stdio[3]; - -#define ref_stdin ref_stdio[0] -#define ref_stdout ref_stdio[1] -#define ref_stderr ref_stdio[2] -/* An invalid (closed) file. */ -extern stream *invalid_file_entry; - -/* - * Macros for checking file validity. - * NOTE: in order to work around a bug in the Borland 5.0 compiler, - * you must use file_is_invalid rather than !file_is_valid. - */ -#define file_is_valid(svar,op)\ - (svar = fptr(op), (svar->read_id | svar->write_id) == r_size(op)) -#define file_is_invalid(svar,op)\ - (svar = fptr(op), (svar->read_id | svar->write_id) != r_size(op)) -#define check_file(svar,op)\ - BEGIN\ - check_type(*(op), t_file);\ - if ( file_is_invalid(svar, op) ) return_error(e_invalidaccess);\ - END - -/* - * If a file is open for both reading and writing, its read_id, write_id, - * and stream procedures and modes reflect the current mode of use; - * an id check failure will switch it to the other mode. - */ -int file_switch_to_read(P1(const ref *)); - -#define check_read_file(svar,op)\ - BEGIN\ - check_read_type(*(op), t_file);\ - check_read_known_file(svar, op, return);\ - END -#define check_read_known_file(svar,op,error_return)\ - check_read_known_file_else(svar, op, error_return, svar = invalid_file_entry) -/* The do... avoids problems with a possible enclosed 'if'. */ -#define check_read_known_file_else(svar,op,error_return,invalid_action)\ - BEGIN\ - svar = fptr(op);\ - if ( svar->read_id != r_size(op) )\ - { if ( svar->read_id == 0 && svar->write_id == r_size(op) )\ - { int fcode = file_switch_to_read(op);\ - if ( fcode < 0 ) error_return(fcode);\ - }\ - else BEGIN invalid_action; END; /* closed or reopened file */\ - }\ - END -int file_switch_to_write(P1(const ref *)); - -#define check_write_file(svar,op)\ - BEGIN\ - check_write_type(*(op), t_file);\ - check_write_known_file(svar, op, return);\ - END -#define check_write_known_file(svar,op,error_return)\ - BEGIN\ - svar = fptr(op);\ - if ( svar->write_id != r_size(op) )\ - { int fcode = file_switch_to_write(op);\ - if ( fcode < 0 ) error_return(fcode);\ - }\ - END - -/* Data exported by zfile.c. */ - /* for zfilter.c and ziodev.c */ -extern const uint file_default_buffer_size; - -/* Procedures exported by zfile.c. */ - /* for imainarg.c */ -FILE *lib_fopen(P1(const char *)); - - /* for imain.c */ -int lib_file_open(P6(const char *, uint, byte *, uint, uint *, ref *)); - - /* for iccinit.c */ -int file_read_string(P3(const byte *, uint, ref *)); - - /* for os_open in ziodev.c */ -#ifdef iodev_proc_fopen /* in gxiodev.h */ -int file_open_stream(P6(const char *, uint, const char *, uint, - stream **, iodev_proc_fopen_t)); - -#endif - /* for zfilter.c */ -int filter_open(P6(const char *, uint, ref *, const stream_procs *, - const stream_template *, const stream_state *)); - - /* for zfileio.c */ -void make_stream_file(P3(ref *, stream *, const char *)); - - /* for ziodev.c */ -int file_close_finish(P1(stream *)); -int file_close_disable(P1(stream *)); -int file_close_file(P1(stream *)); - - /* for gsmain.c, interp.c */ -int file_close(P1(ref *)); - - /* for zfproc.c, ziodev.c */ -stream *file_alloc_stream(P2(gs_memory_t *, client_name_t)); - -/* Procedures exported by zfileio.c. */ - /* for ziodev.c */ -int zreadline_from(P5(stream *, byte *, uint, uint *, bool *)); - -#endif /* files_INCLUDED */ diff --git a/pstoraster/fname.h b/pstoraster/fname.h deleted file mode 100644 index 7acfa44e57..0000000000 --- a/pstoraster/fname.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 1993, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: fname.h,v 1.2 2000/03/08 23:14:21 mike Exp $ */ -/* Requires gxiodev.h */ - -#ifndef fname_INCLUDED -# define fname_INCLUDED - -/* - * Define a structure for representing a parsed file name, consisting of - * an IODevice name in %'s, a file name, or both. Note that the file name - * may be either a gs_string (no terminator) or a C string (null terminator). - */ -typedef struct parsed_file_name_s { - gx_io_device *iodev; - const char *fname; - uint len; -} parsed_file_name; - -/* Parse a file name into device and individual name. */ -int parse_file_name(P2(const ref *, parsed_file_name *)); - -/* Parse a real (non-device) file name and convert to a C string. */ -int parse_real_file_name(P3(const ref *, parsed_file_name *, client_name_t)); - -/* Convert a file name to a C string by adding a null terminator. */ -int terminate_file_name(P2(parsed_file_name *, client_name_t)); - -/* Free a file name that was copied to a C string. */ -void free_file_name(P2(parsed_file_name *, client_name_t)); - -#endif /* fname_INCLUDED */ diff --git a/pstoraster/gconf.h b/pstoraster/gconf.h deleted file mode 100644 index a90babdbe2..0000000000 --- a/pstoraster/gconf.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gconf.h,v 1.1 2000/03/13 18:57:14 mike Exp $ */ -/* Wrapper for gconfig.h or a substitute. */ - -/* - * NOTA BENE: This file, unlike all other header files, must *not* have - * double-inclusion protection, since it is used in peculiar ways. - */ - -/* - * Since not all C preprocessors implement #include with a non-quoted - * argument, we arrange things so that we can still compile with such - * compilers as long as GCONFIG_H isn't defined. - */ - -#ifndef GCONFIG_H -# include "gconfig.h" -#else -# include GCONFIG_H -#endif diff --git a/pstoraster/gconfig.c b/pstoraster/gconfig.c deleted file mode 100644 index 265fd82600..0000000000 --- a/pstoraster/gconfig.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gconfig.c,v 1.1 2000/03/08 23:14:21 mike Exp $ */ -/* Configuration tables */ -#include "memory_.h" -#include "gx.h" -#include "gscdefs.h" /* interface */ -#include "gconf.h" /* for #defines */ -#include "gxdevice.h" -#include "gxiodev.h" - -/* - * The makefile generates the file gconfig.h, which consists of - * lines of the form - * device_(gs_xxx_device) - * or - * device2_(gs_xxx_device) - * for each installed device; - * emulator_("emulator", strlen("emulator")) - * for each known emulator; - * init_(gs_xxx_init) - * for each initialization procedure; - * io_device_(gs_iodev_xxx) - * for each known IODevice; - * oper_(xxx_op_defs) - * for each operator option; - * psfile_("gs_xxxx.ps", strlen("gs_xxxx.ps")) - * for each optional initialization file. - * - * We include this file multiple times to generate various different - * source structures. (It's a hack, but we haven't come up with anything - * more satisfactory.) - */ - -/* ---------------- Resources (devices, inits, IODevices) ---------------- */ - -/* Declare devices, init procedures, and IODevices as extern. */ -#define device_(dev) extern far_data gx_device dev; -#define device2_(dev) extern const gx_device dev; -#define init_(proc) extern void proc(P1(gs_memory_t *)); -#define io_device_(iodev) extern const gx_io_device iodev; -#include "gconf.h" -#undef init_ -#undef io_device_ -#undef device2_ -#undef device_ - -/* Set up the initialization procedure table. */ -extern_gx_init_table(); -private void gconf_init(P1(gs_memory_t *)); -#define init_(proc) proc, -const gx_init_proc gx_init_table[] = { -#include "gconf.h" - gconf_init, - 0 -}; -#undef init_ - -/* Set up the IODevice table. The first entry must be %os%, */ -/* since it is the default for files with no explicit device specified. */ -extern_gx_io_device_table(); -extern gx_io_device gs_iodev_os; -#define io_device_(iodev) &iodev, -const gx_io_device *const gx_io_device_table[] = { - &gs_iodev_os, -#include "gconf.h" - 0 -}; -#undef io_device_ -const uint gx_io_device_table_count = countof(gx_io_device_table) - 1; - -/* Set up the device table. */ -#define device_(dev) (const gx_device *)&dev, -#define device2_(dev) &dev, -private const gx_device *const gx_device_list[] = { -#include "gconf.h" - 0 -}; -#undef device2_ -#undef device_ - -/* Allocate and initialize structure descriptors for the devices. */ -private gs_memory_struct_type_t gx_device_st_list[countof(gx_device_list) - 1]; -private void -gconf_init(gs_memory_t *mem) -{ - int i; - - for (i = 0; i < countof(gx_device_list) - 1; ++i) - gx_device_make_struct_type(&gx_device_st_list[i], gx_device_list[i]); -} - -/* Return the list of device prototypes, the list of their structure */ -/* descriptors, and (as the value) the length of the lists. */ -extern_gs_lib_device_list(); -int -gs_lib_device_list(const gx_device * const **plist, - gs_memory_struct_type_t ** pst) -{ - if (plist != 0) - *plist = gx_device_list; - if (pst != 0) - *pst = gx_device_st_list; - return countof(gx_device_list) - 1; -} diff --git a/pstoraster/gconfig.h b/pstoraster/gconfig.h deleted file mode 100644 index 15a4e77dc1..0000000000 --- a/pstoraster/gconfig.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * "$Id: gconfig.h,v 1.11 2001/01/22 15:03:54 mike Exp $" - * - * GNU GhostScript configuration file for the Common UNIX Printing - * System (CUPS). - * - * This file is normally generated by a lot of echogs and genconf - * commands... - * - * Copyright 1997-2001 by Easy Software Products. - * - * These coded instructions, statements, and computer programs are the - * property of Easy Software Products and are protected by Federal - * copyright law. Distribution and use rights are outlined in the file - * "LICENSE.txt" which should have been included with this file. If this - * file is missing or damaged please contact Easy Software Products - * at: - * - * Attn: CUPS Licensing Information - * Easy Software Products - * 44141 Airport View Drive, Suite 204 - * Hollywood, Maryland 20636-3111 USA - * - * Voice: (301) 373-9603 - * EMail: cups-info@cups.org - * WWW: http://www.cups.org - */ - -#include - -#ifdef device2_ -device2_(gs_cups_device) -device2_(gs_bbox_device) -/*device2_(gs_nullpage_device)*/ -#endif -#ifdef oper_ -oper_(zchar1_op_defs) -oper_(zfont1_op_defs) -oper_(zmisc1_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_type1.ps",11) -#endif -#ifdef oper_ -oper_(zvmem2_op_defs) -oper_(zdps1_l2_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_dps1.ps",10) -#endif -#ifdef oper_ -oper_(zusparam_op_defs) -oper_(zmisc2_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_lev2.ps",10) -psfile_("gs_res.ps",9) -#endif -#ifdef oper_ -oper_(zchar42_op_defs) -oper_(zfont42_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_typ42.ps",11) -psfile_("gs_cidfn.ps",11) -#endif -#ifdef oper_ -oper_(zcid_op_defs) -oper_(zcie_l2_op_defs) -oper_(zcrd_l2_op_defs) -oper_(zfcmap_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_cmap.ps",10) -#endif -#ifdef oper_ -oper_(zcfont_op_defs) -oper_(zfont0_op_defs) -# ifdef HAVE_LIBJPEG -oper_(zfdcte_op_defs) -oper_(zfdctd_op_defs) -# endif /* HAVE_LIBJPEG */ -oper_(zbseq_l2_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_btokn.ps",11) -#endif -#ifdef init_ -init_(gs_gxicolor_init) -#endif -#ifdef oper_ -oper_(zcolor1_op_defs) -oper_(zht1_op_defs) -oper_(zupath_l2_op_defs) -oper_(ireclaim_l2_op_defs) -oper_(zchar2_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_dps2.ps",10) -#endif -#ifdef oper_ -oper_(zfdecode_op_defs) -oper_(zfilter2_op_defs) -oper_(ziodev2_l2_op_defs) -#endif -#ifdef io_device_ -io_device_(gs_iodev_null) -io_device_(gs_iodev_ram) -io_device_(gs_iodev_calendar) -#endif -#ifdef oper_ -oper_(zdevice2_l2_op_defs) -oper_(zmedia2_l2_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_setpd.ps",11) -#endif -#ifdef oper_ -oper_(zpcolor_l2_op_defs) -oper_(zarith_op_defs) -oper_(zarray_op_defs) -oper_(zcontrol_op_defs) -oper_(zdict_op_defs) -oper_(zfile_op_defs) -oper_(zfileio_op_defs) -oper_(zfilter_op_defs) -oper_(zfproc_op_defs) -oper_(zgeneric_op_defs) -oper_(ziodev_op_defs) -oper_(zmath_op_defs) -oper_(zmisc_op_defs) -oper_(zpacked_op_defs) -oper_(zrelbit_op_defs) -oper_(zstack_op_defs) -oper_(zstring_op_defs) -oper_(zsysvm_op_defs) -oper_(ztoken_op_defs) -oper_(ztype_op_defs) -oper_(zvmem_op_defs) -oper_(zchar_op_defs) -oper_(zcolor_op_defs) -oper_(zdevice_op_defs) -oper_(zfont_op_defs) -oper_(zfont2_op_defs) -oper_(zgstate_op_defs) -oper_(zht_op_defs) -oper_(zimage_op_defs) -oper_(zmatrix_op_defs) -oper_(zpaint_op_defs) -oper_(zpath_op_defs) -#endif -#ifdef io_device_ -io_device_(gs_iodev_stdin) -io_device_(gs_iodev_stdout) -io_device_(gs_iodev_stderr) -io_device_(gs_iodev_lineedit) -io_device_(gs_iodev_statementedit) -#endif -#ifdef oper_ -oper_(zfbcp_op_defs) -oper_(zhsb_op_defs) -oper_(zpath1_op_defs) -#endif -#ifdef init_ -init_(gs_gstype1_init) -#endif -#ifdef emulator_ -emulator_("PostScript",10) -emulator_("PostScriptLevel1",16) -#endif -#ifdef init_ -init_(gs_gxi12bit_init) -init_(gs_gxiscale_init) -#endif -#ifdef oper_ -oper_(zcolor2_l2_op_defs) -oper_(zcsindex_l2_op_defs) -oper_(zht2_l2_op_defs) -oper_(zimage2_l2_op_defs) -oper_(zcssepr_l2_op_defs) -oper_(zchar32_op_defs) -oper_(zfont32_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_typ32.ps",11) -#endif -#ifdef oper_ -oper_(zfilterx_op_defs) -#endif -#ifdef emulator_ -emulator_("PostScriptLevel2",16) -#endif -#ifdef oper_ -oper_(zcspixel_op_defs) -oper_(zfunc_op_defs) -oper_(zfunc0_op_defs) -oper_(zcsdevn_op_defs) -oper_(zfreuse_op_defs) -oper_(zfunc3_op_defs) -oper_(zimage3_op_defs) -oper_(zmisc3_op_defs) -oper_(zshade_op_defs) -oper_(ztrap_op_defs) -#endif -#ifdef psfile_ -psfile_("gs_ll3.ps",9) -#endif -#ifdef oper_ -# ifdef HAVE_LIBZ -oper_(zfzlib_op_defs) -# endif /* HAVE_LIBZ */ -#endif -#ifdef psfile_ -psfile_("gs_mex_e.ps",11) -psfile_("gs_mro_e.ps",11) -psfile_("gs_wan_e.ps",11) -psfile_("gs_cff.ps",9) -psfile_("gs_ttf.ps",9) -#endif -#ifdef init_ -init_(gs_gstype2_init) -#endif -#ifdef io_device_ -io_device_(gs_iodev_pipe) -#endif -#ifdef psfile_ -psfile_("gs_epsf.ps",10) -#endif -#ifdef init_ -# ifdef HAVE_LIBZ -init_(gs_cl_zlib_init) -# endif /* HAVE_LIBZ */ -init_(gs_gshtscr_init) -init_(gs_gsutil_init) -init_(gs_gxcht_init) -init_(gs_gxifast_init) -init_(gs_gximono_init) -#endif -#define SEARCH_HERE_FIRST 1 - -/* - * End of "$Id: gconfig.h,v 1.11 2001/01/22 15:03:54 mike Exp $". - */ diff --git a/pstoraster/gconfig_.h b/pstoraster/gconfig_.h deleted file mode 100644 index 518b790206..0000000000 --- a/pstoraster/gconfig_.h +++ /dev/null @@ -1,5 +0,0 @@ -/* This file was generated automatically. */ -#define HAVE_DIRENT_H -#define HAVE_SYS_DIR_H -#define HAVE_SYS_TIME_H -#define HAVE_SYS_TIMES_H diff --git a/pstoraster/gconfigv.h b/pstoraster/gconfigv.h deleted file mode 100644 index a9ae98b88b..0000000000 --- a/pstoraster/gconfigv.h +++ /dev/null @@ -1,4 +0,0 @@ -#define USE_ASM (-0) -#define USE_FPU (1-0) -#define EXTEND_NAMES 0 -#define SYSTEM_CONSTANTS_ARE_WRITABLE 0 diff --git a/pstoraster/gdebug.h b/pstoraster/gdebug.h deleted file mode 100644 index 3ca0c3fba4..0000000000 --- a/pstoraster/gdebug.h +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdebug.h,v 1.2 2000/03/08 23:14:21 mike Exp $ */ -/* Debugging machinery definitions */ - -#ifndef gdebug_INCLUDED -# define gdebug_INCLUDED - -/* - * The compile-time DEBUG symbol determines whether debugging/tracing - * code is included in the compiled code. DEBUG may be set or not set - * independently for every compilation; however, a small amount of support - * machinery in gsmisc.c is always included in the executable, just - * in case *some* file was compiled with DEBUG set. - * - * When DEBUG is set, it does not cause debugging/tracing printout to occur. - * Rather, it includes code that produces such printout *if* (a) given - * one(s) of 128 debugging flags is set. In this way, one can selectively - * turn printout on and off during debugging. (In fact, we even provide a - * PostScript operator, .setdebug, that does this.) - * - * The debugging flags are normally indexed by character code. This is more - * than a convention: gs_debug_c, which tests whether a given flag is set, - * considers that if a flag named by a given upper-case letter is set, the - * flag named by the corresponding lower-case letter is also set. - * - * If the output selected by a given flag can be printed by a single - * printf, the conventional way to produce the output is - * if_debugN('x', "...format...", v1, ..., vN); - * Usually the flag appears in the output explicitly: - * if_debugN('x', "[x]...format...", v1, ..., vN); - * If the output is more complex, the conventional way to produce the - * output is - * if ( gs_debug_c('x') ) { - * ... start each line with dlprintfN(...) - * ... produce additional output within a line with dprintfN(...) - * } */ - -/* Define the array of debugging flags, indexed by character code. */ -extern char gs_debug[128]; -bool gs_debug_c(P1(int /*char */ )); - -/* - * Define an alias for a specialized debugging flag - * that used to be a separate variable. - */ -#define gs_log_errors gs_debug['#'] - -/* If debugging, direct all error output to gs_debug_out. */ -extern FILE *gs_debug_out; - -#ifdef DEBUG -#undef dstderr -#define dstderr gs_debug_out -#undef estderr -#define estderr gs_debug_out -#endif - -/* Debugging printout macros. */ -#ifdef DEBUG -# define if_debug0(c,s)\ - BEGIN if (gs_debug_c(c)) dlprintf(s); END -# define if_debug1(c,s,a1)\ - BEGIN if (gs_debug_c(c)) dlprintf1(s,a1); END -# define if_debug2(c,s,a1,a2)\ - BEGIN if (gs_debug_c(c)) dlprintf2(s,a1,a2); END -# define if_debug3(c,s,a1,a2,a3)\ - BEGIN if (gs_debug_c(c)) dlprintf3(s,a1,a2,a3); END -# define if_debug4(c,s,a1,a2,a3,a4)\ - BEGIN if (gs_debug_c(c)) dlprintf4(s,a1,a2,a3,a4); END -# define if_debug5(c,s,a1,a2,a3,a4,a5)\ - BEGIN if (gs_debug_c(c)) dlprintf5(s,a1,a2,a3,a4,a5); END -# define if_debug6(c,s,a1,a2,a3,a4,a5,a6)\ - BEGIN if (gs_debug_c(c)) dlprintf6(s,a1,a2,a3,a4,a5,a6); END -# define if_debug7(c,s,a1,a2,a3,a4,a5,a6,a7)\ - BEGIN if (gs_debug_c(c)) dlprintf7(s,a1,a2,a3,a4,a5,a6,a7); END -# define if_debug8(c,s,a1,a2,a3,a4,a5,a6,a7,a8)\ - BEGIN if (gs_debug_c(c)) dlprintf8(s,a1,a2,a3,a4,a5,a6,a7,a8); END -# define if_debug9(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9)\ - BEGIN if (gs_debug_c(c)) dlprintf9(s,a1,a2,a3,a4,a5,a6,a7,a8,a9); END -# define if_debug10(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)\ - BEGIN if (gs_debug_c(c)) dlprintf10(s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); END -# define if_debug11(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)\ - BEGIN if (gs_debug_c(c)) dlprintf11(s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11); END -# define if_debug12(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)\ - BEGIN if (gs_debug_c(c)) dlprintf12(s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12); END -#else -# define if_debug0(c,s) DO_NOTHING -# define if_debug1(c,s,a1) DO_NOTHING -# define if_debug2(c,s,a1,a2) DO_NOTHING -# define if_debug3(c,s,a1,a2,a3) DO_NOTHING -# define if_debug4(c,s,a1,a2,a3,a4) DO_NOTHING -# define if_debug5(c,s,a1,a2,a3,a4,a5) DO_NOTHING -# define if_debug6(c,s,a1,a2,a3,a4,a5,a6) DO_NOTHING -# define if_debug7(c,s,a1,a2,a3,a4,a5,a6,a7) DO_NOTHING -# define if_debug8(c,s,a1,a2,a3,a4,a5,a6,a7,a8) DO_NOTHING -# define if_debug9(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9) DO_NOTHING -# define if_debug10(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) DO_NOTHING -# define if_debug11(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) DO_NOTHING -# define if_debug12(c,s,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) DO_NOTHING -#endif - -/* Debugging support procedures in gsmisc.c */ -void debug_dump_bytes(P3(const byte * from, const byte * to, - const char *msg)); -void debug_dump_bitmap(P4(const byte * from, uint raster, uint height, - const char *msg)); -void debug_print_string(P2(const byte * str, uint len)); - -#endif /* gdebug_INCLUDED */ diff --git a/pstoraster/gdev8bcm.h b/pstoraster/gdev8bcm.h deleted file mode 100644 index 7e5c6d9e5a..0000000000 --- a/pstoraster/gdev8bcm.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 1994 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdev8bcm.h,v 1.3 2000/03/13 19:00:46 mike Exp $ */ -/* Requires gxdevice.h (for gx_color_value) */ - -#ifndef gdev8bcm_INCLUDED -# define gdev8bcm_INCLUDED - -/* - * The MS-DOS, MS Windows, and X Windows drivers all use (at least on - * some platforms) an 8-bit color map in which some fraction is reserved - * for a pre-allocated cube and some or all of the remainder is - * allocated dynamically. Since looking up colors in this map can be - * a major performance bottleneck, we provide an efficient implementation - * that can be shared among drivers. - * - * As a performance compromise, we only look up the top 5 bits of the - * RGB value in the color map. This compromises color quality very little, - * and allows substantial optimizations. - */ - -#define gx_8bit_map_size 323 -#define gx_8bit_map_spreader 123 /* approx. 323 - (1.618 * 323) */ -typedef struct gx_8bit_map_entry_s { - ushort rgb; /* key = 0rrrrrgggggbbbbb */ -#define gx_8bit_no_rgb ((ushort)0xffff) -#define gx_8bit_rgb_key(r, g, b)\ - (((r >> (gx_color_value_bits - 5)) << 10) +\ - ((g >> (gx_color_value_bits - 5)) << 5) +\ - (b >> (gx_color_value_bits - 5))) - short index; /* value */ -} gx_8bit_map_entry; -typedef struct gx_8bit_color_map_s { - int count; /* # of occupied entries */ - int max_count; /* max # of occupied entries */ - gx_8bit_map_entry map[gx_8bit_map_size + 1]; -} gx_8bit_color_map; - -/* Initialize an 8-bit color map. */ -void gx_8bit_map_init(P2(gx_8bit_color_map *, int)); - -/* Look up a color in an 8-bit color map. */ -/* Return -1 if not found. */ -int gx_8bit_map_rgb_color(P4(const gx_8bit_color_map *, gx_color_value, - gx_color_value, gx_color_value)); - -/* Test whether an 8-bit color map has room for more entries. */ -#define gx_8bit_map_is_full(pcm)\ - ((pcm)->count == (pcm)->max_count) - -/* Add a color to an 8-bit color map. */ -/* Return -1 if the map is full. */ -int gx_8bit_add_rgb_color(P4(gx_8bit_color_map *, gx_color_value, - gx_color_value, gx_color_value)); - -#endif /* gdev8bcm_INCLUDED */ diff --git a/pstoraster/gdevabuf.c b/pstoraster/gdevabuf.c deleted file mode 100644 index 325f719b6a..0000000000 --- a/pstoraster/gdevabuf.c +++ /dev/null @@ -1,404 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevabuf.c,v 1.2 2000/03/08 23:14:21 mike Exp $ */ -/* Alpha-buffering memory devices */ -#include "memory_.h" -#include "gx.h" -#include "gserrors.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -/* ================ Alpha devices ================ */ - -/* - * These devices store 2 or 4 bits of alpha. They are a hybrid of a - * monobit device (for color mapping) and a 2- or 4-bit device (for painting). - * Currently, we only use them for character rasterizing, but they might be - * useful for other things someday. - */ - -/* We can't initialize the device descriptor statically very well, */ -/* so we patch up the image2 or image4 descriptor. */ -private dev_proc_map_rgb_color(mem_alpha_map_rgb_color); -private dev_proc_map_color_rgb(mem_alpha_map_color_rgb); -private dev_proc_map_rgb_alpha_color(mem_alpha_map_rgb_alpha_color); -private dev_proc_get_alpha_bits(mem_alpha_get_alpha_bits); -private dev_proc_copy_alpha(mem_alpha_copy_alpha); - -void -gs_make_mem_alpha_device(gx_device_memory * adev, gs_memory_t * mem, - gx_device * target, int alpha_bits) -{ - gs_make_mem_device(adev, gdev_mem_device_for_bits(alpha_bits), - mem, 0, target); - /* This is a black-and-white device ... */ - adev->color_info = gdev_mem_device_for_bits(1)->color_info; - /* ... but it has multiple bits per pixel ... */ - adev->color_info.depth = alpha_bits; - /* ... and different color mapping. */ - set_dev_proc(adev, map_rgb_color, mem_alpha_map_rgb_color); - set_dev_proc(adev, map_color_rgb, mem_alpha_map_color_rgb); - set_dev_proc(adev, map_rgb_alpha_color, mem_alpha_map_rgb_alpha_color); - set_dev_proc(adev, get_alpha_bits, mem_alpha_get_alpha_bits); - set_dev_proc(adev, copy_alpha, mem_alpha_copy_alpha); -} - -/* Reimplement color mapping. */ -private gx_color_index -mem_alpha_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - gx_color_index color = gx_forward_map_rgb_color(dev, r, g, b); - - return (color == 0 || color == gx_no_color_index ? color : - (gx_color_index) ((1 << mdev->log2_alpha_bits) - 1)); -} -private int -mem_alpha_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - return - gx_forward_map_color_rgb(dev, - (color == 0 ? color : (gx_color_index) 1), - prgb); -} -private gx_color_index -mem_alpha_map_rgb_alpha_color(gx_device * dev, gx_color_value r, - gx_color_value g, gx_color_value b, gx_color_value alpha) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - gx_color_index color = gx_forward_map_rgb_color(dev, r, g, b); - - return (color == 0 || color == gx_no_color_index ? color : - (gx_color_index) (alpha >> (gx_color_value_bits - - mdev->log2_alpha_bits))); -} -private int -mem_alpha_get_alpha_bits(gx_device * dev, graphics_object_type type) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - return 1 << mdev->log2_alpha_bits; -} -/* Implement alpha copying. */ -private int -mem_alpha_copy_alpha(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int width, int height, - gx_color_index color, int depth) -{ /* Just use copy_color. */ - return (color == 0 ? - (*dev_proc(dev, fill_rectangle)) (dev, x, y, width, height, - color) : - (*dev_proc(dev, copy_color)) (dev, data, data_x, raster, id, - x, y, width, height)); -} - -/* ================ Alpha-buffer device ================ */ - -/* - * This device converts graphics sampled at a higher resolution to - * alpha values at a lower resolution. It does this by accumulating - * the bits of a band and then converting the band to alphas. - * In order to make this work, the client of the device must promise - * only to visit each band at most once, except possibly for a single - * scan line overlapping the adjacent band, and must promise only to write - * a single color into the output. In particular, this works - * within a single call on gx_fill_path (if the fill loop is constrained - * to process bands of limited height on each pass) or a single masked image - * scanned in Y order, but not across such calls and not for other - * kinds of painting operations. - * - * We implement this device as a subclass of a monobit memory device. - * (We put its state in the definition of gx_device_memory just because - * actual subclassing introduces a lot of needless boilerplate.) - * We only allocate enough bits for one band. The height of the band - * must be a multiple of the Y scale factor; the minimum height - * of the band is twice the Y scale factor. - * - * The bits in storage are actually a sliding window on the true - * oversampled image. To avoid having to copy the bits around when we - * move the window, we adjust the mapping between the client's Y values - * and our own, as follows: - * Client Stored - * ------ ------ - * y0..y0+m-1 n-m..n-1 - * y0+m..y0+n-1 0..n-m-1 - * where n and m are multiples of the Y scale factor and 0 <= m <= n <= - * the height of the band. (In the device structure, m is called - * mapped_start and n is called mapped_height.) This allows us to slide - * the window incrementally in either direction without copying any bits. - */ - -/* Procedures */ -private dev_proc_close_device(mem_abuf_close); -private dev_proc_copy_mono(mem_abuf_copy_mono); -private dev_proc_fill_rectangle(mem_abuf_fill_rectangle); -private dev_proc_get_clipping_box(mem_abuf_get_clipping_box); - -/* The device descriptor. */ -private const gx_device_memory mem_alpha_buffer_device = -mem_device("image(alpha buffer)", 0, 1, - gx_forward_map_rgb_color, gx_forward_map_color_rgb, - mem_abuf_copy_mono, gx_default_copy_color, mem_abuf_fill_rectangle, - gx_no_strip_copy_rop); - -/* Make an alpha-buffer memory device. */ -/* We use abuf instead of alpha_buffer because */ -/* gcc under VMS only retains 23 characters of procedure names. */ -void -gs_make_mem_abuf_device(gx_device_memory * adev, gs_memory_t * mem, - gx_device * target, const gs_log2_scale_point * pscale, - int alpha_bits, int mapped_x) -{ - gs_make_mem_device(adev, &mem_alpha_buffer_device, mem, 0, target); - adev->max_fill_band = 1 << pscale->y; - adev->log2_scale = *pscale; - adev->log2_alpha_bits = alpha_bits >> 1; /* works for 1,2,4 */ - adev->mapped_x = mapped_x; - set_dev_proc(adev, close_device, mem_abuf_close); - set_dev_proc(adev, get_clipping_box, mem_abuf_get_clipping_box); -} - -/* Test whether a device is an alpha-buffering device. */ -bool -gs_device_is_abuf(const gx_device * dev) -{ /* We can't just compare the procs, or even an individual proc, */ - /* because we might be tracing. Instead, check the identity of */ - /* the device name. */ - return dev->dname == mem_alpha_buffer_device.dname; -} - -/* Internal routine to flush a block of the buffer. */ -/* A block is a group of scan lines whose initial Y is a multiple */ -/* of the Y scale and whose height is equal to the Y scale. */ -private int -abuf_flush_block(gx_device_memory * adev, int y) -{ - gx_device *target = adev->target; - int block_height = 1 << adev->log2_scale.y; - int alpha_bits = 1 << adev->log2_alpha_bits; - int ddepth = - (adev->width >> adev->log2_scale.x) << adev->log2_alpha_bits; - uint draster = bitmap_raster(ddepth); - int buffer_y = y - adev->mapped_y + adev->mapped_start; - byte *bits; - - if (buffer_y >= adev->height) - buffer_y -= adev->height; - bits = scan_line_base(adev, buffer_y); - { /* - * Many bits are typically zero. Save time by computing - * an accurate X bounding box before compressing. - * Unfortunately, in order to deal with alpha nibble swapping - * (see gsbitops.c), we can't expand the box only to pixel - * boundaries: - int alpha_mask = -1 << adev->log2_alpha_bits; - * Instead, we must expand it to byte boundaries, - */ - int alpha_mask = ~7; - gs_int_rect bbox; - int width; - - bits_bounding_box(bits, block_height, adev->raster, &bbox); - bbox.p.x &= alpha_mask; - bbox.q.x = (bbox.q.x + ~alpha_mask) & alpha_mask; - width = bbox.q.x - bbox.p.x; - bits_compress_scaled(bits, bbox.p.x, width, block_height, - adev->raster, bits, draster, &adev->log2_scale, - adev->log2_alpha_bits); - return (*dev_proc(target, copy_alpha)) (target, - bits, 0, draster, gx_no_bitmap_id, - (adev->mapped_x + bbox.p.x) >> - adev->log2_scale.x, - y >> adev->log2_scale.y, - width >> adev->log2_scale.x, 1, - adev->save_color, alpha_bits); - } -} -/* Flush the entire buffer. */ -private int -abuf_flush(gx_device_memory * adev) -{ - int y, code = 0; - int block_height = 1 << adev->log2_scale.y; - - for (y = 0; y < adev->mapped_height; y += block_height) - if ((code = abuf_flush_block(adev, adev->mapped_y + y)) < 0) - return code; - adev->mapped_height = adev->mapped_start = 0; - return 0; -} - -/* Close the device, flushing the buffer. */ -private int -mem_abuf_close(gx_device * dev) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - int code = abuf_flush(mdev); - - if (code < 0) - return code; - return mem_close(dev); -} - -/* - * Framework for mapping a requested imaging operation to the buffer. - * For now, we assume top-to-bottom transfers and use a very simple algorithm. - */ -typedef struct y_transfer_s { - int y_next; - int height_left; - int transfer_y; - int transfer_height; -} y_transfer; -private void near -y_transfer_init(y_transfer * pyt, gx_device * dev, int ty, int th) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - int bh = 1 << mdev->log2_scale.y; - - if (ty < mdev->mapped_y || ty > mdev->mapped_y + mdev->mapped_height) { - abuf_flush(mdev); - mdev->mapped_y = ty & -bh; - mdev->mapped_height = bh; - memset(scan_line_base(mdev, 0), 0, bh * mdev->raster); - } - pyt->y_next = ty; - pyt->height_left = th; - pyt->transfer_height = 0; -} -/* while ( yt.height_left > 0 ) { y_transfer_next(&yt, mdev); ... } */ -private void near -y_transfer_next(y_transfer * pyt, gx_device * dev) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - int my = mdev->mapped_y, mh = mdev->mapped_height; - int ms = mdev->mapped_start; - int ty = pyt->y_next += pyt->transfer_height; - int th = pyt->height_left; - int bh = 1 << mdev->log2_scale.y; - - /* From here on, we know that my <= ty <= my + mh. */ - int tby, tbh; - - if (ty == my + mh) { /* Add a new block at my1. */ - if (mh == mdev->height) { - abuf_flush_block(mdev, my); - mdev->mapped_y = my += bh; - if ((mdev->mapped_start = ms += bh) == mh) - mdev->mapped_start = ms = 0; - } else { /* Because we currently never extend backwards, */ - /* we know we can't wrap around in this case. */ - mdev->mapped_height = mh += bh; - } - memset(scan_line_base(mdev, (ms == 0 ? mh : ms) - bh), - 0, bh * mdev->raster); - } - /* Now we know that my <= ty < my + mh. */ - tby = ty - my + ms; - if (tby < mdev->height) { - tbh = mdev->height - ms; - if (tbh > mh) - tbh = mh; - tbh -= tby - ms; - } else { /* wrap around */ - tby -= mdev->height; - tbh = ms + mh - dev->height - tby; - } - if_debug7('v', "[v]my=%d, mh=%d, ms=%d, ty=%d, th=%d, tby=%d, tbh=%d\n", - my, mh, ms, ty, th, tby, tbh); - if (tbh > th) - tbh = th; - pyt->height_left = th - tbh; - pyt->transfer_y = tby; - pyt->transfer_height = tbh; -} - -/* Copy a monobit image. */ -private int -mem_abuf_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - y_transfer yt; - - if (zero != gx_no_color_index || one == gx_no_color_index) - return_error(gs_error_undefinedresult); - x -= mdev->mapped_x; - fit_copy_xyw(dev, base, sourcex, sraster, id, x, y, w, h); /* don't limit h */ - if (w <= 0 || h <= 0) - return 0; - mdev->save_color = one; - y_transfer_init(&yt, dev, y, h); - while (yt.height_left > 0) { - y_transfer_next(&yt, dev); - (*dev_proc(&mem_mono_device, copy_mono)) (dev, - base + (yt.y_next - y) * sraster, - sourcex, sraster, gx_no_bitmap_id, - x, yt.transfer_y, w, yt.transfer_height, - gx_no_color_index, (gx_color_index) 1); - } - return 0; -} - -/* Fill a rectangle. */ -private int -mem_abuf_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - y_transfer yt; - - x -= mdev->mapped_x; - fit_fill_xy(dev, x, y, w, h); - fit_fill_w(dev, x, w); /* don't limit h */ - /* or check w <= 0, h <= 0 */ - mdev->save_color = color; - y_transfer_init(&yt, dev, y, h); - while (yt.height_left > 0) { - y_transfer_next(&yt, dev); - (*dev_proc(&mem_mono_device, fill_rectangle)) (dev, - x, yt.transfer_y, w, yt.transfer_height, - (gx_color_index) 1); - } - return 0; -} - -/* Get the clipping box. We must scale this up by the number of alpha bits. */ -private void -mem_abuf_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - gx_device *tdev = mdev->target; - - (*dev_proc(tdev, get_clipping_box)) (tdev, pbox); - pbox->p.x <<= mdev->log2_scale.x; - pbox->p.y <<= mdev->log2_scale.y; - pbox->q.x <<= mdev->log2_scale.x; - pbox->q.y <<= mdev->log2_scale.y; -} diff --git a/pstoraster/gdevbbox.c b/pstoraster/gdevbbox.c deleted file mode 100644 index b7d85b3024..0000000000 --- a/pstoraster/gdevbbox.c +++ /dev/null @@ -1,1069 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevbbox.c,v 1.3 2000/03/08 23:14:22 mike Exp $ */ -/* Device for tracking bounding box */ -#include "math_.h" -#include "memory_.h" -#include "gx.h" -#include "gserrors.h" -#include "gsparam.h" -#include "gxdevice.h" -#include "gsdevice.h" /* requires gsmatrix.h */ -#include "gdevbbox.h" -#include "gxdcolor.h" /* for gx_device_black/white */ -#include "gxiparam.h" /* for image source size */ -#include "gxistate.h" -#include "gxpaint.h" -#include "gxpath.h" -#include "gxcpath.h" - -/* GC descriptor */ -public_st_device_bbox(); - -/* Device procedures */ -private dev_proc_open_device(bbox_open_device); -private dev_proc_close_device(bbox_close_device); -private dev_proc_output_page(bbox_output_page); -private dev_proc_fill_rectangle(bbox_fill_rectangle); -private dev_proc_copy_mono(bbox_copy_mono); -private dev_proc_copy_color(bbox_copy_color); -private dev_proc_get_params(bbox_get_params); -private dev_proc_put_params(bbox_put_params); -private dev_proc_copy_alpha(bbox_copy_alpha); -private dev_proc_fill_path(bbox_fill_path); -private dev_proc_stroke_path(bbox_stroke_path); -private dev_proc_fill_mask(bbox_fill_mask); -private dev_proc_fill_trapezoid(bbox_fill_trapezoid); -private dev_proc_fill_parallelogram(bbox_fill_parallelogram); -private dev_proc_fill_triangle(bbox_fill_triangle); -private dev_proc_draw_thin_line(bbox_draw_thin_line); -private dev_proc_strip_tile_rectangle(bbox_strip_tile_rectangle); -private dev_proc_strip_copy_rop(bbox_strip_copy_rop); -private dev_proc_begin_typed_image(bbox_begin_typed_image); -private dev_proc_create_compositor(bbox_create_compositor); -private dev_proc_text_begin(bbox_text_begin); - -/* The device prototype */ -/* - * Normally this would be private, but if the device is going to be used - * stand-alone, it has to be public. - */ -/*private */ const -/* - * The bbox device sets the resolution to some value R (currently 4000), and - * the page size in device pixels to slightly smaller than the largest - * representable values (around 500K), leaving a little room for stroke - * widths, rounding, etc. If an input file (or the command line) resets the - * resolution to a value R' > R, the page size in pixels will get multiplied - * by R'/R, and will thereby exceed the representable range, causing a - * limitcheck. That is why the bbox device must set the resolution to a - * value larger than that of any real device. A consequence of this is that - * the page size in inches is limited to the maximum representable pixel - * size divided by R, which gives a limit of about 120" in each dimension. - */ -#define max_coord (max_int_in_fixed - 1000) -#define max_resolution 4000 -gx_device_bbox far_data gs_bbox_device = -{ - std_device_std_body(gx_device_bbox, 0, "bbox", - max_coord, max_coord, - max_resolution, max_resolution), - {bbox_open_device, - NULL, /* get_initial_matrix */ - NULL, /* sync_output */ - bbox_output_page, - bbox_close_device, - NULL, /* map_rgb_color */ - NULL, /* map_color_rgb */ - bbox_fill_rectangle, - NULL, /* tile_rectangle */ - bbox_copy_mono, - bbox_copy_color, - NULL, /* draw_line */ - NULL, /* get_bits */ - bbox_get_params, - bbox_put_params, - NULL, /* map_cmyk_color */ - NULL, /* get_xfont_procs */ - NULL, /* get_xfont_device */ - NULL, /* map_rgb_alpha_color */ - gx_page_device_get_page_device, - NULL, /* get_alpha_bits */ - bbox_copy_alpha, - NULL, /* get_band */ - NULL, /* copy_rop */ - bbox_fill_path, - bbox_stroke_path, - bbox_fill_mask, - bbox_fill_trapezoid, - bbox_fill_parallelogram, - bbox_fill_triangle, - bbox_draw_thin_line, - gx_default_begin_image, - NULL, /* image_data */ - NULL, /* end_image */ - bbox_strip_tile_rectangle, - bbox_strip_copy_rop, - NULL, /* get_clipping_box */ - bbox_begin_typed_image, - NULL, /* get_bits_rectangle */ - NULL, /* map_color_rgb_alpha */ - bbox_create_compositor, - NULL, /* get_hardware_params */ - bbox_text_begin - }, - 0, /* target */ - 1 /*true *//* free_standing */ -}; - -#undef max_coord -#undef max_resolution - -/* Copy device parameters back from the target. */ -private void -bbox_copy_params(gx_device_bbox * bdev, bool remap_white) -{ - gx_device *tdev = bdev->target; - - if (tdev != 0) - gx_device_copy_params((gx_device *)bdev, tdev); - if (remap_white) - bdev->white = gx_device_white((gx_device *)bdev); -} - -#define gx_dc_is_white(pdevc, bdev)\ - (gx_dc_is_pure(pdevc) && gx_dc_pure_color(pdevc) == (bdev)->white) - -private int -bbox_close_device(gx_device * dev) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - - if ((gx_device *) bdev->box_device != dev) { - /* - * This device was created as a wrapper for a compositor. - * Just free the devices. - */ - int code = (*dev_proc(tdev, close_device)) (tdev); - - gs_free_object(dev->memory, dev, "bbox_close_device(composite)"); - return code; - } else { - return (tdev == 0 ? 0 : (*dev_proc(tdev, close_device)) (tdev)); - } -} - -/* Bounding box utilities */ - -private void near -bbox_initialize(gs_fixed_rect * pr) -{ - pr->p.x = pr->p.y = max_fixed; - pr->q.x = pr->q.y = min_fixed; -} - -private void near -bbox_add_rect(gs_fixed_rect * pr, fixed x0, fixed y0, fixed x1, fixed y1) -{ - if (x0 < pr->p.x) - pr->p.x = x0; - if (y0 < pr->p.y) - pr->p.y = y0; - if (x1 > pr->q.x) - pr->q.x = x1; - if (y1 > pr->q.y) - pr->q.y = y1; -} -private void near -bbox_add_point(gs_fixed_rect * pr, fixed x, fixed y) -{ - bbox_add_rect(pr, x, y, x, y); -} -private void near -bbox_add_int_rect(gs_fixed_rect * pr, int x0, int y0, int x1, int y1) -{ - bbox_add_rect(pr, int2fixed(x0), int2fixed(y0), int2fixed(x1), - int2fixed(y1)); -} - -#define rect_is_page(dev, x, y, w, h)\ - (x <= 0 && y <= 0 && w >= x + dev->width && h >= y + dev->height) - - /* ---------------- Open/close/page ---------------- */ - -/* Initialize a bounding box device. */ -void -gx_device_bbox_init(gx_device_bbox * dev, gx_device * target) -{ - gx_device_init((gx_device *) dev, (const gx_device *)&gs_bbox_device, - (target ? target->memory : NULL), true); - gx_device_forward_fill_in_procs((gx_device_forward *) dev); - dev->target = target; - dev->box_device = dev; - bbox_copy_params(dev, false); - dev->free_standing = false; /* being used as a component */ -} - -/* Read back the bounding box in 1/72" units. */ -void -gx_device_bbox_bbox(gx_device_bbox * dev, gs_rect * pbbox) -{ - const gx_device_bbox *bbdev = dev->box_device; - gs_matrix mat; - gs_rect dbox; - - gs_deviceinitialmatrix((gx_device *) dev, &mat); - dbox.p.x = fixed2float(bbdev->bbox.p.x); - dbox.p.y = fixed2float(bbdev->bbox.p.y); - dbox.q.x = fixed2float(bbdev->bbox.q.x); - dbox.q.y = fixed2float(bbdev->bbox.q.y); - gs_bbox_transform_inverse(&dbox, &mat, pbbox); -} - - -private int -bbox_open_device(gx_device * dev) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (bdev->free_standing) { - gx_device_forward_fill_in_procs((gx_device_forward *) dev); - bdev->box_device = bdev; - } - if (bdev->box_device == bdev) - bbox_initialize(&bdev->bbox); - /* gx_forward_open_device doesn't exist */ - { - gx_device *tdev = bdev->target; - int code = (tdev == 0 ? 0 : (*dev_proc(tdev, open_device)) (tdev)); - - bbox_copy_params(bdev, true); - return code; - } -} - -private int -bbox_output_page(gx_device * dev, int num_copies, int flush) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (bdev->free_standing) { - /* - * This is a free-standing device. Print the page bounding box. - */ - gs_rect bbox; - - gx_device_bbox_bbox(bdev, &bbox); - dlprintf4("%%%%BoundingBox: %d %d %d %d\n", - (int)floor(bbox.p.x), (int)floor(bbox.p.y), - (int)ceil(bbox.q.x), (int)ceil(bbox.q.y)); - dlprintf4("%%%%HiResBoundingBox: %f %f %f %f\n", - bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y); - } - /* - * Propagate the PageCount to the target, - * since it changes every time gs_output_page is called. - */ - if (bdev->target) - bdev->target->PageCount = dev->PageCount; - return gx_forward_output_page(dev, num_copies, flush); -} - -/* ---------------- Low-level drawing ---------------- */ - -private int -bbox_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - /* Check for erasing the entire page. */ - if (rect_is_page(dev, x, y, w, h)) - bbox_initialize(&bbdev->bbox); - else if (color != bdev->white) - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* gx_forward_fill_rectangle doesn't exist */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_rectangle)) (tdev, x, y, w, h, color)); - } -} - -private int -bbox_copy_mono(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - if ((one != gx_no_color_index && one != bdev->white) || - (zero != gx_no_color_index && zero != bdev->white) - ) - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* gx_forward_copy_mono doesn't exist */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, copy_mono)) - (tdev, data, dx, raster, id, x, y, w, h, zero, one)); - } -} - -private int -bbox_copy_color(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* gx_forward_copy_color doesn't exist */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, copy_color)) - (tdev, data, dx, raster, id, x, y, w, h)); - } -} - -private int -bbox_copy_alpha(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index color, int depth) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* gx_forward_copy_alpha doesn't exist */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, copy_alpha)) - (tdev, data, data_x, raster, id, x, y, w, h, color, depth)); - } -} - -private int -bbox_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1, - int px, int py) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - if (rect_is_page(dev, x, y, w, h)) - bbox_initialize(&bbdev->bbox); - else - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* Skip the call if there is no target. */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, strip_tile_rectangle)) - (tdev, tiles, x, y, w, h, color0, color1, px, py)); - } -} - -private int -bbox_strip_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, - gx_bitmap_id id, - const gx_color_index * scolors, - const gx_strip_bitmap * textures, - const gx_color_index * tcolors, - int x, int y, int w, int h, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - /* gx_forward_strip_copy_rop doesn't exist */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, strip_copy_rop)) - (tdev, sdata, sourcex, sraster, id, scolors, - textures, tcolors, x, y, w, h, phase_x, phase_y, lop)); - } -} - -/* ---------------- Parameters ---------------- */ - -/* We implement get_params to provide a way to read out the bounding box. */ -private int -bbox_get_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - const gx_device_bbox *bbdev = bdev->box_device; - int code = gx_forward_get_params(dev, plist); - gs_param_float_array bba; - float bbox[4]; - - if (code < 0) - return code; - /* - * We might be calling get_params before the device has been - * initialized: in this case, bbdev = 0. - */ - if (bbdev == 0) - bbdev = (const gx_device_bbox *)dev; - bbox[0] = fixed2float(bbdev->bbox.p.x); - bbox[1] = fixed2float(bbdev->bbox.p.y); - bbox[2] = fixed2float(bbdev->bbox.q.x); - bbox[3] = fixed2float(bbdev->bbox.q.y); - bba.data = bbox, bba.size = 4, bba.persistent = false; - return param_write_float_array(plist, "PageBoundingBox", &bba); -} - -/* We implement put_params to ensure that we keep the important */ -/* device parameters up to date, and to prevent an /undefined error */ -/* from PageBoundingBox. */ -private int -bbox_put_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - int code; - int ecode = 0; - gs_param_name param_name; - gs_param_float_array bba; - - code = param_read_float_array(plist, (param_name = "PageBoundingBox"), - &bba); - switch (code) { - case 0: - if (bba.size != 4) { - ecode = gs_note_error(gs_error_rangecheck); - goto e; - } - break; - default: - ecode = code; - e:param_signal_error(plist, param_name, ecode); - case 1: - bba.data = 0; - } - - code = gx_forward_put_params(dev, plist); - if (ecode < 0) - code = ecode; - if (code >= 0 && bba.data != 0) { - gx_device_bbox *bbdev = bdev->box_device; - - bbdev->bbox.p.x = float2fixed(bba.data[0]); - bbdev->bbox.p.y = float2fixed(bba.data[1]); - bbdev->bbox.q.x = float2fixed(bba.data[2]); - bbdev->bbox.q.y = float2fixed(bba.data[3]); - } - bbox_copy_params(bdev, true); - return code; -} - -/* ---------------- Polygon drawing ---------------- */ - -private fixed -edge_x_at_y(const gs_fixed_edge * edge, fixed y) -{ - return fixed_mult_quo(edge->end.x - edge->start.x, - y - edge->start.y, - edge->end.y - edge->start.y) + edge->start.x; -} -private int -bbox_fill_trapezoid(gx_device * dev, - const gs_fixed_edge * left, const gs_fixed_edge * right, - fixed ybot, fixed ytop, bool swap_axes, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (!gx_dc_is_white(pdevc, bdev)) { - gx_device_bbox *bbdev = bdev->box_device; - fixed x0l = - (left->start.y == ybot ? left->start.x : - edge_x_at_y(left, ybot)); - fixed x1l = - (left->end.y == ytop ? left->end.x : - edge_x_at_y(left, ytop)); - fixed x0r = - (right->start.y == ybot ? right->start.x : - edge_x_at_y(right, ybot)); - fixed x1r = - (right->end.y == ytop ? right->end.x : - edge_x_at_y(right, ytop)); - fixed xminl = min(x0l, x1l), xmaxl = max(x0l, x1l); - fixed xminr = min(x0r, x1r), xmaxr = max(x0r, x1r); - fixed x0 = min(xminl, xminr), x1 = max(xmaxl, xmaxr); - - if (swap_axes) - bbox_add_rect(&bbdev->bbox, ybot, x0, ytop, x1); - else - bbox_add_rect(&bbdev->bbox, x0, ybot, x1, ytop); - } - /* Skip the call if there is no target. */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_trapezoid)) - (tdev, left, right, ybot, ytop, swap_axes, pdevc, lop)); - } -} - -private int -bbox_fill_parallelogram(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, - fixed bx, fixed by, const gx_device_color * pdevc, - gs_logical_operation_t lop) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (!gx_dc_is_white(pdevc, bdev)) { - gx_device_bbox *bbdev = bdev->box_device; - fixed pax = px + ax, pay = py + ay; - - bbox_add_rect(&bbdev->bbox, px, py, px + bx, py + by); - bbox_add_rect(&bbdev->bbox, pax, pay, pax + bx, pay + by); - } - /* Skip the call if there is no target. */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_parallelogram)) - (tdev, px, py, ax, ay, bx, by, pdevc, lop)); - } -} - -private int -bbox_fill_triangle(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (!gx_dc_is_white(pdevc, bdev)) { - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_rect(&bbdev->bbox, px, py, px + bx, py + by); - bbox_add_point(&bbdev->bbox, px + ax, py + ay); - } - /* Skip the call if there is no target. */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_triangle)) - (tdev, px, py, ax, ay, bx, by, pdevc, lop)); - } -} - -private int -bbox_draw_thin_line(gx_device * dev, - fixed fx0, fixed fy0, fixed fx1, fixed fy1, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - - if (!gx_dc_is_white(pdevc, bdev)) { - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_rect(&bbdev->bbox, fx0, fy0, fx1, fy1); - } - /* Skip the call if there is no target. */ - { - gx_device *tdev = bdev->target; - - return (tdev == 0 ? 0 : - (*dev_proc(tdev, draw_thin_line)) - (tdev, fx0, fy0, fx1, fy0, pdevc, lop)); - } -} - -/* ---------------- High-level drawing ---------------- */ - -#define adjust_box(pbox, adj)\ -((pbox)->p.x -= (adj).x, (pbox)->p.y -= (adj).y,\ - (pbox)->q.x += (adj).x, (pbox)->q.y += (adj).y) - -private int -bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath, - const gx_fill_params * params, const gx_device_color * pdevc, - const gx_clip_path * pcpath) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - - if (!gx_dc_is_white(pdevc, bdev)) { - gs_fixed_rect ibox; - gs_fixed_point adjust; - - if (gx_path_bbox(ppath, &ibox) < 0) - return 0; - adjust = params->adjust; - if (params->fill_zero_width) - gx_adjust_if_empty(&ibox, &adjust); - adjust_box(&ibox, adjust); - if (pcpath != NULL && - !gx_cpath_includes_rectangle(pcpath, ibox.p.x, ibox.p.y, - ibox.q.x, ibox.q.y) - ) { - /* Let the target do the drawing, but break down the */ - /* fill path into pieces for computing the bounding box. */ - bdev->target = NULL; - gx_default_fill_path(dev, pis, ppath, params, pdevc, pcpath); - bdev->target = tdev; - } else { /* Just use the path bounding box. */ - bbox_add_rect(&bdev->bbox, ibox.p.x, ibox.p.y, ibox.q.x, - ibox.q.y); - } - } - /* Skip the call if there is no target. */ - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_path)) - (tdev, pis, ppath, params, pdevc, pcpath)); -} - -private int -bbox_stroke_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath, - const gx_stroke_params * params, - const gx_drawing_color * pdevc, const gx_clip_path * pcpath) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - - if (!gx_dc_is_white(pdevc, bdev)) { - gs_fixed_rect ibox; - gs_fixed_point expand; - - if (gx_path_bbox(ppath, &ibox) < 0) - return 0; - if (gx_stroke_path_expansion(pis, ppath, &expand) < 0) - ibox.p.x = ibox.p.y = min_fixed, ibox.q.x = ibox.q.y = max_fixed; - else - adjust_box(&ibox, expand); - if (pcpath != NULL && - !gx_cpath_includes_rectangle(pcpath, ibox.p.x, ibox.p.y, - ibox.q.x, ibox.q.y) - ) { - /* Let the target do the drawing, but break down the */ - /* fill path into pieces for computing the bounding box. */ - bdev->target = NULL; - gx_default_stroke_path(dev, pis, ppath, params, pdevc, pcpath); - bdev->target = tdev; - } else { - /* Just use the path bounding box. */ - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_rect(&bbdev->bbox, ibox.p.x, ibox.p.y, ibox.q.x, - ibox.q.y); - } - } - /* Skip the call if there is no target. */ - return (tdev == 0 ? 0 : - (*dev_proc(tdev, stroke_path)) - (tdev, pis, ppath, params, pdevc, pcpath)); -} - -private int -bbox_fill_mask(gx_device * dev, - const byte * data, int dx, int raster, gx_bitmap_id id, - int x, int y, int w, int h, - const gx_drawing_color * pdcolor, int depth, - gs_logical_operation_t lop, const gx_clip_path * pcpath) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - - if (pcpath != NULL && - !gx_cpath_includes_rectangle(pcpath, int2fixed(x), int2fixed(y), - int2fixed(x + w), - int2fixed(y + h)) - ) { - /* Let the target do the drawing, but break down the */ - /* image into pieces for computing the bounding box. */ - bdev->target = NULL; - gx_default_fill_mask(dev, data, dx, raster, id, x, y, w, h, - pdcolor, depth, lop, pcpath); - bdev->target = tdev; - } else { - /* Just use the mask bounding box. */ - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_int_rect(&bbdev->bbox, x, y, x + w, y + h); - } - /* Skip the call if there is no target. */ - return (tdev == 0 ? 0 : - (*dev_proc(tdev, fill_mask)) - (tdev, data, dx, raster, id, x, y, w, h, - pdcolor, depth, lop, pcpath)); -} - -/* ------ Bitmap imaging ------ */ - -typedef struct bbox_image_enum_s { - gx_image_enum_common; - gs_memory_t *memory; - gs_matrix matrix; /* map from image space to device space */ - const gx_clip_path *pcpath; - gx_image_enum_common_t *target_info; - int x0, x1; - int y, height; -} bbox_image_enum; - -gs_private_st_ptrs2(st_bbox_image_enum, bbox_image_enum, "bbox_image_enum", -bbox_image_enum_enum_ptrs, bbox_image_enum_reloc_ptrs, pcpath, target_info); - -private image_enum_proc_plane_data(bbox_image_plane_data); -private image_enum_proc_end_image(bbox_image_end_image); -private const gx_image_enum_procs_t bbox_image_enum_procs = -{ - bbox_image_plane_data, bbox_image_end_image -}; - -private int -bbox_image_begin(const gs_imager_state * pis, const gs_matrix * pmat, - const gs_image_common_t * pic, const gs_int_rect * prect, - const gx_clip_path * pcpath, gs_memory_t * memory, - bbox_image_enum ** ppbe) -{ - int code; - gs_matrix mat; - bbox_image_enum *pbe; - - if (pmat == 0) - pmat = &ctm_only(pis); - if ((code = gs_matrix_invert(&pic->ImageMatrix, &mat)) < 0 || - (code = gs_matrix_multiply(&mat, pmat, &mat)) < 0 - ) - return code; - pbe = gs_alloc_struct(memory, bbox_image_enum, &st_bbox_image_enum, - "bbox_image_begin"); - if (pbe == 0) - return_error(gs_error_VMerror); - pbe->memory = memory; - pbe->matrix = mat; - pbe->pcpath = pcpath; - pbe->target_info = 0; /* in case no target */ - if (prect) { - pbe->x0 = prect->p.x, pbe->x1 = prect->q.x; - pbe->y = prect->p.y, pbe->height = prect->q.y - prect->p.y; - } else { - gs_int_point size; - int code = (*pic->type->source_size) (pis, pic, &size); - - if (code < 0) { - gs_free_object(memory, pbe, "bbox_image_begin"); - return code; - } - pbe->x0 = 0, pbe->x1 = size.x; - pbe->y = 0, pbe->height = size.y; - } - *ppbe = pbe; - return 0; -} - -private void -bbox_image_copy_target_info(bbox_image_enum * pbe, gx_device_bbox * dev) -{ - const gx_image_enum_common_t *target_info = pbe->target_info; - - pbe->num_planes = target_info->num_planes; - memcpy(pbe->plane_depths, target_info->plane_depths, - pbe->num_planes * sizeof(pbe->plane_depths[0])); - if (dev->target == 0) { - gx_image_end(pbe->target_info, false); - pbe->target_info = 0; - } -} - -private int -bbox_begin_typed_image(gx_device * dev, - const gs_imager_state * pis, const gs_matrix * pmat, - const gs_image_common_t * pic, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, - const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ - bbox_image_enum *pbe; - int code = - bbox_image_begin(pis, pmat, pic, prect, pcpath, memory, &pbe); - - if (code < 0) - return code; - /* We fill in num_planes and plane_depths later. */ - /* format is irrelevant. */ - code = gx_image_enum_common_init((gx_image_enum_common_t *) pbe, pic, - &bbox_image_enum_procs, dev, - 0, 0, gs_image_format_chunky); - if (code < 0) - return code; - *pinfo = (gx_image_enum_common_t *) pbe; - /* - * If there is no target, we still have to call default_begin_image - * to get the correct num_planes and plane_depths. - */ - { - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - - dev_proc_begin_typed_image((*begin_typed_image)); - - if (tdev == 0) { - tdev = dev; - begin_typed_image = gx_default_begin_typed_image; - } else { - begin_typed_image = dev_proc(tdev, begin_typed_image); - } - code = (*begin_typed_image) - (tdev, pis, pmat, pic, prect, pdcolor, pcpath, memory, - &pbe->target_info); - if (code < 0) - return code; - bbox_image_copy_target_info(pbe, bdev); - } - return 0; -} - -private int -bbox_image_plane_data(gx_device * dev, - gx_image_enum_common_t * info, const gx_image_plane_t * planes, int height) -{ - - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - bbox_image_enum *pbe = (bbox_image_enum *) info; - const gx_clip_path *pcpath = pbe->pcpath; - gs_rect sbox, dbox; - gs_point corners[4]; - gs_fixed_rect ibox; - - sbox.p.x = pbe->x0; - sbox.p.y = pbe->y; - sbox.q.x = pbe->x1; - sbox.q.y = pbe->y += height; - gs_bbox_transform_only(&sbox, &pbe->matrix, corners); - gs_points_bbox(corners, &dbox); - ibox.p.x = float2fixed(dbox.p.x); - ibox.p.y = float2fixed(dbox.p.y); - ibox.q.x = float2fixed(dbox.q.x); - ibox.q.y = float2fixed(dbox.q.y); - if (pcpath != NULL && - !gx_cpath_includes_rectangle(pcpath, ibox.p.x, ibox.p.y, - ibox.q.x, ibox.q.y) - ) { - /* Let the target do the drawing, but drive two triangles */ - /* through the clipping path to get an accurate bounding box. */ - gx_device_clip cdev; - gx_drawing_color devc; - fixed x0 = float2fixed(corners[0].x), y0 = float2fixed(corners[0].y); - fixed bx2 = float2fixed(corners[2].x) - x0, by2 = float2fixed(corners[2].y) - y0; - - gx_make_clip_path_device(&cdev, pcpath); - cdev.target = dev; - (*dev_proc(&cdev, open_device)) ((gx_device *) & cdev); - color_set_pure(&devc, 0); /* any color will do */ - bdev->target = NULL; - gx_default_fill_triangle((gx_device *) & cdev, x0, y0, - float2fixed(corners[1].x) - x0, - float2fixed(corners[1].y) - y0, - bx2, by2, &devc, lop_default); - gx_default_fill_triangle((gx_device *) & cdev, x0, y0, - float2fixed(corners[3].x) - x0, - float2fixed(corners[3].y) - y0, - bx2, by2, &devc, lop_default); - bdev->target = tdev; - } else { - /* Just use the bounding box. */ - gx_device_bbox *bbdev = bdev->box_device; - - bbox_add_rect(&bbdev->bbox, ibox.p.x, ibox.p.y, ibox.q.x, ibox.q.y); - } - /* Skip the call if there is no target. */ - return (tdev == 0 ? pbe->y >= pbe->height : - gx_image_plane_data(pbe->target_info, planes, height)); -} - -private int -bbox_image_end_image(gx_device * dev, gx_image_enum_common_t * info, - bool draw_last) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - bbox_image_enum *pbe = (bbox_image_enum *) info; - void *target_info = pbe->target_info; - - /* Skip the call if there is no target. */ - gx_device *tdev = bdev->target; - int code = - (tdev == 0 ? 0 : gx_image_end(target_info, draw_last)); - - gs_free_object(pbe->memory, pbe, "bbox_end_image"); - return code; -} - -private int -bbox_create_compositor(gx_device * dev, - gx_device ** pcdev, const gs_composite_t * pcte, - const gs_imager_state * pis, gs_memory_t * memory) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *target = bdev->target; - - /* - * If there isn't a target, all we care about is the bounding box, - * so don't bother with actually compositing. - */ - if (target == 0) { - *pcdev = dev; - return 0; - } - /* - * Create a compositor for the target, and then wrap another - * bbox device around it, but still accumulating the bounding - * box in the same place. - */ - { - gx_device *cdev; - gx_device_bbox *bbcdev; - int code = (*dev_proc(target, create_compositor)) - (target, &cdev, pcte, pis, memory); - - if (code < 0) - return code; - bbcdev = gs_alloc_struct_immovable(memory, gx_device_bbox, - &st_device_bbox, - "bbox_create_compositor"); - if (bbcdev == 0) { - (*dev_proc(cdev, close_device)) (cdev); - return_error(gs_error_VMerror); - } - gx_device_bbox_init(bbcdev, target); - bbcdev->target = cdev; - bbcdev->box_device = bdev; - *pcdev = (gx_device *) bbcdev; - return 0; - } -} - -/* ------ Text imaging ------ */ - -extern_st(st_gs_text_enum); - -typedef struct bbox_text_enum_s { - gs_text_enum_common; - gs_text_enum_t *target_info; -} bbox_text_enum; - -gs_private_st_suffix_add1(st_bbox_text_enum, bbox_text_enum, "bbox_text_enum", - bbox_text_enum_enum_ptrs, bbox_text_enum_reloc_ptrs, - st_gs_text_enum, target_info); - -private text_enum_proc_process(bbox_text_process); -private text_enum_proc_set_cache(bbox_text_set_cache); -private rc_free_proc(bbox_text_free); - -private const gs_text_enum_procs_t bbox_text_procs = -{ - bbox_text_process, bbox_text_set_cache -}; - -private int -bbox_text_begin(gx_device * dev, gs_imager_state * pis, - const gs_text_params_t * text, const gs_font * font, -gx_path * path, const gx_device_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gs_text_enum_t ** ppenum) -{ - gx_device_bbox *const bdev = (gx_device_bbox *) dev; - gx_device *tdev = bdev->target; - bbox_text_enum *pbte; - int code; - - if (tdev == 0) - return gx_default_text_begin(dev, pis, text, font, path, pdcolor, - pcpath, memory, ppenum); - rc_alloc_struct_1(pbte, bbox_text_enum, &st_bbox_text_enum, memory, - return_error(gs_error_VMerror), - "bbox_text_begin"); - pbte->rc.free = bbox_text_free; - code = - (*dev_proc(tdev, text_begin)) - (tdev, pis, text, font, path, pdcolor, pcpath, memory, - &pbte->target_info); - if (code < 0) { - gs_free_object(memory, pbte, "bbox_text_begin"); - return code; - } - *(gs_text_enum_t *) pbte = *pbte->target_info; /* copy common info */ - pbte->procs = &bbox_text_procs; - *ppenum = (gs_text_enum_t *) pbte; - return code; -} - -private int -bbox_text_process(gs_text_enum_t * pte) -{ - bbox_text_enum *const pbte = (bbox_text_enum *) pte; - int code = gs_text_process(pbte->target_info); - - if (code < 0) - return code; - /* Copy back the dynamic information for the client. */ - pte->index = pbte->target_info->index; - return code; -} - -private int -bbox_text_set_cache(gs_text_enum_t * pte, const double *values, - gs_text_cache_control_t control) -{ - bbox_text_enum *const pbte = (bbox_text_enum *) pte; - gs_text_enum_t *tpte = pbte->target_info; - int code = tpte->procs->set_cache(tpte, values, control); - - if (code < 0) - return code; - /* Copy back the dynamic information for the client. */ - pte->index = tpte->index; - return code; -} - -private void -bbox_text_free(gs_memory_t * memory, void *vpte, client_name_t cname) -{ - bbox_text_enum *const pbte = (bbox_text_enum *) vpte; - - gs_text_release(pbte->target_info, cname); - rc_free_struct_only(memory, vpte, cname); -} diff --git a/pstoraster/gdevbbox.h b/pstoraster/gdevbbox.h deleted file mode 100644 index 196ac90a8c..0000000000 --- a/pstoraster/gdevbbox.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevbbox.h,v 1.3 2000/03/13 19:00:46 mike Exp $ */ -/* Requires gxdevice.h */ - -#ifndef gdevbbox_INCLUDED -# define gdevbbox_INCLUDED - -/* - * This device keeps track of the per-page bounding box, and also optionally - * forwards all drawing commands to a target. It can be used either as a - * free-standing device or as a component (e.g., by the EPS writer). - * - * One way to use a bounding box device is simply to include bbox.dev in the - * value of DEVICE_DEVSn in the makefile. This produces a free-standing - * device named 'bbox' that can be selected in the usual way (-sDEVICE=bbox) - * and that prints out the bounding box at each showpage or copypage without - * doing any drawing. - * - * The other way to use a bounding box device is from C code as a component - * in a device pipeline. To set up a bounding box device that doesn't do - * any drawing: - * gx_device_bbox *bdev = - * gs_alloc_struct_immovable(some_memory, - * gx_device_bbox, &st_device_bbox, - * "some identifying string for debugging"); - * gx_device_bbox_init(bdev, NULL); - * Non-drawing bounding box devices have an "infinite" page size. - * - * To set up a bounding box device that draws to another device tdev: - * gx_device_bbox *bdev = - * gs_alloc_struct_immovable(some_memory, - * gx_device_bbox, &st_device_bbox, - * "some identifying string for debugging"); - * gx_device_bbox_init(bdev, tdev); - * Bounding box devices that draw to a real device appear to have the - * same page size as that device. - * - * To intercept the end-of-page to call a routine eop of your own, after - * setting up the device: - * dev_proc_output_page(eop); -- declare a prototype for eop - * ... - * set_dev_proc(bdev, output_page, eop); - * ... - * int eop(gx_device *dev, int num_copies, int flush) - * { gs_rect bbox; - * gx_device_bbox_bbox((gx_device_bbox *)dev, &bbox); - * << do whatever you want >> - * return gx_forward_output_page(dev, num_copies, flush); - * } - */ -#define gx_device_bbox_common\ - gx_device_forward_common;\ - bool free_standing;\ - /* In order to handle compositors, we provide a separate pointer */\ - /* to the bbox device instance that holds the actual box. */\ - gx_device_bbox *box_device;\ - /* The following are updated dynamically. */\ - gs_fixed_rect bbox;\ - gx_color_index white -typedef struct gx_device_bbox_s gx_device_bbox; -struct gx_device_bbox_s { - gx_device_bbox_common; -}; - -extern_st(st_device_bbox); -#define public_st_device_bbox() /* in gdevbbox.c */\ - gs_public_st_suffix_add1_final(st_device_bbox, gx_device_bbox,\ - "gx_device_bbox", device_bbox_enum_ptrs, device_bbox_reloc_ptrs,\ - gx_device_finalize, st_device_forward, box_device) - -/* Initialize a bounding box device. */ -void gx_device_bbox_init(P2(gx_device_bbox * dev, gx_device * target)); - -/* Read back the bounding box in 1/72" units. */ -void gx_device_bbox_bbox(P2(gx_device_bbox * dev, gs_rect * pbbox)); - -#endif /* gdevbbox_INCLUDED */ diff --git a/pstoraster/gdevcmap.h b/pstoraster/gdevcmap.h deleted file mode 100644 index fa0811c130..0000000000 --- a/pstoraster/gdevcmap.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevcmap.h,v 1.1 2000/03/13 19:00:46 mike Exp $ */ -/* Interface to special color mapping device */ - -#ifndef gdevcmap_INCLUDED -# define gdevcmap_INCLUDED - -/* Define the color mapping algorithms. */ -typedef enum { - - /* Don't change the color. */ - - device_cmap_identity = 0, - - /* Snap each RGB primary component to 0 or 1 individually. */ - - device_cmap_snap_to_primaries, - - /* Snap black to white, other colors to black. */ - - device_cmap_color_to_black_over_white, - - /* Convert to a gray shade of the correct brightness. */ - - device_cmap_monochrome - -} gx_device_color_mapping_method_t; - -#define device_cmap_max_method device_cmap_monochrome - -/* Define the color mapping forwarding device. */ -typedef struct gx_device_cmap_s { - gx_device_forward_common; - gx_device_color_mapping_method_t mapping_method; -} gx_device_cmap; - -extern_st(st_device_cmap); -#define public_st_device_cmap() /* in gdevcmap.c */\ - gs_public_st_suffix_add0_final(st_device_cmap, gx_device_cmap,\ - "gx_device_cmap", device_cmap_enum_ptrs, device_cmap_reloc_ptrs,\ - gx_device_finalize, st_device_forward) - -/* Initialize a color mapping device. Do this just once after allocation. */ -int gdev_cmap_init(P3(gx_device_cmap * dev, gx_device * target, - gx_device_color_mapping_method_t mapping_method)); - -/* Set the color mapping method. This may be called at any time. */ -int gdev_cmap_set_method(P2(gx_device_cmap * dev, - gx_device_color_mapping_method_t mapping_method)); - -#endif /* gdevcmap_INCLUDED */ diff --git a/pstoraster/gdevcups.c b/pstoraster/gdevcups.c index d3e6147379..c540c5e066 100644 --- a/pstoraster/gdevcups.c +++ b/pstoraster/gdevcups.c @@ -1,5 +1,5 @@ /* - * "$Id: gdevcups.c,v 1.43.2.1 2001/12/26 16:52:48 mike Exp $" + * "$Id: gdevcups.c,v 1.43.2.2 2001/12/29 19:04:10 mike Exp $" * * GNU Ghostscript raster output driver for the Common UNIX Printing * System (CUPS). @@ -58,7 +58,7 @@ #include "gsexit.h" #include -#include +#include #include #include @@ -70,7 +70,7 @@ * Globals... */ -extern const char *cupsProfile; +const char *cupsProfile = NULL; /* @@ -169,10 +169,22 @@ private gx_device_procs cups_procs = NULL /* strip_copy_rop */ }; +#define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\ + std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\ + (int)((long)(w10) * (xdpi) / 10),\ + (int)((long)(h10) * (ydpi) / 10),\ + xdpi, ydpi,\ + ncomp, depth, mg, mc, dg, dc,\ + -(lo) * (xdpi), -(to) * (ydpi),\ + (lm) * 72.0, (bm) * 72.0,\ + (rm) * 72.0, (tm) * 72.0\ + ),\ + prn_device_body_copies_rest_(print_pages) + gx_device_cups gs_cups_device = { prn_device_body_copies(gx_device_cups, cups_procs, "cups", 85, 110, 100, 100, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, cups_print_pages), + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, cups_print_pages), 0, /* page */ NULL, /* stream */ NULL, /* ppd */ @@ -1610,16 +1622,6 @@ cups_put_params(gx_device *pdev, /* I - Device info */ cups_set_color_info(pdev); - if (old_depth != pdev->color_info.depth) - { - fputs("DEBUG: Reallocating memory for new color depth...\n", stderr); - sp = ((gx_device_printer *)pdev)->space_params; - - if ((code = gdev_prn_reallocate_memory(pdev, &sp, pdev->width, - pdev->height)) < 0) - return (code); - } - /* * Compute the page margins... */ @@ -1635,10 +1637,10 @@ cups_put_params(gx_device *pdev, /* I - Device info */ for (i = cups->ppd->num_sizes, size = cups->ppd->sizes; i > 0; i --, size ++) - if ((fabs(cups->PageSize[1] - size->length) < 18.0 && - fabs(cups->PageSize[0] - size->width) < 18.0) || - (fabs(cups->PageSize[0] - size->length) < 18.0 && - fabs(cups->PageSize[1] - size->width) < 18.0)) + if ((fabs(cups->MediaSize[1] - size->length) < 18.0 && + fabs(cups->MediaSize[0] - size->width) < 18.0) || + (fabs(cups->MediaSize[0] - size->length) < 18.0 && + fabs(cups->MediaSize[1] - size->width) < 18.0)) break; if (i == 0 && !cups->ppd->variable_sizes) @@ -1700,8 +1702,8 @@ cups_put_params(gx_device *pdev, /* I - Device info */ cups->header.HWResolution[0] = pdev->HWResolution[0]; cups->header.HWResolution[1] = pdev->HWResolution[1]; - cups->header.PageSize[0] = pdev->PageSize[0]; - cups->header.PageSize[1] = pdev->PageSize[1]; + cups->header.PageSize[0] = pdev->MediaSize[0]; + cups->header.PageSize[1] = pdev->MediaSize[1]; /* * Reallocate memory if the size or color depth was changed... @@ -3061,5 +3063,5 @@ cups_print_planar(gx_device_printer *pdev, /* I - Printer device */ /* - * End of "$Id: gdevcups.c,v 1.43.2.1 2001/12/26 16:52:48 mike Exp $". + * End of "$Id: gdevcups.c,v 1.43.2.2 2001/12/29 19:04:10 mike Exp $". */ diff --git a/pstoraster/gdevdbit.c b/pstoraster/gdevdbit.c deleted file mode 100644 index df24a36933..0000000000 --- a/pstoraster/gdevdbit.c +++ /dev/null @@ -1,708 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevdbit.c,v 1.2 2000/10/13 01:04:40 mike Exp $ */ -/* Default device bitmap copying implementation */ -#include "gx.h" -#include "gpcheck.h" -#include "gserrors.h" -#include "gsbittab.h" -#include "gsrect.h" -#include "gsropt.h" -#include "gxdcolor.h" -#include "gxdevice.h" -#include "gxdevmem.h" -#include "gdevmem.h" -#undef mdev -#include "gxcpath.h" - -/* By default, implement tile_rectangle using strip_tile_rectangle. */ -int -gx_default_tile_rectangle(gx_device * dev, const gx_tile_bitmap * tile, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1, - int px, int py) -{ - gx_strip_bitmap tiles; - - *(gx_tile_bitmap *) & tiles = *tile; - tiles.shift = tiles.rep_shift = 0; - return (*dev_proc(dev, strip_tile_rectangle)) - (dev, &tiles, x, y, w, h, color0, color1, px, py); -} - -/* Implement copy_mono by filling lots of small rectangles. */ -/* This is very inefficient, but it works as a default. */ -int -gx_default_copy_mono(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - bool invert; - gx_color_index color; - gx_device_color devc; - - fit_copy(dev, data, dx, raster, id, x, y, w, h); - if (one != gx_no_color_index) { - invert = false; - color = one; - if (zero != gx_no_color_index) { - int code = (*dev_proc(dev, fill_rectangle)) - (dev, x, y, w, h, zero); - - if (code < 0) - return code; - } - } else { - invert = true; - color = zero; - } - color_set_pure(&devc, color); - return gx_dc_default_fill_masked - (&devc, data, dx, raster, id, x, y, w, h, dev, rop3_T, invert); -} - -/* Implement copy_color by filling lots of small rectangles. */ -/* This is very inefficient, but it works as a default. */ -int -gx_default_copy_color(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - int depth = dev->color_info.depth; - byte mask; - - dev_proc_fill_rectangle((*fill)); - const byte *row; - int iy; - - if (depth == 1) - return (*dev_proc(dev, copy_mono)) (dev, data, dx, raster, id, - x, y, w, h, - (gx_color_index) 0, (gx_color_index) 1); - fit_copy(dev, data, dx, raster, id, x, y, w, h); - fill = dev_proc(dev, fill_rectangle); - mask = (byte) ((1 << depth) - 1); - for (row = data, iy = 0; iy < h; row += raster, ++iy) { - int ix; - gx_color_index c0 = gx_no_color_index; - const byte *ptr = row + ((dx * depth) >> 3); - int i0; - - for (i0 = ix = 0; ix < w; ++ix) { - gx_color_index color; - - if (depth >= 8) { - color = *ptr++; - switch (depth) { - case 32: - color = (color << 8) + *ptr++; - case 24: - color = (color << 8) + *ptr++; - case 16: - color = (color << 8) + *ptr++; - } - } else { - uint dbit = (-(ix + dx + 1) * depth) & 7; - - color = (*ptr >> dbit) & mask; - if (dbit == 0) - ptr++; - } - if (color != c0) { - if (ix > i0) { - int code = (*fill) - (dev, i0 + x, iy + y, ix - i0, 1, c0); - - if (code < 0) - return code; - } - c0 = color; - i0 = ix; - } - } - if (ix > i0) { - int code = (*fill) (dev, i0 + x, iy + y, ix - i0, 1, c0); - - if (code < 0) - return code; - } - } - return 0; -} - -int -gx_no_copy_alpha(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int width, int height, - gx_color_index color, int depth) -{ - return_error(gs_error_unknownerror); -} - -int -gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int width, int height, - gx_color_index color, int depth) -{ /* This might be called with depth = 1.... */ - if (depth == 1) - return (*dev_proc(dev, copy_mono)) (dev, data, data_x, raster, id, - x, y, width, height, - gx_no_color_index, color); - /* - * Simulate alpha by weighted averaging of RGB values. - * This is very slow, but functionally correct. - */ - { - const byte *row; - gs_memory_t *mem = dev->memory; - int bpp = dev->color_info.depth; - uint in_size = gx_device_raster(dev, false); - byte *lin; - uint out_size; - byte *lout; - int code = 0; - gx_color_value color_rgb[3]; - int ry; - - fit_copy(dev, data, data_x, raster, id, x, y, width, height); - row = data; - out_size = bitmap_raster(width * bpp); - lin = gs_alloc_bytes(mem, in_size, "copy_alpha(lin)"); - lout = gs_alloc_bytes(mem, out_size, "copy_alpha(lout)"); - if (lin == 0 || lout == 0) { - code = gs_note_error(gs_error_VMerror); - goto out; - } - (*dev_proc(dev, map_color_rgb)) (dev, color, color_rgb); - for (ry = y; ry < y + height; row += raster, ++ry) { - byte *line; - int sx, rx; - - declare_line_accum(lout, bpp, x); - - code = (*dev_proc(dev, get_bits)) (dev, ry, lin, &line); - if (code < 0) - break; - for (sx = data_x, rx = x; sx < data_x + width; ++sx, ++rx) { - gx_color_index previous = gx_no_color_index; - gx_color_index composite; - int alpha2, alpha; - - if (depth == 2) /* map 0 - 3 to 0 - 15 */ - alpha = ((row[sx >> 2] >> ((3 - (sx & 3)) << 1)) & 3) * 5; - else - alpha2 = row[sx >> 1], - alpha = (sx & 1 ? alpha2 & 0xf : alpha2 >> 4); - blend:if (alpha == 15) { /* Just write the new color. */ - composite = color; - } else { - if (previous == gx_no_color_index) { /* Extract the old color. */ - if (bpp < 8) { - const uint bit = rx * bpp; - const byte *src = line + (bit >> 3); - - previous = - (*src >> (8 - (bit + bpp))) & - ((1 << bpp) - 1); - } else { - const byte *src = line + (rx * (bpp >> 3)); - - previous = 0; - switch (bpp >> 3) { - case 4: - previous += (gx_color_index) * src++ << 24; - case 3: - previous += (gx_color_index) * src++ << 16; - case 2: - previous += (gx_color_index) * src++ << 8; - case 1: - previous += *src++; - } - } - } - if (alpha == 0) { /* Just write the old color. */ - composite = previous; - } else { /* Blend RGB values. */ - gx_color_value rgb[3]; - - (*dev_proc(dev, map_color_rgb)) (dev, previous, rgb); -#if arch_ints_are_short -# define b_int long -#else -# define b_int int -#endif -#define make_shade(old, clr, alpha, amax) \ - (old) + (((b_int)(clr) - (b_int)(old)) * (alpha) / (amax)) - rgb[0] = make_shade(rgb[0], color_rgb[0], alpha, 15); - rgb[1] = make_shade(rgb[1], color_rgb[1], alpha, 15); - rgb[2] = make_shade(rgb[2], color_rgb[2], alpha, 15); -#undef b_int -#undef make_shade - composite = - (*dev_proc(dev, map_rgb_color)) (dev, rgb[0], - rgb[1], rgb[2]); - if (composite == gx_no_color_index) { /* The device can't represent this color. */ - /* Move the alpha value towards 0 or 1. */ - if (alpha == 7) /* move 1/2 towards 1 */ - ++alpha; - alpha = (alpha & 8) | (alpha >> 1); - goto blend; - } - } - } - line_accum(composite, bpp); - } - line_accum_copy(dev, lout, bpp, x, rx, raster, ry); - } - out:gs_free_object(mem, lout, "copy_alpha(lout)"); - gs_free_object(mem, lin, "copy_alpha(lin)"); - return code; - } -} - -int -gx_no_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_tile_bitmap * texture, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - return_error(gs_error_unknownerror); /* not implemented */ -} - -int -gx_default_fill_mask(gx_device * orig_dev, - const byte * data, int dx, int raster, gx_bitmap_id id, - int x, int y, int w, int h, - const gx_drawing_color * pdcolor, int depth, - gs_logical_operation_t lop, const gx_clip_path * pcpath) -{ - gx_device *dev; - gx_device_clip cdev; - gx_color_index colors[2]; - gx_strip_bitmap *tile; - - if (gx_dc_is_pure(pdcolor)) { - tile = 0; - colors[0] = gx_no_color_index; - colors[1] = gx_dc_pure_color(pdcolor); - } else if (gx_dc_is_binary_halftone(pdcolor)) { - tile = gx_dc_binary_tile(pdcolor); - colors[0] = gx_dc_binary_color0(pdcolor); - colors[1] = gx_dc_binary_color1(pdcolor); - } else - return_error(gs_error_unknownerror); /* not implemented */ - if (pcpath != 0) { - gx_make_clip_path_device(&cdev, pcpath); - cdev.target = orig_dev; - dev = (gx_device *) & cdev; - (*dev_proc(dev, open_device)) (dev); - } else - dev = orig_dev; - if (depth > 1) { - /****** CAN'T DO ROP OR HALFTONE WITH ALPHA ******/ - return (*dev_proc(dev, copy_alpha)) - (dev, data, dx, raster, id, x, y, w, h, colors[1], depth); - } - if (lop != lop_default) { - gx_color_index scolors[2]; - - scolors[0] = gx_device_white(dev); - scolors[1] = gx_device_black(dev); - if (tile == 0) - colors[0] = colors[1]; /* pure color */ - /* - * We want to write only where the mask is a 1, so enable source - * transparency. We have to include S in the operation, - * otherwise S_transparent will be ignored. - */ - return (*dev_proc(dev, strip_copy_rop)) - (dev, data, dx, raster, id, scolors, tile, colors, - x, y, w, h, - gx_dc_phase(pdcolor).x, gx_dc_phase(pdcolor).y, - lop | (rop3_S | lop_S_transparent)); - } - if (tile == 0) { - return (*dev_proc(dev, copy_mono)) - (dev, data, dx, raster, id, x, y, w, h, - gx_no_color_index, colors[1]); - } - /* - * Use the same approach as the default copy_mono (above). We - * should really clip to the intersection of the bounding boxes of - * the device and the clipping path, but it's too much work. - */ - fit_copy(orig_dev, data, dx, raster, id, x, y, w, h); - { - dev_proc_strip_tile_rectangle((*tile_proc)) = - dev_proc(dev, strip_tile_rectangle); - const byte *row = data + (dx >> 3); - int dx_bit = dx & 7; - int wdx = w + dx_bit; - int iy; - - for (row = data, iy = 0; iy < h; row += raster, iy++) { - int ix; - - for (ix = dx_bit; ix < wdx;) { - int i0; - uint b; - uint len; - int code; - - /* Skip 0-bits. */ - b = row[ix >> 3]; - len = byte_bit_run_length[ix & 7][b ^ 0xff]; - if (len) { - ix += ((len - 1) & 7) + 1; - continue; - } - /* Scan 1-bits. */ - i0 = ix; - for (;;) { - b = row[ix >> 3]; - len = byte_bit_run_length[ix & 7][b]; - if (!len) - break; - ix += ((len - 1) & 7) + 1; - if (ix >= wdx) { - ix = wdx; - break; - } - if (len < 8) - break; - } - /* Now color the run from i0 to ix. */ - code = (*tile_proc) - (dev, tile, i0 - dx_bit + x, iy + y, ix - i0, 1, - colors[0], colors[1], - gx_dc_phase(pdcolor).x, gx_dc_phase(pdcolor).y); - if (code < 0) - return code; -#undef row_bit - } - } - } - return 0; -} - -/* Default implementation of strip_tile_rectangle */ -int -gx_default_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1, - int px, int py) -{ /* Fill the rectangle in chunks. */ - int width = tiles->size.x; - int height = tiles->size.y; - int raster = tiles->raster; - int rwidth = tiles->rep_width; - int rheight = tiles->rep_height; - int shift = tiles->shift; - - fit_fill_xy(dev, x, y, w, h); - -#ifdef DEBUG - if (gs_debug_c('t')) { - int ptx, pty; - const byte *ptp = tiles->data; - - dlprintf3("[t]tile %dx%d raster=%d;", - tiles->size.x, tiles->size.y, tiles->raster); - dlprintf6(" x,y=%d,%d w,h=%d,%d p=%d,%d\n", - x, y, w, h, px, py); - dlputs(""); - for (pty = 0; pty < tiles->size.y; pty++) { - dprintf(" "); - for (ptx = 0; ptx < tiles->raster; ptx++) - dprintf1("%3x", *ptp++); - } - dputc('\n'); - } -#endif - - if (dev_proc(dev, tile_rectangle) != gx_default_tile_rectangle) { - if (shift == 0) { /* - * Temporarily patch the tile_rectangle procedure in the - * device so we don't get into a recursion loop if the - * device has a tile_rectangle procedure that conditionally - * calls the strip_tile_rectangle procedure. - */ - dev_proc_tile_rectangle((*tile_proc)) = - dev_proc(dev, tile_rectangle); - int code; - - set_dev_proc(dev, tile_rectangle, gx_default_tile_rectangle); - code = (*tile_proc) - (dev, (const gx_tile_bitmap *)tiles, x, y, w, h, - color0, color1, px, py); - set_dev_proc(dev, tile_rectangle, tile_proc); - return code; - } - /* We should probably optimize this case too, for the benefit */ - /* of window systems, but we don't yet. */ - } { /* - * Note: we can't do the following computations until after - * the fit_fill_xy. - */ - int xoff = - (shift == 0 ? px : - px + (y + py) / rheight * tiles->rep_shift); - int irx = ((rwidth & (rwidth - 1)) == 0 ? /* power of 2 */ - (x + xoff) & (rwidth - 1) : - (x + xoff) % rwidth); - int ry = ((rheight & (rheight - 1)) == 0 ? /* power of 2 */ - (y + py) & (rheight - 1) : - (y + py) % rheight); - int icw = width - irx; - int ch = height - ry; - byte *row = tiles->data + ry * raster; - - dev_proc_copy_mono((*proc_mono)); - dev_proc_copy_color((*proc_color)); - int code; - - if (color0 == gx_no_color_index && color1 == gx_no_color_index) - proc_color = dev_proc(dev, copy_color); - else - proc_color = 0; - - proc_mono = dev_proc(dev, copy_mono); - -/****** SHOULD ALSO PASS id IF COPYING A FULL TILE ******/ -#define real_copy_tile(srcx, tx, ty, tw, th)\ - code =\ - (proc_color != 0 ?\ - (*proc_color)(dev, row, srcx, raster, gx_no_bitmap_id, tx, ty, tw, th) :\ - (*proc_mono)(dev, row, srcx, raster, gx_no_bitmap_id, tx, ty, tw, th, color0, color1));\ - if ( code < 0 ) return_error(code);\ - return_if_interrupt() -#ifdef DEBUG -#define copy_tile(sx, tx, ty, tw, th)\ - if_debug5('t', " copy sx=%d x=%d y=%d w=%d h=%d\n",\ - sx, tx, ty, tw, th);\ - real_copy_tile(sx, tx, ty, tw, th) -#else -#define copy_tile(sx, tx, ty, tw, th)\ - real_copy_tile(sx, tx, ty, tw, th) -#endif - if (ch >= h) { /* Shallow operation */ - if (icw >= w) { /* Just one (partial) tile to transfer. */ - copy_tile(irx, x, y, w, h); - } else { - int ex = x + w; - int fex = ex - width; - int cx = x + icw; - - copy_tile(irx, x, y, icw, h); - while (cx <= fex) { - copy_tile(0, cx, y, width, h); - cx += width; - } - if (cx < ex) { - copy_tile(0, cx, y, ex - cx, h); - } - } - } else if (icw >= w && shift == 0) { /* Narrow operation, no shift */ - int ey = y + h; - int fey = ey - height; - int cy = y + ch; - - copy_tile(irx, x, y, w, ch); - row = tiles->data; - do { - ch = (cy > fey ? ey - cy : height); - copy_tile(irx, x, cy, w, ch); - } - while ((cy += ch) < ey); - } else { /* Full operation. If shift != 0, some scan lines */ - /* may be narrow. We could test shift == 0 in advance */ - /* and use a slightly faster loop, but right now */ - /* we don't bother. */ - int ex = x + w, ey = y + h; - int fex = ex - width, fey = ey - height; - int cx, cy; - - for (cy = y;;) { - if (icw >= w) { - copy_tile(irx, x, cy, w, ch); - } else { - copy_tile(irx, x, cy, icw, ch); - cx = x + icw; - while (cx <= fex) { - copy_tile(0, cx, cy, width, ch); - cx += width; - } - if (cx < ex) { - copy_tile(0, cx, cy, ex - cx, ch); - } - } - if ((cy += ch) >= ey) - break; - ch = (cy > fey ? ey - cy : height); - if ((irx += shift) >= rwidth) - irx -= rwidth; - icw = width - irx; - row = tiles->data; - } - } -#undef copy_tile -#undef real_copy_tile - } - return 0; -} - -int -gx_no_strip_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_strip_bitmap * textures, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - return_error(gs_error_unknownerror); /* not implemented */ -} - -/* ---------------- Unaligned copy operations ---------------- */ - -/* - * Implementing unaligned operations in terms of the standard aligned - * operations requires adjusting the bitmap origin and/or the raster to be - * aligned. Adjusting the origin is simple; adjusting the raster requires - * doing the operation one scan line at a time. - */ -int -gx_copy_mono_unaligned(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - dev_proc_copy_mono((*copy_mono)) = dev_proc(dev, copy_mono); - uint offset = alignment_mod(data, align_bitmap_mod); - int step = raster & (align_bitmap_mod - 1); - - /* Adjust the origin. */ - data -= offset; - dx += offset << 3; - - /* Adjust the raster. */ - if (!step) { /* No adjustment needed. */ - return (*copy_mono) (dev, data, dx, raster, id, - x, y, w, h, zero, one); - } - /* Do the transfer one scan line at a time. */ - { - const byte *p = data; - int d = dx; - int code = 0; - int i; - - for (i = 0; i < h && code >= 0; - ++i, p += raster - step, d += step << 3 - ) - code = (*copy_mono) (dev, p, d, raster, gx_no_bitmap_id, - x, y + i, w, 1, zero, one); - return code; - } -} - -int -gx_copy_color_unaligned(gx_device * dev, const byte * data, - int data_x, int raster, gx_bitmap_id id, - int x, int y, int width, int height) -{ - dev_proc_copy_color((*copy_color)) = dev_proc(dev, copy_color); - int depth = dev->color_info.depth; - uint offset = (uint) (data - (const byte *)0) & (align_bitmap_mod - 1); - int step = raster & (align_bitmap_mod - 1); - - /* - * Adjust the origin. - * We have to do something very special for 24-bit data, - * because that is the only depth that doesn't divide - * align_bitmap_mod exactly. In particular, we need to find - * M*B + R == 0 mod 3, where M is align_bitmap_mod, R is the - * offset value just calculated, and B is an integer unknown; - * the new value of offset will be M*B + R. - */ - if (depth == 24) - offset += (offset % 3) * - (align_bitmap_mod * (3 - (align_bitmap_mod % 3))); - data -= offset; - data_x += (offset << 3) / depth; - - /* Adjust the raster. */ - if (!step) { /* No adjustment needed. */ - return (*copy_color) (dev, data, data_x, raster, id, - x, y, width, height); - } - /* Do the transfer one scan line at a time. */ - { - const byte *p = data; - int d = data_x; - int dstep = (step << 3) / depth; - int code = 0; - int i; - - for (i = 0; i < height && code >= 0; - ++i, p += raster - step, d += dstep - ) - code = (*copy_color) (dev, p, d, raster, gx_no_bitmap_id, - x, y + i, width, 1); - return code; - } -} - -int -gx_copy_alpha_unaligned(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int width, int height, - gx_color_index color, int depth) -{ - dev_proc_copy_alpha((*copy_alpha)) = dev_proc(dev, copy_alpha); - uint offset = (uint) (data - (const byte *)0) & (align_bitmap_mod - 1); - int step = raster & (align_bitmap_mod - 1); - - /* Adjust the origin. */ - data -= offset; - data_x += (offset << 3) / depth; - - /* Adjust the raster. */ - if (!step) { /* No adjustment needed. */ - return (*copy_alpha) (dev, data, data_x, raster, id, - x, y, width, height, color, depth); - } - /* Do the transfer one scan line at a time. */ - { - const byte *p = data; - int d = data_x; - int dstep = (step << 3) / depth; - int code = 0; - int i; - - for (i = 0; i < height && code >= 0; - ++i, p += raster - step, d += dstep - ) - code = (*copy_alpha) (dev, p, d, raster, gx_no_bitmap_id, - x, y + i, width, 1, color, depth); - return code; - } -} diff --git a/pstoraster/gdevddrw.c b/pstoraster/gdevddrw.c deleted file mode 100644 index 713ccd4632..0000000000 --- a/pstoraster/gdevddrw.c +++ /dev/null @@ -1,643 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevddrw.c,v 1.3 2000/10/13 01:04:40 mike Exp $ */ -/* Default polygon and image drawing device procedures */ -#include "math_.h" -#include "memory_.h" -#include "gx.h" -#include "gpcheck.h" -#include "gserrors.h" -#include "gxfixed.h" -#include "gxmatrix.h" -#include "gxdcolor.h" -#include "gxdevice.h" -#include "gxiparam.h" -#include "gxistate.h" - -/* ---------------- Polygon and line drawing ---------------- */ - -/* Define the 'remainder' analogue of fixed_mult_quo. */ -private fixed -fixed_mult_rem(fixed a, fixed b, fixed c) -{ - double prod = (double)a * b; - - return (fixed) (prod - floor(prod / c) * c); -} - -/* - * Fill a trapezoid. Requires: - * {left,right}->start.y <= ybot <= ytop <= {left,right}->end.y. - * Lines where left.x >= right.x will not be drawn. Thanks to Paul Haeberli - * for an early floating point version of this algorithm. - */ -typedef struct trap_line_s { - int di; - fixed df; /* dx/dy ratio = di + df/h */ - fixed ldi, ldf; /* increment per scan line = ldi + ldf/h */ - fixed x, xf; /* current value */ - fixed h; -} trap_line; -int -gx_default_fill_trapezoid(gx_device * dev, const gs_fixed_edge * left, - const gs_fixed_edge * right, fixed ybot, fixed ytop, bool swap_axes, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - const fixed ymin = fixed_pixround(ybot) + fixed_half; - const fixed ymax = fixed_pixround(ytop); - - if (ymin >= ymax) - return 0; /* no scan lines to sample */ - { - int iy = fixed2int_var(ymin); - const int iy1 = fixed2int_var(ymax); - trap_line l, r; - int rxl, rxr, ry; - const fixed - x0l = left->start.x, x1l = left->end.x, x0r = right->start.x, - x1r = right->end.x, dxl = x1l - x0l, dxr = x1r - x0r; - const fixed /* partial pixel offset to first line to sample */ - ysl = ymin - left->start.y, ysr = ymin - right->start.y; - fixed fxl; - bool fill_direct = color_writes_pure(pdevc, lop); - gx_color_index cindex; - - dev_proc_fill_rectangle((*fill_rect)); - int max_rect_height = 1; /* max height to do fill as rectangle */ - int code; - - if_debug2('z', "[z]y=[%d,%d]\n", iy, iy1); - - if (fill_direct) - { - cindex = pdevc->colors.pure; - fill_rect = dev_proc(dev, fill_rectangle); - } - else - { - cindex = 0; - fill_rect = 0; - } - - l.h = left->end.y - left->start.y; - r.h = right->end.y - right->start.y; - l.x = x0l + (fixed_half - fixed_epsilon); - r.x = x0r + (fixed_half - fixed_epsilon); - ry = iy; - -#define fill_trap_rect(x,y,w,h)\ - (fill_direct ?\ - (swap_axes ? (*fill_rect)(dev, y, x, h, w, cindex) :\ - (*fill_rect)(dev, x, y, w, h, cindex)) :\ - swap_axes ? gx_fill_rectangle_device_rop(y, x, h, w, pdevc, dev, lop) :\ - gx_fill_rectangle_device_rop(x, y, w, h, pdevc, dev, lop)) - - /* Compute the dx/dy ratios. */ - /* dx# = dx#i + (dx#f / h#). */ -#define compute_dx(tl, d, ys)\ - if ( d >= 0 )\ - { if ( d < tl.h ) tl.di = 0, tl.df = d;\ - else tl.di = (int)(d / tl.h), tl.df = d - tl.di * tl.h,\ - tl.x += ys * tl.di;\ - }\ - else\ - { if ( (tl.df = d + tl.h) >= 0 /* d >= -tl.h */ ) tl.di = -1, tl.x -= ys;\ - else tl.di = (int)-((tl.h - 1 - d) / tl.h), tl.df = d - tl.di * tl.h,\ - tl.x += ys * tl.di;\ - } - - /* Compute the x offsets at the first scan line to sample. */ - /* We need to be careful in computing ys# * dx#f {/,%} h# */ - /* because the multiplication may overflow. We know that */ - /* all the quantities involved are non-negative, and that */ - /* ys# is usually than 1 (as a fixed, of course); this gives us */ - /* a cheap conservative check for overflow in the multiplication. */ -#define ymult_limit (max_fixed / fixed_1) -#define ymult_quo(ys, tl)\ - (ys < fixed_1 && tl.df < ymult_limit ? ys * tl.df / tl.h :\ - fixed_mult_quo(ys, tl.df, tl.h)) - - /* - * It's worth checking for dxl == dxr, since this is the case - * for parallelograms (including stroked lines). - * Also check for left or right vertical edges. - */ - if (fixed_floor(l.x) == fixed_pixround(x1l)) { /* Left edge is vertical, we don't need to increment. */ - l.di = 0, l.df = 0; - fxl = 0; - } else { - compute_dx(l, dxl, ysl); - fxl = ymult_quo(ysl, l); - l.x += fxl; - } - if (fixed_floor(r.x) == fixed_pixround(x1r)) { /* Right edge is vertical. If both are vertical, */ - /* we have a rectangle. */ - if (l.di == 0 && l.df == 0) - max_rect_height = max_int; - else - r.di = 0, r.df = 0; - } - /* The test for fxl != 0 is required because the right edge */ - /* might cross some pixel centers even if the left edge doesn't. */ - else if (dxr == dxl && fxl != 0) { - if (l.di == 0) - r.di = 0, r.df = l.df; - else /* too hard to do adjustments right */ - compute_dx(r, dxr, ysr); - if (ysr == ysl && r.h == l.h) - r.x += fxl; - else - r.x += ymult_quo(ysr, r); - } else { - compute_dx(r, dxr, ysr); - r.x += ymult_quo(ysr, r); - } - rxl = fixed2int_var(l.x); - rxr = fixed2int_var(r.x); - - /* - * Take a shortcut if we're only sampling a single scan line, - * or if we have a rectangle. - */ - if (iy1 - iy <= max_rect_height) { - iy = iy1; - if_debug2('z', "[z]rectangle, x=[%d,%d]\n", rxl, rxr); - goto last; - } - /* Compute one line's worth of dx/dy. */ - /* dx# * fixed_1 = ld#i + (ld#f / h#). */ -#define compute_ldx(tl, ys)\ - if ( tl.df < ymult_limit )\ - { if ( tl.df == 0 ) /* vertical edge, worth checking for */\ - tl.ldi = int2fixed(tl.di),\ - tl.ldf = 0,\ - tl.xf = -tl.h;\ - else\ - tl.ldi = int2fixed(tl.di) + int2fixed(tl.df) / tl.h,\ - tl.ldf = int2fixed(tl.df) % tl.h,\ - tl.xf = (ys < fixed_1 ? ys * tl.df % tl.h :\ - fixed_mult_rem(ys, tl.df, tl.h)) - tl.h;\ - }\ - else\ - tl.ldi = int2fixed(tl.di) + fixed_mult_quo(fixed_1, tl.df, tl.h),\ - tl.ldf = fixed_mult_rem(fixed_1, tl.df, tl.h),\ - tl.xf = fixed_mult_rem(ys, tl.df, tl.h) - tl.h - compute_ldx(l, ysl); - if (dxr == dxl && ysr == ysl && r.h == l.h) - r.ldi = l.ldi, r.ldf = l.ldf, r.xf = l.xf; - else { - compute_ldx(r, ysr); - } -#undef compute_ldx - - while (++iy != iy1) { - int ixl, ixr; - -#define step_line(tl)\ - tl.x += tl.ldi;\ - if ( (tl.xf += tl.ldf) >= 0 ) tl.xf -= tl.h, tl.x++; - step_line(l); - step_line(r); -#undef step_line - ixl = fixed2int_var(l.x); - ixr = fixed2int_var(r.x); - if (ixl != rxl || ixr != rxr) { - code = fill_trap_rect(rxl, ry, rxr - rxl, iy - ry); - if (code < 0) - goto xit; - rxl = ixl, rxr = ixr, ry = iy; - } - } - last:code = fill_trap_rect(rxl, ry, rxr - rxl, iy - ry); - xit:if (code < 0 && fill_direct) - return_error(code); - return_if_interrupt(); - return code; - } -} - -/* Fill a parallelogram whose points are p, p+a, p+b, and p+a+b. */ -/* We should swap axes to get best accuracy, but we don't. */ -/* We must be very careful to follow the center-of-pixel rule in all cases. */ -int -gx_default_fill_parallelogram(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - fixed t; - fixed qx, qy, ym; - - dev_proc_fill_trapezoid((*fill_trapezoid)); - gs_fixed_edge left, right; - int code; - - /* Ensure ay >= 0, by >= 0. */ - if (ay < 0) - px += ax, py += ay, ax = -ax, ay = -ay; - if (by < 0) - px += bx, py += by, bx = -bx, by = -by; - qx = px + ax + bx; - /* Make a special fast check for rectangles. */ - if ((ay | bx) == 0 || (by | ax) == 0) { /* If a point falls exactly on the middle of a pixel, */ - /* we must round it down, not up. */ - int rx = fixed2int_pixround(px); - int ry = fixed2int_pixround(py); - - /* Exactly one of (ax,bx) and one of (ay,by) is non-zero. */ - int w = fixed2int_pixround(qx) - rx; - - if (w < 0) - rx += w, w = -w; - return gx_fill_rectangle_device_rop(rx, ry, w, - fixed2int_pixround(py + ay + by) - ry, - pdevc, dev, lop); - } - /* - * Not a rectangle. Ensure that the 'a' line is to the left of - * the 'b' line. Testing ax <= bx is neither sufficient nor - * necessary: in general, we need to compare the slopes. - */ -#define swap(r, s) (t = r, r = s, s = t) - if ((ax ^ bx) < 0) { /* In this case, the test ax <= bx is sufficient. */ - if (ax > bx) - swap(ax, bx), swap(ay, by); - } else { /* - * Compare the slopes. We know that ay >= 0, by >= 0, - * and ax and bx have the same sign; the lines are in the - * correct order iff - * ay/ax >= by/bx, or - * ay*bx >= by*ax - * Eventually we can probably find a better way to test this, - * without using floating point. - */ - if ((double)ay * bx < (double)by * ax) - swap(ax, bx), swap(ay, by); - } - fill_trapezoid = dev_proc(dev, fill_trapezoid); - qy = py + ay + by; - left.start.x = right.start.x = px; - left.start.y = right.start.y = py; - left.end.x = px + ax; - left.end.y = py + ay; - right.end.x = px + bx; - right.end.y = py + by; -#define rounded_same(p1, p2)\ - (fixed_pixround(p1) == fixed_pixround(p2)) - if (ay < by) { - if (!rounded_same(py, left.end.y)) { - code = (*fill_trapezoid) (dev, &left, &right, py, left.end.y, - false, pdevc, lop); - if (code < 0) - return code; - } - left.start = left.end; - left.end.x = qx, left.end.y = qy; - ym = right.end.y; - if (!rounded_same(left.start.y, ym)) { - code = (*fill_trapezoid) (dev, &left, &right, left.start.y, ym, - false, pdevc, lop); - if (code < 0) - return code; - } - right.start = right.end; - right.end.x = qx, right.end.y = qy; - } else { - if (!rounded_same(py, right.end.y)) { - code = (*fill_trapezoid) (dev, &left, &right, py, right.end.y, - false, pdevc, lop); - if (code < 0) - return code; - } - right.start = right.end; - right.end.x = qx, right.end.y = qy; - ym = left.end.y; - if (!rounded_same(right.start.y, ym)) { - code = (*fill_trapezoid) (dev, &left, &right, right.start.y, ym, - false, pdevc, lop); - if (code < 0) - return code; - } - left.start = left.end; - left.end.x = qx, left.end.y = qy; - } - if (!rounded_same(ym, qy)) - return (*fill_trapezoid) (dev, &left, &right, ym, qy, - false, pdevc, lop); - else - return 0; -#undef rounded_same -#undef swap -} - -/* Fill a triangle whose points are p, p+a, and p+b. */ -/* We should swap axes to get best accuracy, but we don't. */ -int -gx_default_fill_triangle(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - fixed t; - fixed ym; - - dev_proc_fill_trapezoid((*fill_trapezoid)) = - dev_proc(dev, fill_trapezoid); - gs_fixed_edge left, right; - int code; - - /* Ensure ay >= 0, by >= 0. */ - if (ay < 0) - px += ax, py += ay, bx -= ax, by -= ay, ax = -ax, ay = -ay; - if (by < 0) - px += bx, py += by, ax -= bx, ay -= by, bx = -bx, by = -by; - /* Ensure ay <= by. */ -#define swap(r, s) (t = r, r = s, s = t) - if (ay > by) - swap(ax, bx), swap(ay, by); -#undef swap - /* - * Make a special check for a flat bottom or top, - * which we can handle with a single call on fill_trapezoid. - */ - left.start.x = right.start.x = px; - left.start.y = right.start.y = py; - if (ay == 0) { - /* Flat top */ - if (ax < 0) - left.start.x = px + ax; - else - right.start.x = px + ax; - left.end.x = right.end.x = px + bx; - left.end.y = right.end.y = py + by; - ym = py; - } else if (ay == by) { - /* Flat bottom */ - if (ax < bx) - left.end.x = px + ax, right.end.x = px + bx; - else - left.end.x = px + bx, right.end.x = px + ax; - left.end.y = right.end.y = py + by; - ym = py; - } else { - ym = py + ay; - if (fixed_mult_quo(bx, ay, by) < ax) { - /* The 'b' line is to the left of the 'a' line. */ - left.end.x = px + bx, left.end.y = py + by; - right.end.x = px + ax, right.end.y = py + ay; - code = (*fill_trapezoid) (dev, &left, &right, py, ym, - false, pdevc, lop); - right.start = right.end; - right.end = left.end; - } else { - /* The 'a' line is to the left of the 'b' line. */ - left.end.x = px + ax, left.end.y = py + ay; - right.end.x = px + bx, right.end.y = py + by; - code = (*fill_trapezoid) (dev, &left, &right, py, ym, - false, pdevc, lop); - left.start = left.end; - left.end = right.end; - } - if (code < 0) - return code; - } - return (*fill_trapezoid) (dev, &left, &right, ym, right.end.y, - false, pdevc, lop); -} - -/* Draw a one-pixel-wide line. */ -int -gx_default_draw_thin_line(gx_device * dev, - fixed fx0, fixed fy0, fixed fx1, fixed fy1, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - int ix = fixed2int_var(fx0); - int iy = fixed2int_var(fy0); - int itox = fixed2int_var(fx1); - int itoy = fixed2int_var(fy1); - - return_if_interrupt(); - if (itoy == iy) { /* horizontal line */ - return (ix <= itox ? - gx_fill_rectangle_device_rop(ix, iy, itox - ix + 1, 1, - pdevc, dev, lop) : - gx_fill_rectangle_device_rop(itox, iy, ix - itox + 1, 1, - pdevc, dev, lop) - ); - } - if (itox == ix) { /* vertical line */ - return (iy <= itoy ? - gx_fill_rectangle_device_rop(ix, iy, 1, itoy - iy + 1, - pdevc, dev, lop) : - gx_fill_rectangle_device_rop(ix, itoy, 1, iy - itoy + 1, - pdevc, dev, lop) - ); - } { - fixed h = fy1 - fy0; - fixed w = fx1 - fx0; - fixed tf; - bool swap_axes; - gs_fixed_edge left, right; - -#define fswap(a, b) tf = a, a = b, b = tf - if ((w < 0 ? -w : w) <= (h < 0 ? -h : h)) { - if (h < 0) - fswap(fx0, fx1), fswap(fy0, fy1), - h = -h; - right.start.x = (left.start.x = fx0 - fixed_half) + fixed_1; - right.end.x = (left.end.x = fx1 - fixed_half) + fixed_1; - left.start.y = right.start.y = fy0; - left.end.y = right.end.y = fy1; - swap_axes = false; - } else { - if (w < 0) - fswap(fx0, fx1), fswap(fy0, fy1), - w = -w; - right.start.x = (left.start.x = fy0 - fixed_half) + fixed_1; - right.end.x = (left.end.x = fy1 - fixed_half) + fixed_1; - left.start.y = right.start.y = fx0; - left.end.y = right.end.y = fx1; - swap_axes = true; - } - return (*dev_proc(dev, fill_trapezoid)) (dev, &left, &right, - left.start.y, left.end.y, - swap_axes, pdevc, lop); -#undef fswap - } -} - -/* Stub out the obsolete procedure. */ -int -gx_default_draw_line(gx_device * dev, - int x0, int y0, int x1, int y1, gx_color_index color) -{ - return -1; -} - -/* ---------------- Image drawing ---------------- */ - -/* GC structures for image enumerator */ -public_st_gx_image_enum_common(); - -#define eptr ((gx_image_enum_common_t *)vptr) - -private -ENUM_PTRS_BEGIN(image_enum_common_enum_ptrs) return 0; - -case 0: -return ENUM_OBJ(gx_device_enum_ptr(eptr->dev)); -ENUM_PTRS_END - -private RELOC_PTRS_BEGIN(image_enum_common_reloc_ptrs) -{ - eptr->dev = gx_device_reloc_ptr(eptr->dev, gcst); -} -RELOC_PTRS_END - -#undef eptr - -/* - * gx_default_begin_image is only invoked for ImageType 1 images. However, - * the argument types are different, and if the device provides a - * begin_typed_image procedure, we should use it. See gxdevice.h. - */ -private int -gx_no_begin_image(gx_device * dev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ - return -1; -} -int -gx_default_begin_image(gx_device * dev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ - /* - * Hand off to begin_typed_image, being careful to avoid a - * possible recursion loop. - */ - dev_proc_begin_image((*save_begin_image)) = dev_proc(dev, begin_image); - gs_image_t image; - const gs_image_t *ptim; - int code; - - set_dev_proc(dev, begin_image, gx_no_begin_image); - if (pim->format == format) - ptim = pim; - else { - image = *pim; - image.format = format; - ptim = ℑ - } - code = (*dev_proc(dev, begin_typed_image)) - (dev, pis, NULL, (const gs_image_common_t *)ptim, prect, pdcolor, - pcpath, memory, pinfo); - set_dev_proc(dev, begin_image, save_begin_image); - return code; -} - -int -gx_default_begin_typed_image(gx_device * dev, - const gs_imager_state * pis, const gs_matrix * pmat, - const gs_image_common_t * pic, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ /* - * If this is an ImageType 1 image using the imager's CTM, - * defer to begin_image. - */ - if (pic->type->begin_typed_image == gx_begin_image1) { - const gs_image_t *pim = (const gs_image_t *)pic; - - if (pmat == 0 || - (pis != 0 && !memcmp(pmat, &ctm_only(pis), sizeof(*pmat))) - ) { - int code = (*dev_proc(dev, begin_image)) - (dev, pis, pim, pim->format, prect, pdcolor, - pcpath, memory, pinfo); - - if (code >= 0) - return code; - } - } - return (*pic->type->begin_typed_image) - (dev, pis, pmat, pic, prect, pdcolor, pcpath, memory, pinfo); -} - -int -gx_image_data(gx_image_enum_common_t * info, const byte ** plane_data, - int data_x, uint raster, int height) -{ - int num_planes = info->num_planes; - gx_image_plane_t planes[gs_image_max_components]; - int i; - -#ifdef DEBUG - if (num_planes > gs_image_max_components) { - lprintf2("num_planes=%d > gs_image_max_components=%d!\n", - num_planes, gs_image_max_components); - return_error(gs_error_Fatal); - } -#endif - for (i = 0; i < num_planes; ++i) { - planes[i].data = plane_data[i]; - planes[i].data_x = data_x; - planes[i].raster = raster; - } - return gx_image_plane_data(info, planes, height); -} - -int -gx_image_plane_data(gx_image_enum_common_t * info, - const gx_image_plane_t * planes, int height) -{ - return info->procs->plane_data(info->dev, info, planes, height); -} - -int -gx_image_end(gx_image_enum_common_t * info, bool draw_last) -{ - return info->procs->end_image(info->dev, info, draw_last); -} - -/* Backward compatibility for obsolete driver procedures. */ - -int -gx_default_image_data(gx_device *dev, gx_image_enum_common_t * info, - const byte ** plane_data, - int data_x, uint raster, int height) -{ - return gx_image_data(info, plane_data, data_x, raster, height); -} - -int -gx_default_end_image(gx_device *dev, gx_image_enum_common_t * info, - bool draw_last) -{ - return gx_image_end(info, draw_last); -} diff --git a/pstoraster/gdevdflt.c b/pstoraster/gdevdflt.c deleted file mode 100644 index 6979df50c1..0000000000 --- a/pstoraster/gdevdflt.c +++ /dev/null @@ -1,270 +0,0 @@ -/* Copyright (C) 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevdflt.c,v 1.2 2000/03/08 23:14:22 mike Exp $ */ -/* Default device implementation */ -#include "gx.h" -#include "gserrors.h" -#include "gsropt.h" -#include "gxcomp.h" -#include "gxdevice.h" -#include "gxdevmem.h" -#undef mdev - -/* ---------------- Default device procedures ---------------- */ - -/* Fill in NULL procedures in a device procedure record. */ -void -gx_device_fill_in_procs(register gx_device * dev) -{ - gx_device_set_procs(dev); - fill_dev_proc(dev, open_device, gx_default_open_device); - fill_dev_proc(dev, get_initial_matrix, gx_default_get_initial_matrix); - fill_dev_proc(dev, sync_output, gx_default_sync_output); - fill_dev_proc(dev, output_page, gx_default_output_page); - fill_dev_proc(dev, close_device, gx_default_close_device); - fill_dev_proc(dev, map_rgb_color, gx_default_map_rgb_color); - fill_dev_proc(dev, map_color_rgb, gx_default_map_color_rgb); - /* NOT fill_rectangle */ - fill_dev_proc(dev, tile_rectangle, gx_default_tile_rectangle); - fill_dev_proc(dev, copy_mono, gx_default_copy_mono); - fill_dev_proc(dev, copy_color, gx_default_copy_color); - fill_dev_proc(dev, obsolete_draw_line, gx_default_draw_line); - fill_dev_proc(dev, get_bits, gx_default_get_bits); - fill_dev_proc(dev, get_params, gx_default_get_params); - fill_dev_proc(dev, put_params, gx_default_put_params); - fill_dev_proc(dev, map_cmyk_color, gx_default_map_cmyk_color); - fill_dev_proc(dev, get_xfont_procs, gx_default_get_xfont_procs); - fill_dev_proc(dev, get_xfont_device, gx_default_get_xfont_device); - fill_dev_proc(dev, map_rgb_alpha_color, gx_default_map_rgb_alpha_color); - fill_dev_proc(dev, get_page_device, gx_default_get_page_device); - fill_dev_proc(dev, get_alpha_bits, gx_default_get_alpha_bits); - fill_dev_proc(dev, copy_alpha, gx_default_copy_alpha); - fill_dev_proc(dev, get_band, gx_default_get_band); - fill_dev_proc(dev, copy_rop, gx_default_copy_rop); - fill_dev_proc(dev, fill_path, gx_default_fill_path); - fill_dev_proc(dev, stroke_path, gx_default_stroke_path); - fill_dev_proc(dev, fill_mask, gx_default_fill_mask); - fill_dev_proc(dev, fill_trapezoid, gx_default_fill_trapezoid); - fill_dev_proc(dev, fill_parallelogram, gx_default_fill_parallelogram); - fill_dev_proc(dev, fill_triangle, gx_default_fill_triangle); - fill_dev_proc(dev, draw_thin_line, gx_default_draw_thin_line); - fill_dev_proc(dev, begin_image, gx_default_begin_image); - /* - * We always replace image_data and end_image with the new - * procedures, and, if in a DEBUG configuration, print a warning - * if the definitions aren't the default ones. - */ -#ifdef DEBUG -# define CHECK_NON_DEFAULT(proc, default, procname)\ - BEGIN\ - if ( dev_proc(dev, proc) != NULL && dev_proc(dev, proc) != default )\ - dprintf2("**** Warning: device %s implements obsolete procedure %s\n",\ - dev->dname, procname);\ - END -#else -# define CHECK_NON_DEFAULT(proc, default, procname)\ - DO_NOTHING -#endif - CHECK_NON_DEFAULT(image_data, gx_default_image_data, "image_data"); - set_dev_proc(dev, image_data, gx_default_image_data); - CHECK_NON_DEFAULT(end_image, gx_default_end_image, "end_image"); - set_dev_proc(dev, end_image, gx_default_end_image); -#undef CHECK_NON_DEFAULT - fill_dev_proc(dev, strip_tile_rectangle, gx_default_strip_tile_rectangle); - fill_dev_proc(dev, strip_copy_rop, gx_default_strip_copy_rop); - fill_dev_proc(dev, get_clipping_box, gx_default_get_clipping_box); - fill_dev_proc(dev, begin_typed_image, gx_default_begin_typed_image); - fill_dev_proc(dev, get_bits_rectangle, gx_default_get_bits_rectangle); - fill_dev_proc(dev, map_color_rgb_alpha, gx_default_map_color_rgb_alpha); - fill_dev_proc(dev, create_compositor, gx_default_create_compositor); - fill_dev_proc(dev, get_hardware_params, gx_default_get_hardware_params); - fill_dev_proc(dev, text_begin, gx_default_text_begin); -} - -int -gx_default_open_device(gx_device * dev) -{ - return 0; -} - -/* Get the initial matrix for a device with inverted Y. */ -/* This includes essentially all printers and displays. */ -void -gx_default_get_initial_matrix(gx_device * dev, register gs_matrix * pmat) -{ - pmat->xx = dev->HWResolution[0] / 72.0; /* x_pixels_per_inch */ - pmat->xy = 0; - pmat->yx = 0; - pmat->yy = dev->HWResolution[1] / -72.0; /* y_pixels_per_inch */ -/****** tx/y is WRONG for devices with ******/ -/****** arbitrary initial matrix ******/ - pmat->tx = 0; - pmat->ty = dev->height; -} -/* Get the initial matrix for a device with upright Y. */ -/* This includes just a few printers and window systems. */ -void -gx_upright_get_initial_matrix(gx_device * dev, register gs_matrix * pmat) -{ - pmat->xx = dev->HWResolution[0] / 72.0; /* x_pixels_per_inch */ - pmat->xy = 0; - pmat->yx = 0; - pmat->yy = dev->HWResolution[1] / 72.0; /* y_pixels_per_inch */ -/****** tx/y is WRONG for devices with ******/ -/****** arbitrary initial matrix ******/ - pmat->tx = 0; - pmat->ty = 0; -} - -int -gx_default_sync_output(gx_device * dev) -{ - return 0; -} - -int -gx_default_output_page(gx_device * dev, int num_copies, int flush) -{ - return (*dev_proc(dev, sync_output)) (dev); -} - -int -gx_default_close_device(gx_device * dev) -{ - return 0; -} - -const gx_xfont_procs * -gx_default_get_xfont_procs(gx_device * dev) -{ - return NULL; -} - -gx_device * -gx_default_get_xfont_device(gx_device * dev) -{ - return dev; -} - -gx_device * -gx_default_get_page_device(gx_device * dev) -{ - return NULL; -} -gx_device * -gx_page_device_get_page_device(gx_device * dev) -{ - return dev; -} - -int -gx_default_get_alpha_bits(gx_device * dev, graphics_object_type type) -{ - return 1; -} - -int -gx_default_get_band(gx_device * dev, int y, int *band_start) -{ - return 0; -} - -void -gx_default_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox) -{ - pbox->p.x = 0; - pbox->p.y = 0; - pbox->q.x = int2fixed(dev->width); - pbox->q.y = int2fixed(dev->height); -} -void -gx_get_largest_clipping_box(gx_device * dev, gs_fixed_rect * pbox) -{ - pbox->p.x = min_fixed; - pbox->p.y = min_fixed; - pbox->q.x = max_fixed; - pbox->q.y = max_fixed; -} - -int -gx_no_create_compositor(gx_device * dev, gx_device ** pcdev, - const gs_composite_t * pcte, const gs_imager_state * pis, gs_memory_t * memory) -{ - return_error(gs_error_unknownerror); /* not implemented */ -} -int -gx_default_create_compositor(gx_device * dev, gx_device ** pcdev, - const gs_composite_t * pcte, const gs_imager_state * pis, gs_memory_t * memory) -{ - return (*pcte->type->procs.create_default_compositor) - (pcte, pcdev, dev, pis, memory); -} -int -gx_non_imaging_create_compositor(gx_device * dev, gx_device ** pcdev, - const gs_composite_t * pcte, const gs_imager_state * pis, gs_memory_t * memory) -{ - *pcdev = dev; - return 0; -} - -/* The following is not really a device procedure. See gxdevice.h. */ - -/* Create an ordinary memory device for page or band buffering. */ -int -gx_default_make_buffer_device(gx_device_memory * mdev, - gx_device * target, gs_memory_t * mem, bool for_band) -{ - const gx_device_memory *mdproto = - gdev_mem_device_for_bits(target->color_info.depth); - - if (mdproto == 0) - return_error(gs_error_rangecheck); - if (target == (gx_device *) mdev) - assign_dev_procs(mdev, mdproto); - else - gs_make_mem_device(mdev, mdproto, mem, (for_band ? 1 : 0), - (target == (gx_device *) mdev ? 0 : target)); - return 0; -} - -/* ---------------- Default per-instance procedures ---------------- */ - -int -gx_default_install(gx_device * dev, gs_state * pgs) -{ - return 0; -} - -int -gx_default_begin_page(gx_device * dev, gs_state * pgs) -{ - return 0; -} - -int -gx_default_end_page(gx_device * dev, int reason, gs_state * pgs) -{ - return (reason != 2 ? 1 : 0); -} diff --git a/pstoraster/gdevdgbr.c b/pstoraster/gdevdgbr.c deleted file mode 100644 index b97b0cf66c..0000000000 --- a/pstoraster/gdevdgbr.c +++ /dev/null @@ -1,586 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevdgbr.c,v 1.1 2000/03/08 23:14:22 mike Exp $ */ -/* Default implementation of device get_bits[_rectangle] */ -#include "gx.h" -#include "gserrors.h" -#include "gxdevice.h" -#include "gxdevmem.h" -#include "gxgetbit.h" -#include "gxlum.h" -#include "gdevmem.h" - -int -gx_no_get_bits(gx_device * dev, int y, byte * data, byte ** actual_data) -{ - return_error(gs_error_unknownerror); -} -int -gx_default_get_bits(gx_device * dev, int y, byte * data, byte ** actual_data) -{ /* - * Hand off to get_bits_rectangle, being careful to avoid a - * possible recursion loop. - */ - dev_proc_get_bits((*save_get_bits)) = dev_proc(dev, get_bits); - gs_int_rect rect; - gs_get_bits_params_t params; - int code; - - rect.p.x = 0, rect.p.y = y; - rect.q.x = dev->width, rect.q.y = y + 1; - params.options = - (actual_data ? GB_RETURN_POINTER : 0) | GB_RETURN_COPY | - (GB_ALIGN_STANDARD | GB_OFFSET_0 | GB_RASTER_STANDARD | - /* No depth specified, we always use native colors. */ - GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE); - params.x_offset = 0; - params.raster = bitmap_raster(dev->width * dev->color_info.depth); - params.data[0] = data; - set_dev_proc(dev, get_bits, gx_no_get_bits); - code = (*dev_proc(dev, get_bits_rectangle)) - (dev, &rect, ¶ms, NULL); - if (actual_data) - *actual_data = params.data[0]; - set_dev_proc(dev, get_bits, save_get_bits); - return code; -} - -/* - * Determine whether we can satisfy a request by simply using the stored - * representation. - */ -private bool -requested_includes_stored(gs_get_bits_options_t requested, - gs_get_bits_options_t stored) -{ - gs_get_bits_options_t both = requested & stored; - - if (!(both & GB_PACKING_ALL)) - return false; - if (both & GB_COLORS_NATIVE) - return true; - if (both & GB_COLORS_STANDARD_ALL) { - if ((both & GB_ALPHA_ALL) && (both & GB_DEPTH_ALL)) - return true; - } - return false; -} - -/* - * Try to implement get_bits_rectangle by returning a pointer. - * Note that dev is used only for computing the default raster - * and for color_info.depth. - * This routine does not check x or h for validity. - */ -int -gx_get_bits_return_pointer(gx_device * dev, int x, int h, - gs_get_bits_params_t * params, gs_get_bits_options_t stored, - byte * stored_base) -{ - gs_get_bits_options_t options = params->options; - - if (!(options & GB_RETURN_POINTER) || - !requested_includes_stored(options, stored) - ) - return -1; - /* - * See whether we can return the bits in place. Note that even if - * offset_any isn't set, x_offset and x don't have to be equal: their - * bit offsets only have to match modulo align_bitmap_mod * 8 (to - * preserve alignment) if align_any isn't set, or mod 8 (since - * byte alignment is always required) if align_any is set. - */ - { - int depth = dev->color_info.depth; - uint dev_raster = gx_device_raster(dev, 1); - uint raster = - (options & (GB_RASTER_STANDARD | GB_RASTER_ANY) ? dev_raster : - params->raster); - - if (h <= 1 || raster == dev_raster) { - int x_offset = - (options & GB_OFFSET_ANY ? x : - options & GB_OFFSET_0 ? 0 : params->x_offset); - - if (x_offset == x) { - params->data[0] = stored_base; - params->x_offset = x; - } else { - uint align_mod = - (options & GB_ALIGN_ANY ? 8 : align_bitmap_mod * 8); - int bit_offset = x - x_offset; - int bytes; - - if (bit_offset & (align_mod - 1)) - return -1; /* can't align */ - if (depth & (depth - 1)) { - /* step = lcm(depth, align_mod) */ - int step = depth / igcd(depth, align_mod) * align_mod; - - bytes = bit_offset / step * step; - } else { - /* Use a faster algorithm if depth is a power of 2. */ - bytes = bit_offset & (-depth & -align_mod); - } - params->data[0] = stored_base + arith_rshift(bytes, 3); - params->x_offset = (bit_offset - bytes) / depth; - } - params->options = - GB_ALIGN_STANDARD | GB_RETURN_POINTER | GB_RASTER_STANDARD | - GB_PACKING_CHUNKY | stored | - (params->x_offset == 0 ? GB_OFFSET_0 : GB_OFFSET_SPECIFIED); - return 0; - } - } - return -1; -} - -/* - * Convert pixels between representations, primarily for get_bits_rectangle. - * stored indicates how the data are actually stored, and includes: - * - one option from the GB_PACKING group; - * - if h > 1, one option from the GB_RASTER group; - * - optionally (and normally), GB_COLORS_NATIVE; - * - optionally, one option each from the GB_COLORS_STANDARD, GB_DEPTH, - * and GB_ALPHA groups. - * Note that dev is used only for color mapping. This routine assumes that - * the stored data are aligned. - * - * Note: this routine does not check x, w, h for validity. - */ -int -gx_get_bits_copy(gx_device * dev, int x, int w, int h, - gs_get_bits_params_t * params, gs_get_bits_options_t stored, - const byte * src_base, uint dev_raster) -{ - gs_get_bits_options_t options = params->options; - byte *data = params->data[0]; - int depth = dev->color_info.depth; - int bit_x = x * depth; - const byte *src = src_base; - - /* - * If the stored representation matches a requested representation, - * we can copy the data without any transformations. - */ - bool direct_copy = requested_includes_stored(options, stored); - - /* - * The request must include GB_PACKING_CHUNKY, GB_RETURN_COPY, - * and an offset and raster specification. - */ - if ((~options & (GB_PACKING_CHUNKY | GB_RETURN_COPY)) || - !(options & (GB_OFFSET_0 | GB_OFFSET_SPECIFIED)) || - !(options & (GB_RASTER_STANDARD | GB_RASTER_SPECIFIED)) - ) - return_error(gs_error_rangecheck); - { - int x_offset = (options & GB_OFFSET_0 ? 0 : params->x_offset); - int end_bit = (x_offset + w) * depth; - uint std_raster = - (options & GB_ALIGN_STANDARD ? bitmap_raster(end_bit) : - (end_bit + 7) >> 3); - uint raster = - (options & GB_RASTER_STANDARD ? std_raster : params->raster); - int dest_bit_x = x_offset * depth; - int skew = bit_x - dest_bit_x; - - /* - * If the bit positions line up, use bytes_copy_rectangle. - * Since bytes_copy_rectangle doesn't require alignment, - * the bit positions only have to match within a byte, - * not within align_bitmap_mod bytes. - */ - if (!(skew & 7) && direct_copy) { - int bit_w = w * depth; - - bytes_copy_rectangle(data + (dest_bit_x >> 3), raster, - src + (bit_x >> 3), dev_raster, - ((bit_x + bit_w + 7) >> 3) - (bit_x >> 3), h); - } else if (direct_copy) { - /* - * Use the logic already in mem_mono_copy_mono to copy the - * bits to the destination. We do this one line at a time, - * to avoid having to allocate a line pointer table. - */ - gx_device_memory tdev; - byte *line_ptr = data; - - tdev.line_ptrs = &tdev.base; - for (; h > 0; line_ptr += raster, src += dev_raster, --h) { - /* Make sure the destination is aligned. */ - int align = alignment_mod(line_ptr, align_bitmap_mod); - - tdev.base = line_ptr - align; - (*dev_proc(&mem_mono_device, copy_mono)) - ((gx_device *) & tdev, src, bit_x, dev_raster, gx_no_bitmap_id, - dest_bit_x + (align << 3), 0, w, 1, - (gx_color_index) 0, (gx_color_index) 1); - } - } else if (options & ~stored & GB_COLORS_NATIVE) { - /* - * Convert standard colors to native. Note that the source - * may have depths other than 8 bits per component. - */ - int dest_bit_offset = x_offset * depth; - byte *dest_line = data + (dest_bit_offset >> 3); - int ncolors = - (stored & GB_COLORS_RGB ? 3 : stored & GB_COLORS_CMYK ? 4 : - stored & GB_COLORS_GRAY ? 1 : -1); - int ncomp = ncolors + - ((stored & (GB_ALPHA_FIRST | GB_ALPHA_LAST)) != 0); - int src_depth = GB_OPTIONS_DEPTH(stored); - int src_bit_offset = x * src_depth * ncomp; - const byte *src_line = src_base + (src_bit_offset >> 3); - gx_color_value src_max = (1 << src_depth) - 1; - -#define v2cv(value) ((ulong)(value) * gx_max_color_value / src_max) - gx_color_value alpha_default = src_max; - - options &= ~GB_COLORS_ALL | GB_COLORS_NATIVE; - for (; h > 0; dest_line += raster, src_line += dev_raster, --h) { - int i; - - sample_load_declare_setup(src, sbit, src_line, - src_bit_offset & 7, src_depth); - sample_store_declare_setup(dest, dbit, dbyte, dest_line, - dest_bit_offset & 7, depth); - - for (i = 0; i < w; ++i) { - int j; - gx_color_value v[4], va = alpha_default; - gx_color_index pixel; - - /* Fetch the source data. */ - if (stored & GB_ALPHA_FIRST) { - sample_load_next16(va, src, sbit, src_depth); - va = v2cv(va); - } - for (j = 0; j < ncolors; ++j) { - gx_color_value vj; - - sample_load_next16(vj, src, sbit, src_depth); - v[j] = v2cv(vj); - } - if (stored & GB_ALPHA_LAST) { - sample_load_next16(va, src, sbit, src_depth); - va = v2cv(va); - } - /* Convert and store the pixel value. */ - switch (ncolors) { - case 1: - v[2] = v[1] = v[0]; - case 3: - pixel = (*dev_proc(dev, map_rgb_alpha_color)) - (dev, v[0], v[1], v[2], va); - break; - case 4: - /****** NO ALPHA FOR CMYK ******/ - pixel = (*dev_proc(dev, map_cmyk_color)) - (dev, v[0], v[1], v[2], v[3]); - break; - default: - return_error(gs_error_rangecheck); - } - sample_store_next32(pixel, dest, dbit, depth, dbyte); - } - sample_store_flush(dest, dbit, depth, dbyte); - } - } else if (!(options & GB_DEPTH_8)) { - /* - * We don't support general depths yet, or conversion between - * different formats. Punt. - */ - return_error(gs_error_rangecheck); - } else { - /* - * We have to do some conversion to each pixel. This is the - * slowest, most general case. - */ - int src_bit_offset = x * depth; - const byte *src_line = src_base + (src_bit_offset >> 3); - int ncomp = - (options & (GB_ALPHA_FIRST | GB_ALPHA_LAST) ? 4 : 3); - byte *dest_line = data + x_offset * ncomp; - - /* Pick the representation that's most likely to be useful. */ - if (options & GB_COLORS_RGB) - options &= ~GB_COLORS_STANDARD_ALL | GB_COLORS_RGB; - else if (options & GB_COLORS_CMYK) - options &= ~GB_COLORS_STANDARD_ALL | GB_COLORS_CMYK; - else if (options & GB_COLORS_GRAY) - options &= ~GB_COLORS_STANDARD_ALL | GB_COLORS_GRAY; - else - return_error(gs_error_rangecheck); - for (; h > 0; dest_line += raster, src_line += dev_raster, --h) { - int i; - - sample_load_declare_setup(src, bit, src_line, src_bit_offset & 7, - depth); - byte *dest = dest_line; - - for (i = 0; i < w; ++i) { - gx_color_index pixel = 0; - gx_color_value rgba[4]; - - sample_load_next32(pixel, src, bit, depth); - (*dev_proc(dev, map_color_rgb_alpha)) (dev, pixel, rgba); - if (options & GB_ALPHA_FIRST) - *dest++ = gx_color_value_to_byte(rgba[3]); - /* Convert to the requested color space. */ - if (options & GB_COLORS_RGB) { - dest[0] = gx_color_value_to_byte(rgba[0]); - dest[1] = gx_color_value_to_byte(rgba[1]); - dest[2] = gx_color_value_to_byte(rgba[2]); - dest += 3; - } else if (options & GB_COLORS_CMYK) { - /* Use the standard RGB to CMYK algorithm, */ - /* with maximum black generation and undercolor removal. */ - gx_color_value white = max(rgba[0], max(rgba[1], rgba[2])); - - dest[0] = gx_color_value_to_byte(white - rgba[0]); - dest[1] = gx_color_value_to_byte(white - rgba[1]); - dest[2] = gx_color_value_to_byte(white - rgba[2]); - dest[3] = gx_color_value_to_byte(gx_max_color_value - white); - dest += 4; - } else { /* GB_COLORS_GRAY */ - /* Use the standard RGB to Gray algorithm. */ - *dest++ = gx_color_value_to_byte( - ((rgba[0] * (ulong) lum_red_weight) + - (rgba[1] * (ulong) lum_green_weight) + - (rgba[2] * (ulong) lum_blue_weight) + - (lum_all_weights / 2)) - / lum_all_weights); - } - if (options & GB_ALPHA_LAST) - *dest++ = gx_color_value_to_byte(rgba[3]); - } - } - } - params->options = - (options & (GB_COLORS_ALL | GB_ALPHA_ALL)) | GB_PACKING_CHUNKY | - (options & GB_COLORS_NATIVE ? 0 : options & GB_DEPTH_ALL) | - (options & GB_ALIGN_STANDARD ? GB_ALIGN_STANDARD : GB_ALIGN_ANY) | - GB_RETURN_COPY | - (x_offset == 0 ? GB_OFFSET_0 : GB_OFFSET_SPECIFIED) | - (raster == std_raster ? GB_RASTER_STANDARD : GB_RASTER_SPECIFIED); - } - return 0; -} - -int -gx_no_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - return_error(gs_error_unknownerror); -} -int -gx_default_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - dev_proc_get_bits_rectangle((*save_get_bits_rectangle)) = - dev_proc(dev, get_bits_rectangle); - int depth = dev->color_info.depth; - uint min_raster = (dev->width * depth + 7) >> 3; - gs_get_bits_options_t options = params->options; - int code; - - /* Avoid a recursion loop. */ - set_dev_proc(dev, get_bits_rectangle, gx_no_get_bits_rectangle); - /* - * If the parameters are right, try to call get_bits directly. Note - * that this may fail if a device only implements get_bits_rectangle - * (not get_bits) for a limited set of options. Note also that this - * must handle the case of the recursive call from within - * get_bits_rectangle (see below): because of this, and only because - * of this, it must handle partial scan lines. - */ - if (prect->q.y == prect->p.y + 1 && - !(~options & - (GB_RETURN_COPY | GB_PACKING_CHUNKY | GB_COLORS_NATIVE)) && - (options & (GB_ALIGN_STANDARD | GB_ALIGN_ANY)) && - ((options & (GB_OFFSET_0 | GB_OFFSET_ANY)) || - ((options & GB_OFFSET_SPECIFIED) && params->x_offset == 0)) && - ((options & (GB_RASTER_STANDARD | GB_RASTER_ANY)) || - ((options & GB_RASTER_SPECIFIED) && - params->raster >= min_raster)) && - unread == NULL - ) { - byte *data = params->data[0]; - byte *row = data; - - if (!(prect->p.x == 0 && prect->q.x == dev->width)) { - /* Allocate an intermediate row buffer. */ - row = gs_alloc_bytes(dev->memory, min_raster, - "gx_default_get_bits_rectangle"); - - if (row == 0) { - code = gs_note_error(gs_error_VMerror); - goto ret; - } - } - code = (*dev_proc(dev, get_bits)) - (dev, prect->p.y, row, ¶ms->data[0]); - if (code >= 0) { - if (row != data) { - if (prect->p.x == 0 && params->data[0] != row) { - /* - * get_bits returned an appropriate pointer: we can - * avoid doing any copying. - */ - DO_NOTHING; - } else { - /* Copy the partial row into the supplied buffer. */ - int width_bits = (prect->q.x - prect->p.x) * depth; - gx_device_memory tdev; - - tdev.width = width_bits; - tdev.height = 1; - tdev.line_ptrs = &tdev.base; - tdev.base = data; - code = (*dev_proc(&mem_mono_device, copy_mono)) - ((gx_device *) & tdev, params->data[0], prect->p.x * depth, - min_raster, gx_no_bitmap_id, 0, 0, width_bits, 1, - (gx_color_index) 0, (gx_color_index) 1); - params->data[0] = data; - } - gs_free_object(dev->memory, row, - "gx_default_get_bits_rectangle"); - } - params->options = - GB_ALIGN_STANDARD | GB_OFFSET_0 | GB_PACKING_CHUNKY | - GB_ALPHA_NONE | GB_COLORS_NATIVE | GB_RASTER_STANDARD | - (params->data[0] == data ? GB_RETURN_COPY : GB_RETURN_POINTER); - goto ret; - } - } { - /* Do the transfer row-by-row using a buffer. */ - int x = prect->p.x, w = prect->q.x - x; - int bits_per_pixel = depth; - byte *row; - - if (options & GB_COLORS_STANDARD_ALL) { - /* - * Make sure the row buffer can hold the standard color - * representation, in case the device decides to use it. - */ - int bpc = GB_OPTIONS_MAX_DEPTH(options); - int nc = - (options & GB_COLORS_CMYK ? 4 : - options & GB_COLORS_RGB ? 3 : 1) + - (options & (GB_ALPHA_ALL - GB_ALPHA_NONE) ? 1 : 0); - int bpp = bpc * nc; - - if (bpp > bits_per_pixel) - bits_per_pixel = bpp; - } - row = gs_alloc_bytes(dev->memory, (bits_per_pixel * w + 7) >> 3, - "gx_default_get_bits_rectangle"); - if (row == 0) { - code = gs_note_error(gs_error_VMerror); - } else { - uint dev_raster = gx_device_raster(dev, true); - uint raster = - (options & GB_RASTER_SPECIFIED ? params->raster : - options & GB_ALIGN_STANDARD ? bitmap_raster(depth * w) : - (depth * w + 7) >> 3); - gs_int_rect rect; - gs_get_bits_params_t copy_params; - gs_get_bits_options_t copy_options = - GB_ALIGN_ANY | (GB_RETURN_COPY | GB_RETURN_POINTER) | - (GB_OFFSET_0 | GB_OFFSET_ANY) | - (GB_RASTER_STANDARD | GB_RASTER_ANY) | GB_PACKING_CHUNKY | - GB_COLORS_NATIVE | (options & (GB_DEPTH_ALL | GB_COLORS_ALL)) | - GB_ALPHA_ALL; - byte *dest = params->data[0]; - int y; - - rect.p.x = x, rect.q.x = x + w; - code = 0; - for (y = prect->p.y; y < prect->q.y; ++y) { - rect.p.y = y, rect.q.y = y + 1; - copy_params.options = copy_options; - copy_params.data[0] = row; - code = (*save_get_bits_rectangle) - (dev, &rect, ©_params, NULL); - if (code < 0) - break; - if (copy_params.options & GB_OFFSET_0) - copy_params.x_offset = 0; - params->data[0] = dest + (y - prect->p.y) * raster; - code = gx_get_bits_copy(dev, copy_params.x_offset, w, 1, - params, copy_params.options, - copy_params.data[0], dev_raster); - if (code < 0) - break; - } - gs_free_object(dev->memory, row, "gx_default_get_bits_rectangle"); - params->data[0] = dest; - } - } - ret:set_dev_proc(dev, get_bits_rectangle, save_get_bits_rectangle); - return (code < 0 ? code : 0); -} - -/* ------ Debugging printout ------ */ - -#ifdef DEBUG - -void -debug_print_gb_options(gx_bitmap_format_t options) -{ - static const char *const option_names[] = - { - GX_BITMAP_FORMAT_NAMES - }; - const char *prev = " "; - int i; - - dlprintf1("0x%lx", (ulong) options); - for (i = 0; i < sizeof(options) * 8; ++i) - if ((options >> i) & 1) { - dprintf2("%c%s", - (!memcmp(prev, option_names[i], 3) ? '|' : ','), - option_names[i]); - prev = option_names[i]; - } - dputc('\n'); -} - -void -debug_print_gb_params(gs_get_bits_params_t * params) -{ - gs_get_bits_options_t options = params->options; - - debug_print_gb_options(options); - dprintf1("data[0]=0x%lx", (ulong) params->data[0]); - if (options & GB_OFFSET_SPECIFIED) - dprintf1(" x_offset=%d", params->x_offset); - if (options & GB_RASTER_SPECIFIED) - dprintf1(" raster=%u", params->raster); - dputc('\n'); -} - -#endif /* DEBUG */ diff --git a/pstoraster/gdevhit.c b/pstoraster/gdevhit.c deleted file mode 100644 index d31272da06..0000000000 --- a/pstoraster/gdevhit.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevhit.c,v 1.1 2000/03/08 23:14:23 mike Exp $ */ -/* Hit detection device */ -#include "std.h" -#include "gserror.h" -#include "gserrors.h" -#include "gstypes.h" -#include "gsmemory.h" -#include "gxdevice.h" - -/* Define the value returned for a detected hit. */ -const int gs_hit_detected = gs_error_hit_detected; - -/* - * Define a minimal device for insideness testing. - * It returns e_hit whenever it is asked to actually paint any pixels. - */ -private dev_proc_fill_rectangle(hit_fill_rectangle); -const gx_device gs_hit_device = -{std_device_std_body(gx_device, 0, "hit detector", - 0, 0, 1, 1), - {NULL, /* open_device */ - NULL, /* get_initial_matrix */ - NULL, /* sync_output */ - NULL, /* output_page */ - NULL, /* close_device */ - gx_default_map_rgb_color, - gx_default_map_color_rgb, - hit_fill_rectangle, - NULL, /* tile_rectangle */ - NULL, /* copy_mono */ - NULL, /* copy_color */ - gx_default_draw_line, - NULL, /* get_bits */ - NULL, /* get_params */ - NULL, /* put_params */ - gx_default_map_cmyk_color, - NULL, /* get_xfont_procs */ - NULL, /* get_xfont_device */ - gx_default_map_rgb_alpha_color, - gx_default_get_page_device, - gx_default_get_alpha_bits, - NULL, /* copy_alpha */ - gx_default_get_band, - NULL, /* copy_rop */ - gx_default_fill_path, - NULL, /* stroke_path */ - NULL, /* fill_mask */ - gx_default_fill_trapezoid, - gx_default_fill_parallelogram, - gx_default_fill_triangle, - gx_default_draw_thin_line, - gx_default_begin_image, - gx_default_image_data, - gx_default_end_image, - gx_default_strip_tile_rectangle, - gx_default_strip_copy_rop, - gx_get_largest_clipping_box, - gx_default_begin_typed_image, - NULL, /* get_bits_rectangle */ - gx_default_map_color_rgb_alpha, - gx_non_imaging_create_compositor, - NULL /* get_hardware_params */ - } -}; - -/* Test for a hit when filling a rectangle. */ -private int -hit_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - if (w > 0 && h > 0) - return_error(gs_error_hit_detected); - return 0; -} diff --git a/pstoraster/gdevht.h b/pstoraster/gdevht.h deleted file mode 100644 index 5255b1f75f..0000000000 --- a/pstoraster/gdevht.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 1995, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevht.h,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* Requires gxdevice.h */ - -#ifndef gdevht_INCLUDED -# define gdevht_INCLUDED - -#include "gzht.h" - -/* - * A halftoning device converts between a non-halftoned device color space - * (e.g., 8-bit gray) and a halftoned space (e.g., 1-bit black and white). - * We represent colors by packing the two colors being halftoned and the - * halftone level into a gx_color_index. - */ -typedef struct gx_device_ht_s { - gx_device_forward_common; - /* Following + target are set before opening. */ - const gx_device_halftone *dev_ht; - gs_int_point ht_phase; /* halftone phase from gstate */ - /* Following are computed when device is opened. */ - int color_shift; /* # of bits of color */ - int level_shift; /* = color_shift * 2 */ - gx_color_index color_mask; /* (1 << color_shift) - 1 */ - gs_int_point phase; /* halftone tile offset */ -} gx_device_ht; - -#endif /* gdevht_INCLUDED */ diff --git a/pstoraster/gdevm1.c b/pstoraster/gdevm1.c deleted file mode 100644 index da9e6dbfef..0000000000 --- a/pstoraster/gdevm1.c +++ /dev/null @@ -1,759 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm1.c,v 1.2.2.1 2001/05/13 18:38:31 mike Exp $ */ -/* Monobit "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -extern dev_proc_strip_copy_rop(mem_mono_strip_copy_rop); /* in gdevmrop.c */ - -/* Optionally, use the slow RasterOp implementations for testing. */ -/*#define USE_COPY_ROP */ - -#ifdef USE_COPY_ROP -#include "gsrop.h" -#endif - -/* ================ Standard (byte-oriented) device ================ */ - -/* We went to a lot of trouble to optimize mem_mono_tile_rectangle. */ -/* It has a substantial effect on the total time at high resolutions. */ -/* However, it takes quite a lot of code, so we omit it on 16-bit systems. */ -#define OPTIMIZE_TILE (arch_sizeof_int > 2) - -/* Procedures */ -private dev_proc_map_rgb_color(mem_mono_map_rgb_color); -private dev_proc_map_color_rgb(mem_mono_map_color_rgb); -private dev_proc_copy_mono(mem_mono_copy_mono); -private dev_proc_fill_rectangle(mem_mono_fill_rectangle); - -#if OPTIMIZE_TILE -private dev_proc_strip_tile_rectangle(mem_mono_strip_tile_rectangle); - -#else -# define mem_mono_strip_tile_rectangle gx_default_strip_tile_rectangle -#endif - -/* The device descriptor. */ -/* The instance is public. */ -const gx_device_memory mem_mono_device = -mem_full_alpha_device("image1", 0, 1, mem_open, - mem_mono_map_rgb_color, mem_mono_map_color_rgb, - mem_mono_copy_mono, gx_default_copy_color, mem_mono_fill_rectangle, - gx_default_map_cmyk_color, gx_no_copy_alpha, - mem_mono_strip_tile_rectangle, mem_mono_strip_copy_rop, - mem_get_bits_rectangle); - -/* Map color to/from RGB. This may be inverted. */ -private gx_color_index -mem_mono_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - return (gx_default_w_b_map_rgb_color(dev, r, g, b) ^ - mdev->palette.data[0]) & 1; -} -private int -mem_mono_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - return gx_default_w_b_map_color_rgb(dev, - (color ^ mdev->palette.data[0]) & 1, - prgb); -} - -/* Fill a rectangle with a color. */ -private int -mem_mono_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - -#ifdef USE_COPY_ROP - return mem_mono_copy_rop(dev, NULL, 0, 0, gx_no_bitmap_id, NULL, - NULL, NULL, - x, y, w, h, 0, 0, - (color ? rop3_1 : rop3_0)); -#else - fit_fill(dev, x, y, w, h); - bits_fill_rectangle(scan_line_base(mdev, y), x, mdev->raster, - -(mono_fill_chunk) color, w, h); - return 0; -#endif -} - -/* Convert x coordinate to byte offset in scan line. */ -#define x_to_byte(x) ((x) >> 3) - -/* Copy a monochrome bitmap. */ -#undef mono_masks -#define mono_masks mono_copy_masks - -/* - * Fetch a chunk from the source. - * - * Since source and destination are both always big-endian, - * fetching an aligned chunk never requires byte swapping. - */ -#define CFETCH_ALIGNED(cptr)\ - (*(const chunk *)(cptr)) - -/* - * Note that the macros always cast cptr, - * so it doesn't matter what the type of cptr is. - */ -/* cshift = chunk_bits - shift. */ -#undef chunk -#if arch_is_big_endian -# define chunk uint -# define CFETCH_RIGHT(cptr, shift, cshift)\ - (CFETCH_ALIGNED(cptr) >> shift) -# define CFETCH_LEFT(cptr, shift, cshift)\ - (CFETCH_ALIGNED(cptr) << shift) -/* Fetch a chunk that straddles a chunk boundary. */ -# define CFETCH2(cptr, cskew, skew)\ - (CFETCH_LEFT(cptr, cskew, skew) +\ - CFETCH_RIGHT((const chunk *)(cptr) + 1, skew, cskew)) -#else /* little-endian */ -# define chunk bits16 -private const bits16 right_masks2[9] = -{ - 0xffff, 0x7f7f, 0x3f3f, 0x1f1f, 0x0f0f, 0x0707, 0x0303, 0x0101, 0x0000 -}; -private const bits16 left_masks2[9] = -{ - 0xffff, 0xfefe, 0xfcfc, 0xf8f8, 0xf0f0, 0xe0e0, 0xc0c0, 0x8080, 0x0000 -}; - -# define CCONT(cptr, off) (((const chunk *)(cptr))[off]) -# define CFETCH_RIGHT(cptr, shift, cshift)\ - ((shift) < 8 ?\ - ((CCONT(cptr, 0) >> (shift)) & right_masks2[shift]) +\ - (CCONT(cptr, 0) << (cshift)) :\ - ((chunk)*(const byte *)(cptr) << (cshift)) & 0xff00) -# define CFETCH_LEFT(cptr, shift, cshift)\ - ((shift) < 8 ?\ - ((CCONT(cptr, 0) << (shift)) & left_masks2[shift]) +\ - (CCONT(cptr, 0) >> (cshift)) :\ - ((CCONT(cptr, 0) & 0xff00) >> (cshift)) & 0xff) -/* Fetch a chunk that straddles a chunk boundary. */ -/* We can avoid testing the shift amount twice */ -/* by expanding the CFETCH_LEFT/right macros in-line. */ -# define CFETCH2(cptr, cskew, skew)\ - ((cskew) < 8 ?\ - ((CCONT(cptr, 0) << (cskew)) & left_masks2[cskew]) +\ - (CCONT(cptr, 0) >> (skew)) +\ - (((chunk)(((const byte *)(cptr))[2]) << (cskew)) & 0xff00) :\ - (((CCONT(cptr, 0) & 0xff00) >> (skew)) & 0xff) +\ - ((CCONT(cptr, 1) >> (skew)) & right_masks2[skew]) +\ - (CCONT(cptr, 1) << (cskew))) -#endif - -typedef enum { - COPY_OR = 0, COPY_STORE, COPY_AND, COPY_FUNNY -} copy_function; -typedef struct { - uint invert; - copy_function op; -} copy_mode; - -/* - * Map from to copy_mode. - * Logically, this is a 2-D array. - * The indexing is (transparent, 0, 1, unused). */ -private const copy_mode copy_modes[16] = -{ - {~0UL, COPY_FUNNY}, /* NN */ - {~0UL, COPY_AND}, /* N0 */ - {0, COPY_OR}, /* N1 */ - {0, 0}, /* unused */ - {0, COPY_AND}, /* 0N */ - {0, COPY_FUNNY}, /* 00 */ - {0, COPY_STORE}, /* 01 */ - {0, 0}, /* unused */ - {~0UL, COPY_OR}, /* 1N */ - {~0UL, COPY_STORE}, /* 10 */ - {0, COPY_FUNNY}, /* 11 */ - {0, 0}, /* unused */ - {0, 0}, /* unused */ - {0, 0}, /* unused */ - {0, 0}, /* unused */ - {0, 0}, /* unused */ -}; - -/* Handle the funny cases that aren't supposed to happen. */ -#define FUNNY_CASE()\ - (invert ? gs_note_error(-1) :\ - mem_mono_fill_rectangle(dev, x, y, w, h, color0)) - -private int -mem_mono_copy_mono(gx_device * dev, - const byte * source_data, int source_x, int source_raster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - -#ifdef USE_COPY_ROP - return mem_mono_copy_rop(dev, source_data, source_x, source_raster, - id, NULL, NULL, NULL, - x, y, w, h, 0, 0, - ((color0 == gx_no_color_index ? rop3_D : - color0 == 0 ? rop3_0 : rop3_1) & ~rop3_S) | - ((color1 == gx_no_color_index ? rop3_D : - color1 == 0 ? rop3_0 : rop3_1) & rop3_S)); -#else /* !USE_COPY_ROP */ - register const byte *bptr; /* actually chunk * */ - int dbit, wleft; - uint mask; - copy_mode mode; - - DECLARE_SCAN_PTR_VARS(dbptr, byte *, dest_raster); -#define optr ((chunk *)dbptr) - register int skew; - register uint invert; - - fit_copy(dev, source_data, source_x, source_raster, id, x, y, w, h); -#if gx_no_color_index_value != -1 /* hokey! */ - if (color0 == gx_no_color_index) - color0 = -1; - if (color1 == gx_no_color_index) - color1 = -1; -#endif - mode = copy_modes[((int)color0 << 2) + (int)color1 + 5]; - invert = mode.invert; /* load register */ - SETUP_RECT_VARS(dbptr, byte *, dest_raster); - bptr = source_data + ((source_x & ~chunk_align_bit_mask) >> 3); - dbit = x & chunk_align_bit_mask; - skew = dbit - (source_x & chunk_align_bit_mask); - -/* Macros for writing partial chunks. */ -/* The destination pointer is always named optr, */ -/* and must be declared as chunk *. */ -/* CINVERT may be temporarily redefined. */ -#define CINVERT(bits) ((bits) ^ invert) -#define WRITE_OR_MASKED(bits, mask, off)\ - optr[off] |= (CINVERT(bits) & mask) -#define WRITE_STORE_MASKED(bits, mask, off)\ - optr[off] = ((optr[off] & ~mask) | (CINVERT(bits) & mask)) -#define WRITE_AND_MASKED(bits, mask, off)\ - optr[off] &= (CINVERT(bits) | ~mask) -/* Macros for writing full chunks. */ -#define WRITE_OR(bits) *optr |= CINVERT(bits) -#define WRITE_STORE(bits) *optr = CINVERT(bits) -#define WRITE_AND(bits) *optr &= CINVERT(bits) -/* Macro for incrementing to next chunk. */ -#define NEXT_X_CHUNK()\ - bptr += chunk_bytes; dbptr += chunk_bytes -/* Common macro for the end of each scan line. */ -#define END_Y_LOOP(sdelta, ddelta)\ - bptr += sdelta; dbptr += ddelta - - if ((wleft = w + dbit - chunk_bits) <= 0) { /* The entire operation fits in one (destination) chunk. */ - set_mono_thin_mask(mask, w, dbit); - -#define WRITE_SINGLE(wr_op, src)\ - for ( ; ; )\ - { wr_op(src, mask, 0);\ - if ( --h == 0 ) break;\ - END_Y_LOOP(source_raster, dest_raster);\ - } - -#define WRITE1_LOOP(src)\ - switch ( mode.op ) {\ - case COPY_OR: WRITE_SINGLE(WRITE_OR_MASKED, src); break;\ - case COPY_STORE: WRITE_SINGLE(WRITE_STORE_MASKED, src); break;\ - case COPY_AND: WRITE_SINGLE(WRITE_AND_MASKED, src); break;\ - default: return FUNNY_CASE();\ - } - - if (skew >= 0) { /* single -> single, right/no shift */ - if (skew == 0) { /* no shift */ - WRITE1_LOOP(CFETCH_ALIGNED(bptr)); - } else { /* right shift */ - int cskew = chunk_bits - skew; - - WRITE1_LOOP(CFETCH_RIGHT(bptr, skew, cskew)); - } - } else if (wleft <= skew) { /* single -> single, left shift */ - int cskew = chunk_bits + skew; - - skew = -skew; - WRITE1_LOOP(CFETCH_LEFT(bptr, skew, cskew)); - } else { /* double -> single */ - int cskew = -skew; - - skew += chunk_bits; - WRITE1_LOOP(CFETCH2(bptr, cskew, skew)); - } -#undef WRITE1_LOOP -#undef WRITE_SINGLE - } else if (wleft <= skew) { /* 1 source chunk -> 2 destination chunks. */ - /* This is an important special case for */ - /* both characters and halftone tiles. */ - uint rmask; - int cskew = chunk_bits - skew; - - set_mono_left_mask(mask, dbit); - set_mono_right_mask(rmask, wleft); -#undef CINVERT -#define CINVERT(bits) (bits) /* pre-inverted here */ - -#if arch_is_big_endian /* no byte swapping */ -# define WRITE_1TO2(wr_op)\ - for ( ; ; )\ - { register uint bits = CFETCH_ALIGNED(bptr) ^ invert;\ - wr_op(bits >> skew, mask, 0);\ - wr_op(bits << cskew, rmask, 1);\ - if ( --h == 0 ) break;\ - END_Y_LOOP(source_raster, dest_raster);\ - } -#else /* byte swapping */ -# define WRITE_1TO2(wr_op)\ - for ( ; ; )\ - { wr_op(CFETCH_RIGHT(bptr, skew, cskew) ^ invert, mask, 0);\ - wr_op(CFETCH_LEFT(bptr, cskew, skew) ^ invert, rmask, 1);\ - if ( --h == 0 ) break;\ - END_Y_LOOP(source_raster, dest_raster);\ - } -#endif - - switch (mode.op) { - case COPY_OR: - WRITE_1TO2(WRITE_OR_MASKED); - break; - case COPY_STORE: - WRITE_1TO2(WRITE_STORE_MASKED); - break; - case COPY_AND: - WRITE_1TO2(WRITE_AND_MASKED); - break; - default: - return FUNNY_CASE(); - } -#undef CINVERT -#define CINVERT(bits) ((bits) ^ invert) -#undef WRITE_1TO2 - } else { /* More than one source chunk and more than one */ - /* destination chunk are involved. */ - uint rmask; - int words = (wleft & ~chunk_bit_mask) >> 3; - uint sskip = source_raster - words; - uint dskip = dest_raster - words; - register uint bits; - - set_mono_left_mask(mask, dbit); - set_mono_right_mask(rmask, wleft & chunk_bit_mask); - if (skew == 0) { /* optimize the aligned case */ - -#define WRITE_ALIGNED(wr_op, wr_op_masked)\ - for ( ; ; )\ - { int count = wleft;\ - /* Do first partial chunk. */\ - wr_op_masked(CFETCH_ALIGNED(bptr), mask, 0);\ - /* Do full chunks. */\ - while ( (count -= chunk_bits) >= 0 )\ - { NEXT_X_CHUNK(); wr_op(CFETCH_ALIGNED(bptr)); }\ - /* Do last chunk */\ - if ( count > -chunk_bits )\ - { wr_op_masked(CFETCH_ALIGNED(bptr + chunk_bytes), rmask, 1); }\ - if ( --h == 0 ) break;\ - END_Y_LOOP(sskip, dskip);\ - } - - switch (mode.op) { - case COPY_OR: - WRITE_ALIGNED(WRITE_OR, WRITE_OR_MASKED); - break; - case COPY_STORE: - WRITE_ALIGNED(WRITE_STORE, WRITE_STORE_MASKED); - break; - case COPY_AND: - WRITE_ALIGNED(WRITE_AND, WRITE_AND_MASKED); - break; - default: - return FUNNY_CASE(); - } -#undef WRITE_ALIGNED - } else { /* not aligned */ - int cskew = -skew & chunk_bit_mask; - bool case_right = - (skew >= 0 ? true : - ((bptr += chunk_bytes), false)); - - skew &= chunk_bit_mask; - -#define WRITE_UNALIGNED(wr_op, wr_op_masked)\ - /* Prefetch partial word. */\ - bits =\ - (case_right ? CFETCH_RIGHT(bptr, skew, cskew) :\ - CFETCH2(bptr - chunk_bytes, cskew, skew));\ - wr_op_masked(bits, mask, 0);\ - /* Do full chunks. */\ - while ( count >= chunk_bits )\ - { bits = CFETCH2(bptr, cskew, skew);\ - NEXT_X_CHUNK(); wr_op(bits); count -= chunk_bits;\ - }\ - /* Do last chunk */\ - if ( count > 0 )\ - { bits = CFETCH_LEFT(bptr, cskew, skew);\ - if ( count > skew ) bits += CFETCH_RIGHT(bptr + chunk_bytes, skew, cskew);\ - wr_op_masked(bits, rmask, 1);\ - } - - switch (mode.op) { - case COPY_OR: - for (;;) { - int count = wleft; - - WRITE_UNALIGNED(WRITE_OR, WRITE_OR_MASKED); - if (--h == 0) - break; - END_Y_LOOP(sskip, dskip); - } - break; - case COPY_STORE: - for (;;) { - int count = wleft; - - WRITE_UNALIGNED(WRITE_STORE, WRITE_STORE_MASKED); - if (--h == 0) - break; - END_Y_LOOP(sskip, dskip); - } - break; - case COPY_AND: - for (;;) { - int count = wleft; - - WRITE_UNALIGNED(WRITE_AND, WRITE_AND_MASKED); - if (--h == 0) - break; - END_Y_LOOP(sskip, dskip); - } - break; - default /*case COPY_FUNNY */ : - return FUNNY_CASE(); - } -#undef WRITE_UNALIGNED - } - } -#undef END_Y_LOOP -#undef NEXT_X_CHUNK - return 0; -#undef optr -#endif /* !USE_COPY_ROP */ -} - -#if OPTIMIZE_TILE /**************** *************** */ - -/* Strip-tile with a monochrome halftone. */ -/* This is a performance bottleneck for monochrome devices, */ -/* so we re-implement it, even though it takes a lot of code. */ -private int -mem_mono_strip_tile_rectangle(gx_device * dev, - register const gx_strip_bitmap * tiles, -int tx, int y, int tw, int th, gx_color_index color0, gx_color_index color1, - int px, int py) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - -#ifdef USE_COPY_ROP - return mem_mono_strip_copy_rop(dev, NULL, 0, 0, tile->id, NULL, - tiles, NULL, - tx, y, tw, th, px, py, - ((color0 == gx_no_color_index ? rop3_D : - color0 == 0 ? rop3_0 : rop3_1) & ~rop3_T) | - ((color1 == gx_no_color_index ? rop3_D : - color1 == 0 ? rop3_0 : rop3_1) & rop3_T)); -#else /* !USE_COPY_ROP */ - register uint invert; - int source_raster; - uint tile_bits_size; - const byte *source_data; - const byte *end; - int x, rw, w, h; - register const byte *bptr; /* actually chunk * */ - int dbit, wleft; - uint mask; - byte *dbase; - - DECLARE_SCAN_PTR_VARS(dbptr, byte *, dest_raster); -#define optr ((chunk *)dbptr) - register int skew; - - /* This implementation doesn't handle strips yet. */ - if (color0 != (color1 ^ 1) || tiles->shift != 0) - return gx_default_strip_tile_rectangle(dev, tiles, tx, y, tw, th, - color0, color1, px, py); - fit_fill(dev, tx, y, tw, th); - invert = -(uint) color0; - source_raster = tiles->raster; - source_data = tiles->data + ((y + py) % tiles->rep_height) * source_raster; - tile_bits_size = tiles->size.y * source_raster; - end = tiles->data + tile_bits_size; -#undef END_Y_LOOP -#define END_Y_LOOP(sdelta, ddelta)\ - if ( end - bptr <= sdelta ) /* wrap around */\ - bptr -= tile_bits_size;\ - bptr += sdelta; dbptr += ddelta - dest_raster = mdev->raster; - dbase = scan_line_base(mdev, y); - x = tx; - rw = tw; - /* - * The outermost loop here works horizontally, one iteration per - * copy of the tile. Note that all iterations except the first - * have source_x = 0. - */ - { - int source_x = (x + px) % tiles->rep_width; - - w = tiles->size.x - source_x; - bptr = source_data + ((source_x & ~chunk_align_bit_mask) >> 3); - dbit = x & chunk_align_bit_mask; - skew = dbit - (source_x & chunk_align_bit_mask); - } - outer:if (w > rw) - w = rw; - h = th; - dbptr = dbase + ((x >> 3) & -chunk_align_bytes); - if ((wleft = w + dbit - chunk_bits) <= 0) { /* The entire operation fits in one (destination) chunk. */ - set_mono_thin_mask(mask, w, dbit); -#define WRITE1_LOOP(src)\ - for ( ; ; )\ - { WRITE_STORE_MASKED(src, mask, 0);\ - if ( --h == 0 ) break;\ - END_Y_LOOP(source_raster, dest_raster);\ - } - if (skew >= 0) { /* single -> single, right/no shift */ - if (skew == 0) { /* no shift */ - WRITE1_LOOP(CFETCH_ALIGNED(bptr)); - } else { /* right shift */ - int cskew = chunk_bits - skew; - - WRITE1_LOOP(CFETCH_RIGHT(bptr, skew, cskew)); - } - } else if (wleft <= skew) { /* single -> single, left shift */ - int cskew = chunk_bits + skew; - - skew = -skew; - WRITE1_LOOP(CFETCH_LEFT(bptr, skew, cskew)); - } else { /* double -> single */ - int cskew = -skew; - - skew += chunk_bits; - WRITE1_LOOP(CFETCH2(bptr, cskew, skew)); - } -#undef WRITE1_LOOP - } else if (wleft <= skew) { /* 1 source chunk -> 2 destination chunks. */ - /* This is an important special case for */ - /* both characters and halftone tiles. */ - uint rmask; - int cskew = chunk_bits - skew; - - set_mono_left_mask(mask, dbit); - set_mono_right_mask(rmask, wleft); -#if arch_is_big_endian /* no byte swapping */ -#undef CINVERT -#define CINVERT(bits) (bits) /* pre-inverted here */ - for (;;) { - register uint bits = CFETCH_ALIGNED(bptr) ^ invert; - - WRITE_STORE_MASKED(bits >> skew, mask, 0); - WRITE_STORE_MASKED(bits << cskew, rmask, 1); - if (--h == 0) - break; - END_Y_LOOP(source_raster, dest_raster); - } -#undef CINVERT -#define CINVERT(bits) ((bits) ^ invert) -#else /* byte swapping */ - for (;;) { - WRITE_STORE_MASKED(CFETCH_RIGHT(bptr, skew, cskew), mask, 0); - WRITE_STORE_MASKED(CFETCH_LEFT(bptr, cskew, skew), rmask, 1); - if (--h == 0) - break; - END_Y_LOOP(source_raster, dest_raster); - } -#endif - } else { /* More than one source chunk and more than one */ - /* destination chunk are involved. */ - uint rmask; - int words = (wleft & ~chunk_bit_mask) >> 3; - uint sskip = source_raster - words; - uint dskip = dest_raster - words; - register uint bits; - -#define NEXT_X_CHUNK()\ - bptr += chunk_bytes; dbptr += chunk_bytes - - set_mono_right_mask(rmask, wleft & chunk_bit_mask); - if (skew == 0) { /* optimize the aligned case */ - if (dbit == 0) - mask = 0; - else - set_mono_left_mask(mask, dbit); - for (;;) { - int count = wleft; - - /* Do first partial chunk. */ - if (mask) - WRITE_STORE_MASKED(CFETCH_ALIGNED(bptr), mask, 0); - else - WRITE_STORE(CFETCH_ALIGNED(bptr)); - /* Do full chunks. */ - while ((count -= chunk_bits) >= 0) { - NEXT_X_CHUNK(); - WRITE_STORE(CFETCH_ALIGNED(bptr)); - } - /* Do last chunk */ - if (count > -chunk_bits) { - WRITE_STORE_MASKED(CFETCH_ALIGNED(bptr + chunk_bytes), rmask, 1); - } - if (--h == 0) - break; - END_Y_LOOP(sskip, dskip); - } - } else { /* not aligned */ - bool case_right = - (skew >= 0 ? true : - ((bptr += chunk_bytes), false)); - int cskew = -skew & chunk_bit_mask; - - skew &= chunk_bit_mask; - set_mono_left_mask(mask, dbit); - for (;;) { - int count = wleft; - - if (case_right) - bits = CFETCH_RIGHT(bptr, skew, cskew); - else - bits = CFETCH2(bptr - chunk_bytes, cskew, skew); - WRITE_STORE_MASKED(bits, mask, 0); - /* Do full chunks. */ - while (count >= chunk_bits) { - bits = CFETCH2(bptr, cskew, skew); - NEXT_X_CHUNK(); - WRITE_STORE(bits); - count -= chunk_bits; - } - /* Do last chunk */ - if (count > 0) { - bits = CFETCH_LEFT(bptr, cskew, skew); - if (count > skew) - bits += CFETCH_RIGHT(bptr + chunk_bytes, skew, cskew); - WRITE_STORE_MASKED(bits, rmask, 1); - } - if (--h == 0) - break; - END_Y_LOOP(sskip, dskip); - } - } - } -#undef END_Y_LOOP -#undef NEXT_X_CHUNK -#undef optr - if ((rw -= w) > 0) { - x += w; - w = tiles->size.x; - bptr = source_data; - skew = dbit = x & chunk_align_bit_mask; - goto outer; - } - return 0; -#endif /* !USE_COPY_ROP */ -} - -#endif /**************** *************** */ - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -private dev_proc_copy_mono(mem1_word_copy_mono); -private dev_proc_fill_rectangle(mem1_word_fill_rectangle); - -#define mem1_word_strip_tile_rectangle gx_default_strip_tile_rectangle - -/* Here is the device descriptor. */ -const gx_device_memory mem_mono_word_device = -mem_full_alpha_device("image1w", 0, 1, mem_open, - mem_mono_map_rgb_color, mem_mono_map_color_rgb, - mem1_word_copy_mono, gx_default_copy_color, mem1_word_fill_rectangle, - gx_default_map_cmyk_color, gx_no_copy_alpha, - mem1_word_strip_tile_rectangle, gx_no_strip_copy_rop, - mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem1_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *base; - uint raster; - - fit_fill(dev, x, y, w, h); - base = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(base, raster, x, w, h, true); - bits_fill_rectangle(base, x, raster, -(mono_fill_chunk) color, w, h); - mem_swap_byte_rect(base, raster, x, w, h, true); - return 0; -} - -/* Copy a bitmap. */ -private int -mem1_word_copy_mono(gx_device * dev, - const byte * source_data, int source_x, int source_raster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - bool store; - - fit_copy(dev, source_data, source_x, source_raster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - store = (color0 != gx_no_color_index && color1 != gx_no_color_index); - mem_swap_byte_rect(row, raster, x, w, h, store); - mem_mono_copy_mono(dev, source_data, source_x, source_raster, id, - x, y, w, h, color0, color1); - mem_swap_byte_rect(row, raster, x, w, h, false); - return 0; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevm16.c b/pstoraster/gdevm16.c deleted file mode 100644 index 81ec695246..0000000000 --- a/pstoraster/gdevm16.c +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright (C) 1994, 1996, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm16.c,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* 16-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -#undef chunk -#define chunk byte - -/* The 16 bits are divided 5 for red, 6 for green, and 5 for blue. */ -/* Note that the bits must always be kept in big-endian order. */ - -/* Procedures */ -declare_mem_map_procs(mem_true16_map_rgb_color, mem_true16_map_color_rgb); -declare_mem_procs(mem_true16_copy_mono, mem_true16_copy_color, mem_true16_fill_rectangle); - -/* The device descriptor. */ -const gx_device_memory mem_true16_device = - mem_device("image16", 16, 0, - mem_true16_map_rgb_color, mem_true16_map_color_rgb, - mem_true16_copy_mono, mem_true16_copy_color, - mem_true16_fill_rectangle, gx_default_strip_copy_rop); - -/* Map a r-g-b color to a color index. */ -private gx_color_index -mem_true16_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - return ((r >> (gx_color_value_bits - 5)) << 11) + - ((g >> (gx_color_value_bits - 6)) << 5) + - (b >> (gx_color_value_bits - 5)); -} - -/* Map a color index to a r-g-b color. */ -private int -mem_true16_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - ushort value = color >> 11; - - prgb[0] = ((value << 11) + (value << 6) + (value << 1) + (value >> 4)) - >> (16 - gx_color_value_bits); - value = (color >> 5) & 0x3f; - prgb[1] = ((value << 10) + (value << 4) + (value >> 2)) - >> (16 - gx_color_value_bits); - value = color & 0x1f; - prgb[2] = ((value << 11) + (value << 6) + (value << 1) + (value >> 4)) - >> (16 - gx_color_value_bits); - return 0; -} - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) ((x) << 1) - -/* Fill a rectangle with a color. */ -private int -mem_true16_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; -#if arch_is_big_endian - const ushort color16 = (ushort)color; -#else - const ushort color16 = (ushort)((color << 8) | (color >> 8)); -#endif - declare_scan_ptr(dest); - fit_fill(dev, x, y, w, h); - setup_rect(dest); - while (h-- > 0) { - ushort *pptr = (ushort *) dest; - int cnt = w; - - do { - *pptr++ = color16; - } while (--cnt > 0); - inc_ptr(dest, draster); - } - return 0; -} - -/* Copy a monochrome bitmap. */ -private int -mem_true16_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, - gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; -#if arch_is_big_endian - const ushort zero16 = (ushort)zero; - const ushort one16 = (ushort)one; -#else - ushort zero16 = ((uint) (byte) zero << 8) + ((ushort) zero >> 8); - ushort one16 = ((uint) (byte) one << 8) + ((ushort) one >> 8); -#endif - const byte *line; - int first_bit; - - declare_scan_ptr(dest); - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - first_bit = 0x80 >> (sourcex & 7); - while (h-- > 0) { - register ushort *pptr = (ushort *) dest; - const byte *sptr = line; - register int sbyte = *sptr++; - register int bit = first_bit; - int count = w; - - do { - if (sbyte & bit) { - if (one != gx_no_color_index) - *pptr = one16; - } else { - if (zero != gx_no_color_index) - *pptr = zero16; - } - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - pptr++; - } - while (--count > 0); - line += sraster; - inc_ptr(dest, draster); - } - return 0; -} - -/* Copy a color bitmap. */ -private int -mem_true16_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h); - return 0; -} diff --git a/pstoraster/gdevm2.c b/pstoraster/gdevm2.c deleted file mode 100644 index 95d34b7220..0000000000 --- a/pstoraster/gdevm2.c +++ /dev/null @@ -1,259 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm2.c,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* 2-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -extern dev_proc_strip_copy_rop(mem_gray_strip_copy_rop); - -/* ================ Standard (byte-oriented) device ================ */ - -#undef chunk -#define chunk byte -#define fpat(byt) mono_fill_make_pattern(byt) - -/* Procedures */ -declare_mem_procs(mem_mapped2_copy_mono, mem_mapped2_copy_color, mem_mapped2_fill_rectangle); - -/* The device descriptor. */ -const gx_device_memory mem_mapped2_device = -mem_device("image2", 2, 0, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem_mapped2_copy_mono, mem_mapped2_copy_color, mem_mapped2_fill_rectangle, - mem_gray_strip_copy_rop); - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) ((x) >> 2) - -/* Define the 2-bit fill patterns. */ -static const mono_fill_chunk tile_patterns[4] = -{fpat(0x00), fpat(0x55), fpat(0xaa), fpat(0xff) -}; - -/* Fill a rectangle with a color. */ -private int -mem_mapped2_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_fill(dev, x, y, w, h); - bits_fill_rectangle(scan_line_base(mdev, y), x << 1, mdev->raster, - tile_patterns[color], w << 1, h); - return 0; -} - -/* Copy a bitmap. */ -private int -mem_mapped2_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *line; - int first_bit; - byte first_mask, b0, b1, bxor, left_mask, right_mask; - static const byte btab[4] = - {0, 0x55, 0xaa, 0xff}; - static const byte bmask[4] = - {0xc0, 0x30, 0xc, 3}; - static const byte lmask[4] = - {0, 0xc0, 0xf0, 0xfc}; - - declare_scan_ptr(dest); - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - first_bit = 0x80 >> (sourcex & 7); - first_mask = bmask[x & 3]; - left_mask = lmask[x & 3]; - right_mask = ~lmask[(x + w) & 3]; - if ((x & 3) + w <= 4) - left_mask = right_mask = left_mask | right_mask; - b0 = btab[zero & 3]; - b1 = btab[one & 3]; - bxor = b0 ^ b1; - while (h-- > 0) { - register byte *pptr = (byte *) dest; - const byte *sptr = line; - register int sbyte = *sptr++; - register int bit = first_bit; - register byte mask = first_mask; - int count = w; - - /* We have 4 cases, of which only 2 really matter. */ - if (one != gx_no_color_index) { - if (zero != gx_no_color_index) { /* Copying an opaque bitmap. */ - byte data = - (*pptr & left_mask) | (b0 & ~left_mask); - - do { - if (sbyte & bit) - data ^= bxor & mask; - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - if ((mask >>= 2) == 0) - mask = 0xc0, *pptr++ = data, data = b0; - } - while (--count > 0); - if (mask != 0xc0) - *pptr = - (*pptr & right_mask) | (data & ~right_mask); - } else { /* Filling a mask. */ - do { - if (sbyte & bit) - *pptr = (*pptr & ~mask) + (b1 & mask); - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - if ((mask >>= 2) == 0) - mask = 0xc0, pptr++; - } - while (--count > 0); - } - } else { /* Some other case. */ - do { - if (!(sbyte & bit)) { - if (zero != gx_no_color_index) - *pptr = (*pptr & ~mask) + (b0 & mask); - } - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - if ((mask >>= 2) == 0) - mask = 0xc0, pptr++; - } - while (--count > 0); - } - line += sraster; - inc_ptr(dest, draster); - } - return 0; -} - -/* Copy a color bitmap. */ -private int -mem_mapped2_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - int code; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - /* Use monobit copy_mono. */ - /* Patch the width in the device temporarily. */ - dev->width <<= 1; - code = (*dev_proc(&mem_mono_device, copy_mono)) - (dev, base, sourcex << 1, sraster, id, - x << 1, y, w << 1, h, (gx_color_index) 0, (gx_color_index) 1); - /* Restore the correct width. */ - dev->width >>= 1; - return code; -} - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -declare_mem_procs(mem2_word_copy_mono, mem2_word_copy_color, mem2_word_fill_rectangle); - -/* Here is the device descriptor. */ -const gx_device_memory mem_mapped2_word_device = -mem_full_device("image2w", 2, 0, mem_open, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem2_word_copy_mono, mem2_word_copy_color, mem2_word_fill_rectangle, - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem2_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *base; - uint raster; - - fit_fill(dev, x, y, w, h); - base = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(base, raster, x << 1, w << 1, h, true); - bits_fill_rectangle(base, x << 1, raster, - tile_patterns[color], w << 1, h); - mem_swap_byte_rect(base, raster, x << 1, w << 1, h, true); - return 0; -} - -/* Copy a bitmap. */ -private int -mem2_word_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - bool store; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - store = (zero != gx_no_color_index && one != gx_no_color_index); - mem_swap_byte_rect(row, raster, x << 1, w << 1, h, store); - mem_mapped2_copy_mono(dev, base, sourcex, sraster, id, - x, y, w, h, zero, one); - mem_swap_byte_rect(row, raster, x << 1, w << 1, h, false); - return 0; -} - -/* Copy a color bitmap. */ -private int -mem2_word_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - int code; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - /* Use monobit copy_mono. */ - /* Patch the width in the device temporarily. */ - dev->width <<= 1; - code = (*dev_proc(&mem_mono_word_device, copy_mono)) - (dev, base, sourcex << 1, sraster, id, - x << 1, y, w << 1, h, (gx_color_index) 0, (gx_color_index) 1); - /* Restore the correct width. */ - dev->width >>= 1; - return code; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevm24.c b/pstoraster/gdevm24.c deleted file mode 100644 index 8fe9a7d11d..0000000000 --- a/pstoraster/gdevm24.c +++ /dev/null @@ -1,526 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm24.c,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* 24-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -extern dev_proc_strip_copy_rop(mem_gray8_rgb24_strip_copy_rop); /* in gdevmrop.c */ - -#define mem_true24_strip_copy_rop mem_gray8_rgb24_strip_copy_rop - -/* ================ Standard (byte-oriented) device ================ */ - -#undef chunk -#define chunk byte - -/* Procedures */ -declare_mem_procs(mem_true24_copy_mono, mem_true24_copy_color, mem_true24_fill_rectangle); -private dev_proc_copy_alpha(mem_true24_copy_alpha); - -/* The device descriptor. */ -const gx_device_memory mem_true24_device = -mem_full_alpha_device("image24", 24, 0, mem_open, - gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, - mem_true24_copy_mono, mem_true24_copy_color, mem_true24_fill_rectangle, - gx_default_map_cmyk_color, mem_true24_copy_alpha, - gx_default_strip_tile_rectangle, mem_true24_strip_copy_rop, - mem_get_bits_rectangle); - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) ((x) * 3) - -/* Unpack a color into its bytes. */ -#define declare_unpack_color(r, g, b, color)\ - byte r = (byte)(color >> 16);\ - byte g = (byte)((uint)color >> 8);\ - byte b = (byte)color -/* Put a 24-bit color into the bitmap. */ -#define put3(ptr, r, g, b)\ - (ptr)[0] = r, (ptr)[1] = g, (ptr)[2] = b -/* Put 4 bytes of color into the bitmap. */ -#define putw(ptr, wxyz)\ - *(bits32 *)(ptr) = (wxyz) -/* Load the 3-word 24-bit-color cache. */ -/* Free variables: [m]dev, rgbr, gbrg, brgb. */ -#if arch_is_big_endian -# define set_color24_cache(crgb, r, g, b)\ - mdev->color24.rgbr = rgbr = ((bits32)(crgb) << 8) | (r),\ - mdev->color24.gbrg = gbrg = (rgbr << 8) | (g),\ - mdev->color24.brgb = brgb = (gbrg << 8) | (b),\ - mdev->color24.rgb = (crgb) -#else -# define set_color24_cache(crgb, r, g, b)\ - mdev->color24.rgbr = rgbr =\ - ((bits32)(r) << 24) | ((bits32)(b) << 16) |\ - ((bits16)(g) << 8) | (r),\ - mdev->color24.brgb = brgb = (rgbr << 8) | (b),\ - mdev->color24.gbrg = gbrg = (brgb << 8) | (g),\ - mdev->color24.rgb = (crgb) -#endif - -/* Fill a rectangle with a color. */ -private int -mem_true24_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - declare_unpack_color(r, g, b, color); - declare_scan_ptr(dest); - - /* - * In order to avoid testing w > 0 and h > 0 twice, we defer - * executing setup_rect, and use fit_fill_xywh instead of - * fit_fill. - */ - fit_fill_xywh(dev, x, y, w, h); - if (w >= 5) { - if (h <= 0) - return 0; - setup_rect(dest); - if (r == g && r == b) { -#if 1 - /* We think we can do better than the library's memset.... */ - int bcntm7 = w * 3 - 7; - register bits32 cword = color | (color << 24); - - while (h-- > 0) { - register byte *pptr = dest; - byte *limit = pptr + bcntm7; - - /* We want to store full words, but we have to */ - /* guarantee that they are word-aligned. */ - switch (x & 3) { - case 3: - *pptr++ = (byte) cword; - case 2: - *pptr++ = (byte) cword; - case 1: - *pptr++ = (byte) cword; - case 0:; - } - /* Even with w = 5, we always store at least */ - /* 3 full words, regardless of the starting x. */ - *(bits32 *) pptr = - ((bits32 *) pptr)[1] = - ((bits32 *) pptr)[2] = cword; - pptr += 12; - while (pptr < limit) { - *(bits32 *) pptr = - ((bits32 *) pptr)[1] = cword; - pptr += 8; - } - switch (pptr - limit) { - case 0: - pptr[6] = (byte) cword; - case 1: - pptr[5] = (byte) cword; - case 2: - pptr[4] = (byte) cword; - case 3: - *(bits32 *) pptr = cword; - break; - case 4: - pptr[2] = (byte) cword; - case 5: - pptr[1] = (byte) cword; - case 6: - pptr[0] = (byte) cword; - case 7:; - } - inc_ptr(dest, draster); - } -#else - int bcnt = w * 3; - - while (h-- > 0) { - memset(dest, r, bcnt); - inc_ptr(dest, draster); - } -#endif - } else { - int x3 = -x & 3, ww = w - x3; /* we know ww >= 2 */ - bits32 rgbr, gbrg, brgb; - - if (mdev->color24.rgb == color) - rgbr = mdev->color24.rgbr, - gbrg = mdev->color24.gbrg, - brgb = mdev->color24.brgb; - else - set_color24_cache(color, r, g, b); - while (h-- > 0) { - register byte *pptr = dest; - int w1 = ww; - - switch (x3) { - case 1: - put3(pptr, r, g, b); - pptr += 3; - break; - case 2: - pptr[0] = r; - pptr[1] = g; - putw(pptr + 2, brgb); - pptr += 6; - break; - case 3: - pptr[0] = r; - putw(pptr + 1, gbrg); - putw(pptr + 5, brgb); - pptr += 9; - break; - case 0: - ; - } - while (w1 >= 4) { - putw(pptr, rgbr); - putw(pptr + 4, gbrg); - putw(pptr + 8, brgb); - pptr += 12; - w1 -= 4; - } - switch (w1) { - case 1: - put3(pptr, r, g, b); - break; - case 2: - putw(pptr, rgbr); - pptr[4] = g; - pptr[5] = b; - break; - case 3: - putw(pptr, rgbr); - putw(pptr + 4, gbrg); - pptr[8] = b; - break; - case 0: - ; - } - inc_ptr(dest, draster); - } - } - } else if (h > 0) { /* w < 5 */ - setup_rect(dest); - switch (w) { - case 4: - do { - dest[9] = dest[6] = dest[3] = dest[0] = r; - dest[10] = dest[7] = dest[4] = dest[1] = g; - dest[11] = dest[8] = dest[5] = dest[2] = b; - inc_ptr(dest, draster); - } - while (--h); - break; - case 3: - do { - dest[6] = dest[3] = dest[0] = r; - dest[7] = dest[4] = dest[1] = g; - dest[8] = dest[5] = dest[2] = b; - inc_ptr(dest, draster); - } - while (--h); - break; - case 2: - do { - dest[3] = dest[0] = r; - dest[4] = dest[1] = g; - dest[5] = dest[2] = b; - inc_ptr(dest, draster); - } - while (--h); - break; - case 1: - do { - dest[0] = r, dest[1] = g, dest[2] = b; - inc_ptr(dest, draster); - } - while (--h); - break; - case 0: - default: - ; - } - } - return 0; -} - -/* Copy a monochrome bitmap. */ -private int -mem_true24_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *line; - int sbit; - int first_bit; - - declare_scan_ptr(dest); - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - sbit = sourcex & 7; - first_bit = 0x80 >> sbit; - if (zero != gx_no_color_index) { /* Loop for halftones or inverted masks */ - /* (never used). */ - declare_unpack_color(r0, g0, b0, zero); - declare_unpack_color(r1, g1, b1, one); - while (h-- > 0) { - register byte *pptr = dest; - const byte *sptr = line; - register int sbyte = *sptr++; - register int bit = first_bit; - int count = w; - - do { - if (sbyte & bit) { - if (one != gx_no_color_index) - put3(pptr, r1, g1, b1); - } else - put3(pptr, r0, g0, b0); - pptr += 3; - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - } - while (--count > 0); - line += sraster; - inc_ptr(dest, draster); - } - } else if (one != gx_no_color_index) { /* Loop for character and pattern masks. */ - /* This is used heavily. */ - declare_unpack_color(r1, g1, b1, one); - int first_mask = first_bit << 1; - int first_count, first_skip; - - if (sbit + w > 8) - first_mask -= 1, - first_count = 8 - sbit; - else - first_mask -= first_mask >> w, - first_count = w; - first_skip = first_count * 3; - while (h-- > 0) { - register byte *pptr = dest; - const byte *sptr = line; - register int sbyte = *sptr++ & first_mask; - int count = w - first_count; - - if (sbyte) { - register int bit = first_bit; - - do { - if (sbyte & bit) - put3(pptr, r1, g1, b1); - pptr += 3; - } - while ((bit >>= 1) & first_mask); - } else - pptr += first_skip; - while (count >= 8) { - sbyte = *sptr++; - if (sbyte & 0xf0) { - if (sbyte & 0x80) - put3(pptr, r1, g1, b1); - if (sbyte & 0x40) - put3(pptr + 3, r1, g1, b1); - if (sbyte & 0x20) - put3(pptr + 6, r1, g1, b1); - if (sbyte & 0x10) - put3(pptr + 9, r1, g1, b1); - } - if (sbyte & 0xf) { - if (sbyte & 8) - put3(pptr + 12, r1, g1, b1); - if (sbyte & 4) - put3(pptr + 15, r1, g1, b1); - if (sbyte & 2) - put3(pptr + 18, r1, g1, b1); - if (sbyte & 1) - put3(pptr + 21, r1, g1, b1); - } - pptr += 24; - count -= 8; - } - if (count > 0) { - register int bit = 0x80; - - sbyte = *sptr++; - do { - if (sbyte & bit) - put3(pptr, r1, g1, b1); - pptr += 3; - bit >>= 1; - } - while (--count > 0); - } - line += sraster; - inc_ptr(dest, draster); - } - } - return 0; -} - -/* Copy a color bitmap. */ -private int -mem_true24_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h); - return 0; -} - -/* Copy an alpha map. */ -private int -mem_true24_copy_alpha(gx_device * dev, const byte * base, int sourcex, - int sraster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index color, int depth) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *line; - - declare_scan_ptr(dest); - declare_unpack_color(r, g, b, color); - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base; - while (h-- > 0) { - register byte *pptr = dest; - int sx; - - for (sx = sourcex; sx < sourcex + w; ++sx, pptr += 3) { - int alpha2, alpha; - - if (depth == 2) /* map 0 - 3 to 0 - 15 */ - alpha = - ((line[sx >> 2] >> ((3 - (sx & 3)) << 1)) & 3) * 5; - else - alpha2 = line[sx >> 1], - alpha = (sx & 1 ? alpha2 & 0xf : alpha2 >> 4); - if (alpha == 15) { /* Just write the new color. */ - put3(pptr, r, g, b); - } else if (alpha != 0) { /* Blend RGB values. */ -#define make_shade(old, clr, alpha, amax) \ - (old) + (((int)(clr) - (int)(old)) * (alpha) / (amax)) - pptr[0] = make_shade(pptr[0], r, alpha, 15); - pptr[1] = make_shade(pptr[1], g, alpha, 15); - pptr[2] = make_shade(pptr[2], b, alpha, 15); -#undef make_shade - } - } - line += sraster; - inc_ptr(dest, draster); - } - return 0; -} - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -declare_mem_procs(mem24_word_copy_mono, mem24_word_copy_color, mem24_word_fill_rectangle); - -/* Here is the device descriptor. */ -const gx_device_memory mem_true24_word_device = -mem_full_device("image24w", 24, 0, mem_open, - gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, - mem24_word_copy_mono, mem24_word_copy_color, mem24_word_fill_rectangle, - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem24_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *base; - uint raster; - - fit_fill(dev, x, y, w, h); - base = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(base, raster, x * 24, w * 24, h, true); - mem_true24_fill_rectangle(dev, x, y, w, h, color); - mem_swap_byte_rect(base, raster, x * 24, w * 24, h, false); - return 0; -} - -/* Copy a bitmap. */ -private int -mem24_word_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - bool store; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - store = (zero != gx_no_color_index && one != gx_no_color_index); - mem_swap_byte_rect(row, raster, x * 24, w * 24, h, store); - mem_true24_copy_mono(dev, base, sourcex, sraster, id, - x, y, w, h, zero, one); - mem_swap_byte_rect(row, raster, x * 24, w * 24, h, false); - return 0; -} - -/* Copy a color bitmap. */ -private int -mem24_word_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(row, raster, x * 24, w * 24, h, true); - bytes_copy_rectangle(row + x * 3, raster, base + sourcex * 3, sraster, - w * 3, h); - mem_swap_byte_rect(row, raster, x * 24, w * 24, h, false); - return 0; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevm32.c b/pstoraster/gdevm32.c deleted file mode 100644 index 1de29e0a86..0000000000 --- a/pstoraster/gdevm32.c +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm32.c,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* 32-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -/* ================ Standard (byte-oriented) device ================ */ - -#undef chunk -#define chunk byte - -/* Procedures */ -declare_mem_procs(mem_true32_copy_mono, mem_true32_copy_color, mem_true32_fill_rectangle); - -/* The device descriptor. */ -const gx_device_memory mem_true32_device = -mem_full_device("image32", 24, 8, mem_open, - gx_default_map_rgb_color, gx_default_map_color_rgb, - mem_true32_copy_mono, mem_true32_copy_color, mem_true32_fill_rectangle, - gx_default_cmyk_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_default_strip_copy_rop, mem_get_bits_rectangle); - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) ((x) << 2) - -/* Swap the bytes of a color if needed. */ -#define color_swap_bytes(color)\ - (((color) >> 24) + (((color) >> 8) & 0xff00) +\ - (((color) & 0xff00) << 8) + ((color) << 24)) -#if arch_is_big_endian -# define arrange_bytes(color) (color) -#else -# define arrange_bytes(color) color_swap_bytes(color) -#endif - -/* Fill a rectangle with a color. */ -private int -mem_true32_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - bits32 a_color; - - declare_scan_ptr(dest); - - fit_fill(dev, x, y, w, h); - a_color = arrange_bytes(color); - setup_rect(dest); - if (w <= 4) - switch (w) { - /*case 0: *//* not possible */ -#define dest32 ((bits32 *)dest) - case 1: - do { - dest32[0] = a_color; - inc_ptr(dest, draster); - } - while (--h > 0); - break; - case 2: - do { - dest32[1] = dest32[0] = a_color; - inc_ptr(dest, draster); - } - while (--h > 0); - break; - case 3: - do { - dest32[2] = dest32[1] = dest32[0] = a_color; - inc_ptr(dest, draster); - } - while (--h > 0); - break; - case 4: - do { - dest32[3] = dest32[2] = dest32[1] = dest32[0] = a_color; - inc_ptr(dest, draster); - } - while (--h > 0); - break; - default: /* not possible */ - ; - } else if (a_color == 0) - do { - memset(dest, 0, w << 2); - inc_ptr(dest, draster); - } - while (--h > 0); - else - do { - bits32 *pptr = dest32; - int cnt = w; - - do { - pptr[3] = pptr[2] = pptr[1] = pptr[0] = a_color; - pptr += 4; - } - while ((cnt -= 4) > 4); - do { - *pptr++ = a_color; - } while (--cnt > 0); - inc_ptr(dest, draster); - } - while (--h > 0); -#undef dest32 - return 0; -} - -/* Copy a monochrome bitmap. */ -private int -mem_true32_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - bits32 a_zero = arrange_bytes(zero); - bits32 a_one = arrange_bytes(one); - const byte *line; - int first_bit; - - declare_scan_ptr(dest); - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - first_bit = 0x80 >> (sourcex & 7); - while (h-- > 0) { - register bits32 *pptr = (bits32 *) dest; - const byte *sptr = line; - register int sbyte = *sptr++; - register int bit = first_bit; - int count = w; - - do { - if (sbyte & bit) { - if (one != gx_no_color_index) - *pptr = a_one; - } else { - if (zero != gx_no_color_index) - *pptr = a_zero; - } - if ((bit >>= 1) == 0) - bit = 0x80, sbyte = *sptr++; - pptr++; - } - while (--count > 0); - line += sraster; - inc_ptr(dest, draster); - } - return 0; -} - -/* Copy a color bitmap. */ -private int -mem_true32_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h); - return 0; -} - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -declare_mem_procs(mem32_word_copy_mono, mem32_word_copy_color, mem32_word_fill_rectangle); - -/* Here is the device descriptor. */ -const gx_device_memory mem_true32_word_device = -mem_full_device("image32w", 24, 8, mem_open, - gx_default_map_rgb_color, gx_default_map_color_rgb, - mem32_word_copy_mono, mem32_word_copy_color, mem32_word_fill_rectangle, - gx_default_cmyk_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem32_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - return mem_true32_fill_rectangle(dev, x, y, w, h, - color_swap_bytes(color)); -} - -/* Copy a bitmap. */ -private int -mem32_word_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - return mem_true32_copy_mono(dev, base, sourcex, sraster, id, - x, y, w, h, color_swap_bytes(zero), - color_swap_bytes(one)); -} - -/* Copy a color bitmap. */ -private int -mem32_word_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - bytes_copy_rectangle(row + (x << 2), raster, base + (sourcex << 2), - sraster, w << 2, h); - mem_swap_byte_rect(row, raster, x << 5, w << 5, h, false); - return 0; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevm4.c b/pstoraster/gdevm4.c deleted file mode 100644 index 37ecbf2bf0..0000000000 --- a/pstoraster/gdevm4.c +++ /dev/null @@ -1,319 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm4.c,v 1.2 2000/03/08 23:14:23 mike Exp $ */ -/* 4-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -extern dev_proc_strip_copy_rop(mem_gray_strip_copy_rop); - -/* ================ Standard (byte-oriented) device ================ */ - -#undef chunk -#define chunk byte -#define fpat(byt) mono_fill_make_pattern(byt) - -/* Procedures */ -declare_mem_procs(mem_mapped4_copy_mono, mem_mapped4_copy_color, mem_mapped4_fill_rectangle); - -/* The device descriptor. */ -const gx_device_memory mem_mapped4_device = -mem_device("image4", 4, 0, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem_mapped4_copy_mono, mem_mapped4_copy_color, mem_mapped4_fill_rectangle, - mem_gray_strip_copy_rop); - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) ((x) >> 1) - -/* Define the 4-bit fill patterns. */ -static const mono_fill_chunk tile_patterns[16] = -{fpat(0x00), fpat(0x11), fpat(0x22), fpat(0x33), - fpat(0x44), fpat(0x55), fpat(0x66), fpat(0x77), - fpat(0x88), fpat(0x99), fpat(0xaa), fpat(0xbb), - fpat(0xcc), fpat(0xdd), fpat(0xee), fpat(0xff) -}; - - -/* Fill a rectangle with a color. */ -private int -mem_mapped4_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_fill(dev, x, y, w, h); - bits_fill_rectangle(scan_line_base(mdev, y), x << 2, mdev->raster, - tile_patterns[color], w << 2, h); - return 0; -} - -/* Copy a bitmap. */ -private int -mem_mapped4_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *line; - declare_scan_ptr(dest); - byte invert, bb; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - /* Divide into opaque and masked cases. */ - if (one == gx_no_color_index) { - if (zero == gx_no_color_index) - return 0; /* nothing to do */ - invert = 0xff; - bb = ((byte) zero << 4) | (byte) zero; - } else if (zero == gx_no_color_index) { - invert = 0; - bb = ((byte) one << 4) | (byte) one; - } else { - /* Opaque case. */ - int shift = ~(sourcex ^ x) & 1; - byte oz[4]; - - oz[0] = (byte)((zero << 4) | zero); - oz[1] = (byte)((zero << 4) | one); - oz[2] = (byte)((one << 4) | zero); - oz[3] = (byte)((one << 4) | one); - do { - register byte *dptr = (byte *) dest; - const byte *sptr = line; - register uint sbyte = *sptr++; - register int sbit = ~sourcex & 7; - int count = w; - - /* - * If the first source bit corresponds to an odd X in the - * destination, process it now. - */ - if (x & 1) { - *dptr = (*dptr & 0xf0) | - ((sbyte >> sbit) & 1 ? one : zero); - --count; /* may now be 0 */ - if (--sbit < 0) - sbit = 7, sbyte = *sptr++; - ++dptr; - } - /* - * Now we know the next destination X is even. We want to - * process 2 source bits at a time from now on, so set things up - * properly depending on whether the next source X (bit) is even - * or odd. In both even and odd cases, the active source bits - * are in bits 8..1 of sbyte. - */ - sbyte <<= shift; - sbit += shift - 1; - /* - * Now bit # sbit+1 is the most significant unprocessed bit - * in sbyte. -1 <= sbit <= 7; sbit is odd. - * Note that if sbit = -1, all of sbyte has been processed. - * - * Continue processing pairs of bits in the first source byte. - */ - while (count >= 2 && sbit >= 0) { - *dptr++ = oz[(sbyte >> sbit) & 3]; - sbit -= 2, count -= 2; - } - /* - * Now sbit = -1 iff we have processed the entire first source - * byte. - * - * Process full source bytes. - */ - if (shift) { - sbyte >>= 1; /* in case count < 8 */ - for (; count >= 8; dptr += 4, count -= 8) { - sbyte = *sptr++; - dptr[0] = oz[sbyte >> 6]; - dptr[1] = oz[(sbyte >> 4) & 3]; - dptr[2] = oz[(sbyte >> 2) & 3]; - dptr[3] = oz[sbyte & 3]; - } - sbyte <<= 1; - } else { - for (; count >= 8; dptr += 4, count -= 8) { - sbyte = (sbyte << 8) | *sptr++; - dptr[0] = oz[(sbyte >> 7) & 3]; - dptr[1] = oz[(sbyte >> 5) & 3]; - dptr[2] = oz[(sbyte >> 3) & 3]; - dptr[3] = oz[(sbyte >> 1) & 3]; - } - } - if (!count) - continue; - /* - * Process pairs of bits in the final source byte. Note that - * if sbit > 0, this is still the first source byte (the - * full-byte loop wasn't executed). - */ - if (sbit < 0) { - sbyte = (sbyte << 8) | (*sptr << shift); - sbit = 7; - } - while (count >= 2) { - *dptr++ = oz[(sbyte >> sbit) & 3]; - sbit -= 2, count -= 2; - } - /* - * If the final source bit corresponds to an even X value, - * process it now. - */ - if (count) { - *dptr = (*dptr & 0x0f) | - (((sbyte >> sbit) & 2 ? one : zero) << 4); - } - } while ((line += sraster, inc_ptr(dest, draster), --h) > 0); - return 0; - } - /* Masked case. */ - do { - register byte *dptr = (byte *) dest; - const byte *sptr = line; - register int sbyte = *sptr++ ^ invert; - register int sbit = 0x80 >> (sourcex & 7); - register byte mask = (x & 1 ? 0x0f : 0xf0); - int count = w; - - do { - if (sbyte & sbit) - *dptr = (*dptr & ~mask) | (bb & mask); - if ((sbit >>= 1) == 0) - sbit = 0x80, sbyte = *sptr++ ^ invert; - dptr += (mask = ~mask) >> 7; - } while (--count > 0); - line += sraster; - inc_ptr(dest, draster); - } while (--h > 0); - return 0; -} - -/* Copy a color bitmap. */ -private int -mem_mapped4_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - /* Use monobit copy_mono. */ - int code; - - /* Patch the width in the device temporarily. */ - dev->width <<= 2; - code = (*dev_proc(&mem_mono_device, copy_mono)) - (dev, base, sourcex << 2, sraster, id, - x << 2, y, w << 2, h, (gx_color_index) 0, (gx_color_index) 1); - /* Restore the correct width. */ - dev->width >>= 2; - return code; -} - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -declare_mem_procs(mem4_word_copy_mono, mem4_word_copy_color, mem4_word_fill_rectangle); - -/* Here is the device descriptor. */ -const gx_device_memory mem_mapped4_word_device = -mem_full_device("image4w", 4, 0, mem_open, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem4_word_copy_mono, mem4_word_copy_color, mem4_word_fill_rectangle, - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem4_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *base; - uint raster; - - fit_fill(dev, x, y, w, h); - base = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(base, raster, x << 2, w << 2, h, true); - bits_fill_rectangle(base, x << 2, raster, - tile_patterns[color], w << 2, h); - mem_swap_byte_rect(base, raster, x << 2, w << 2, h, true); - return 0; -} - -/* Copy a bitmap. */ -private int -mem4_word_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - bool store; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - store = (zero != gx_no_color_index && one != gx_no_color_index); - mem_swap_byte_rect(row, raster, x << 2, w << 2, h, store); - mem_mapped4_copy_mono(dev, base, sourcex, sraster, id, - x, y, w, h, zero, one); - mem_swap_byte_rect(row, raster, x << 2, w << 2, h, false); - return 0; -} - -/* Copy a color bitmap. */ -private int -mem4_word_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - int code; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - /* Use monobit copy_mono. */ - /* Patch the width in the device temporarily. */ - dev->width <<= 2; - code = (*dev_proc(&mem_mono_word_device, copy_mono)) - (dev, base, sourcex << 2, sraster, id, - x << 2, y, w << 2, h, (gx_color_index) 0, (gx_color_index) 1); - /* Restore the correct width. */ - dev->width >>= 2; - return code; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevm8.c b/pstoraster/gdevm8.c deleted file mode 100644 index 83c6a78ed6..0000000000 --- a/pstoraster/gdevm8.c +++ /dev/null @@ -1,247 +0,0 @@ -/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevm8.c,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* 8-bit-per-pixel "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -/**************** NOTE: copy_rop only works for gray scale ****************/ -extern dev_proc_strip_copy_rop(mem_gray8_rgb24_strip_copy_rop); /* in gdevmrop.c */ - -#define mem_gray8_strip_copy_rop mem_gray8_rgb24_strip_copy_rop - -/* ================ Standard (byte-oriented) device ================ */ - -#undef chunk -#define chunk byte - -/* Procedures */ -declare_mem_procs(mem_mapped8_copy_mono, mem_mapped8_copy_color, mem_mapped8_fill_rectangle); - -/* The device descriptor. */ -const gx_device_memory mem_mapped8_device = -mem_device("image8", 8, 0, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem_mapped8_copy_mono, mem_mapped8_copy_color, mem_mapped8_fill_rectangle, - mem_gray8_strip_copy_rop); - -/* Convert x coordinate to byte offset in scan line. */ -#undef x_to_byte -#define x_to_byte(x) (x) - -/* Fill a rectangle with a color. */ -private int -mem_mapped8_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_fill(dev, x, y, w, h); - bytes_fill_rectangle(scan_line_base(mdev, y) + x, mdev->raster, - (byte) color, w, h); - return 0; -} - -/* Copy a monochrome bitmap. */ -/* We split up this procedure because of limitations in the bcc32 compiler. */ -private void mapped8_copy01(P9(chunk *, const byte *, int, int, uint, - int, int, byte, byte)); -private void mapped8_copyN1(P8(chunk *, const byte *, int, int, uint, - int, int, byte)); -private void mapped8_copy0N(P8(chunk *, const byte *, int, int, uint, - int, int, byte)); -private int -mem_mapped8_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *line; - int first_bit; - - declare_scan_ptr(dest); - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - setup_rect(dest); - line = base + (sourcex >> 3); - first_bit = 0x80 >> (sourcex & 7); -#define is_color(c) ((int)(c) != (int)gx_no_color_index) - if (is_color(one)) { - if (is_color(zero)) - mapped8_copy01(dest, line, first_bit, sraster, draster, - w, h, (byte) zero, (byte) one); - else - mapped8_copyN1(dest, line, first_bit, sraster, draster, - w, h, (byte) one); - } else if (is_color(zero)) - mapped8_copy0N(dest, line, first_bit, sraster, draster, - w, h, (byte) zero); -#undef is_color - return 0; -} -/* Macros for copy loops */ -#define COPY_BEGIN\ - while ( h-- > 0 )\ - { register byte *pptr = dest;\ - const byte *sptr = line;\ - register int sbyte = *sptr;\ - register uint bit = first_bit;\ - int count = w;\ - do\ - { -#define COPY_END\ - if ( (bit >>= 1) == 0 )\ - bit = 0x80, sbyte = *++sptr;\ - pptr++;\ - }\ - while ( --count > 0 );\ - line += sraster;\ - inc_ptr(dest, draster);\ - } -/* Halftone coloring */ -private void -mapped8_copy01(chunk * dest, const byte * line, int first_bit, - int sraster, uint draster, int w, int h, byte b0, byte b1) -{ - COPY_BEGIN - * pptr = (sbyte & bit ? b1 : b0); - COPY_END -} -/* Stenciling */ -private void -mapped8_copyN1(chunk * dest, const byte * line, int first_bit, - int sraster, uint draster, int w, int h, byte b1) -{ - COPY_BEGIN - if (sbyte & bit) - *pptr = b1; - COPY_END -} -/* Reverse stenciling */ -private void -mapped8_copy0N(chunk * dest, const byte * line, int first_bit, - int sraster, uint draster, int w, int h, byte b0) -{ - COPY_BEGIN - if (!(sbyte & bit)) - *pptr = b0; - COPY_END -} -#undef COPY_BEGIN -#undef COPY_END - -/* Copy a color bitmap. */ -private int -mem_mapped8_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h); - return 0; -} - -/* ================ "Word"-oriented device ================ */ - -/* Note that on a big-endian machine, this is the same as the */ -/* standard byte-oriented-device. */ - -#if !arch_is_big_endian - -/* Procedures */ -declare_mem_procs(mem8_word_copy_mono, mem8_word_copy_color, mem8_word_fill_rectangle); - -/* Here is the device descriptor. */ -const gx_device_memory mem_mapped8_word_device = -mem_full_device("image8w", 8, 0, mem_open, - mem_mapped_map_rgb_color, mem_mapped_map_color_rgb, - mem8_word_copy_mono, mem8_word_copy_color, mem8_word_fill_rectangle, - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_word_get_bits_rectangle); - -/* Fill a rectangle with a color. */ -private int -mem8_word_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *base; - uint raster; - - fit_fill(dev, x, y, w, h); - base = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(base, raster, x << 3, w << 3, h, true); - bytes_fill_rectangle(base + x, raster, (byte) color, w, h); - mem_swap_byte_rect(base, raster, x << 3, w << 3, h, true); - return 0; -} - -/* Copy a bitmap. */ -private int -mem8_word_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - bool store; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - store = (zero != gx_no_color_index && one != gx_no_color_index); - mem_swap_byte_rect(row, raster, x << 3, w << 3, h, store); - mem_mapped8_copy_mono(dev, base, sourcex, sraster, id, - x, y, w, h, zero, one); - mem_swap_byte_rect(row, raster, x << 3, w << 3, h, false); - return 0; -} - -/* Copy a color bitmap. */ -private int -mem8_word_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *row; - uint raster; - - fit_copy(dev, base, sourcex, sraster, id, x, y, w, h); - row = scan_line_base(mdev, y); - raster = mdev->raster; - mem_swap_byte_rect(row, raster, x << 3, w << 3, h, true); - mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h); - mem_swap_byte_rect(row, raster, x << 3, w << 3, h, false); - return 0; -} - -#endif /* !arch_is_big_endian */ diff --git a/pstoraster/gdevmem.c b/pstoraster/gdevmem.c deleted file mode 100644 index 59403bb105..0000000000 --- a/pstoraster/gdevmem.c +++ /dev/null @@ -1,498 +0,0 @@ -/* Copyright (C) 1989, 1995, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevmem.c,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* Generic "memory" (stored bitmap) device */ -#include "memory_.h" -#include "gx.h" -#include "gserrors.h" -#include "gsrect.h" -#include "gsstruct.h" -#include "gxarith.h" -#include "gxdevice.h" -#include "gxgetbit.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -/* Structure descriptor */ -public_st_device_memory(); - -/* GC procedures */ -#define mptr ((gx_device_memory *)vptr) -private -ENUM_PTRS_BEGIN(device_memory_enum_ptrs) -{ - return ENUM_USING(st_device_forward, vptr, sizeof(gx_device_forward), index - 2); -} -case 0: -ENUM_RETURN((mptr->foreign_bits ? NULL : (void *)mptr->base)); -ENUM_STRING_PTR(1, gx_device_memory, palette); -ENUM_PTRS_END -private RELOC_PTRS_BEGIN(device_memory_reloc_ptrs) -{ - if (!mptr->foreign_bits) { - byte *base_old = mptr->base; - long reloc; - int y; - - RELOC_PTR(gx_device_memory, base); - reloc = base_old - mptr->base; - for (y = 0; y < mptr->height; y++) - mptr->line_ptrs[y] -= reloc; - /* Relocate line_ptrs, which also points into the data area. */ - mptr->line_ptrs = (byte **) ((byte *) mptr->line_ptrs - reloc); - } - RELOC_CONST_STRING_PTR(gx_device_memory, palette); - RELOC_USING(st_device_forward, vptr, sizeof(gx_device_forward)); -} -RELOC_PTRS_END -#undef mptr - -/* Define the palettes for monobit devices. */ -private const byte b_w_palette_string[6] = -{0xff, 0xff, 0xff, 0, 0, 0}; -const gs_const_string mem_mono_b_w_palette = -{b_w_palette_string, 6}; -private const byte w_b_palette_string[6] = -{0, 0, 0, 0xff, 0xff, 0xff}; -const gs_const_string mem_mono_w_b_palette = -{w_b_palette_string, 6}; - -/* ------ Generic code ------ */ - -/* Return the appropriate memory device for a given */ -/* number of bits per pixel (0 if none suitable). */ -const gx_device_memory * -gdev_mem_device_for_bits(int bits_per_pixel) -{ - switch (bits_per_pixel) { - case 1: - return &mem_mono_device; - case 2: - return &mem_mapped2_device; - case 4: - return &mem_mapped4_device; - case 8: - return &mem_mapped8_device; - case 16: - return &mem_true16_device; - case 24: - return &mem_true24_device; - case 32: - return &mem_true32_device; - default: - return 0; - } -} -/* Do the same for a word-oriented device. */ -const gx_device_memory * -gdev_mem_word_device_for_bits(int bits_per_pixel) -{ - switch (bits_per_pixel) { - case 1: - return &mem_mono_word_device; - case 2: - return &mem_mapped2_word_device; - case 4: - return &mem_mapped4_word_device; - case 8: - return &mem_mapped8_word_device; - case 24: - return &mem_true24_word_device; - case 32: - return &mem_true32_word_device; - default: - return 0; - } -} - -/* Make a memory device. */ -/* Note that the default for monobit devices is white = 0, black = 1. */ -void -gs_make_mem_device(gx_device_memory * dev, const gx_device_memory * mdproto, - gs_memory_t * mem, int page_device, gx_device * target) -{ - gx_device_init((gx_device *) dev, (const gx_device *)mdproto, - mem, true); - dev->stype = &st_device_memory; - switch (page_device) { - case -1: - set_dev_proc(dev, get_page_device, gx_default_get_page_device); - break; - case 1: - set_dev_proc(dev, get_page_device, gx_page_device_get_page_device); - break; - } - dev->target = target; - if (target != 0) { - /* Forward the color mapping operations to the target. */ - gx_device_forward_color_procs((gx_device_forward *) dev); - } - if (dev->color_info.depth == 1) - gdev_mem_mono_set_inverted(dev, - (target == 0 || - (*dev_proc(target, map_rgb_color)) - (target, (gx_color_value) 0, (gx_color_value) 0, - (gx_color_value) 0) != 0)); -} -/* Make a monobit memory device. This is never a page device. */ -/* Note that white=0, black=1. */ -void -gs_make_mem_mono_device(gx_device_memory * dev, gs_memory_t * mem, - gx_device * target) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - *dev = mem_mono_device; - dev->memory = mem; - set_dev_proc(dev, get_page_device, gx_default_get_page_device); - mdev->target = target; - gdev_mem_mono_set_inverted(dev, true); - rc_init(dev, mem, 0); -} - - -/* Define whether a monobit memory device is inverted (black=1). */ -void -gdev_mem_mono_set_inverted(gx_device_memory * dev, bool black_is_1) -{ - if (black_is_1) - dev->palette = mem_mono_b_w_palette; - else - dev->palette = mem_mono_w_b_palette; -} - -/* Compute the size of the bitmap storage, */ -/* including the space for the scan line pointer table. */ -/* Note that scan lines are padded to a multiple of align_bitmap_mod bytes, */ -/* and additional padding may be needed if the pointer table */ -/* must be aligned to an even larger modulus. */ -private ulong -mem_bitmap_bits_size(const gx_device_memory * dev, int width, int height) -{ - return round_up((ulong) height * - bitmap_raster(width * dev->color_info.depth), - max(align_bitmap_mod, arch_align_ptr_mod)); -} -ulong -gdev_mem_data_size(const gx_device_memory * dev, int width, int height) -{ - return mem_bitmap_bits_size(dev, width, height) + - (ulong) height *sizeof(byte *); - -} -/* - * Do the inverse computation: given a width (in pixels) and a buffer size, - * compute the maximum height. - */ -int -gdev_mem_max_height(const gx_device_memory * dev, int width, ulong size) -{ - ulong max_height = size / - (bitmap_raster(width * dev->color_info.depth) + sizeof(byte *)); - int height = (int)min(max_height, max_int); - - /* - * Because of alignment rounding, the just-computed height might - * be too large by a small amount. Adjust it the easy way. - */ - while (gdev_mem_data_size(dev, width, height) > size) - --height; - return height; -} - -/* Open a memory device, allocating the data area if appropriate, */ -/* and create the scan line table. */ -private void mem_set_line_ptrs(P4(gx_device_memory *, byte **, byte *, int)); -int -mem_open(gx_device * dev) -{ - return gdev_mem_open_scan_lines((gx_device_memory *)dev, dev->height); -} -int -gdev_mem_open_scan_lines(gx_device_memory *mdev, int setup_height) -{ - if (setup_height < 0 || setup_height > mdev->height) - return_error(gs_error_rangecheck); - if (mdev->bitmap_memory != 0) { /* Allocate the data now. */ - ulong size = gdev_mem_bitmap_size(mdev); - - if ((uint) size != size) - return_error(gs_error_limitcheck); - mdev->base = gs_alloc_bytes(mdev->bitmap_memory, (uint)size, - "mem_open"); - if (mdev->base == 0) - return_error(gs_error_VMerror); - mdev->foreign_bits = false; - } -/* - * Macro for adding an offset to a pointer when setting up the - * scan line table. This isn't just pointer arithmetic, because of - * the segmenting considerations discussed in gdevmem.h. - */ -#define huge_ptr_add(base, offset)\ - ((void *)((byte huge *)(base) + (offset))) - mem_set_line_ptrs(mdev, - huge_ptr_add(mdev->base, - mem_bitmap_bits_size(mdev, mdev->width, - mdev->height)), - mdev->base, setup_height); - return 0; -} -/* Set up the scan line pointers of a memory device. */ -/* Sets line_ptrs, base, raster; uses width, color_info.depth. */ -private void -mem_set_line_ptrs(gx_device_memory * mdev, byte ** line_ptrs, byte * base, - int count /* >= 0 */) -{ - byte **pptr = mdev->line_ptrs = line_ptrs; - byte **pend = pptr + count; - byte *scan_line = mdev->base = base; - uint raster = mdev->raster = gdev_mem_raster(mdev); - - while (pptr < pend) { - *pptr++ = scan_line; - scan_line = huge_ptr_add(scan_line, raster); - } -} - -/* Return the initial transformation matrix */ -void -mem_get_initial_matrix(gx_device * dev, gs_matrix * pmat) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - pmat->xx = mdev->initial_matrix.xx; - pmat->xy = mdev->initial_matrix.xy; - pmat->yx = mdev->initial_matrix.yx; - pmat->yy = mdev->initial_matrix.yy; - pmat->tx = mdev->initial_matrix.tx; - pmat->ty = mdev->initial_matrix.ty; -} - -/* Test whether a device is a memory device */ -bool -gs_device_is_memory(const gx_device * dev) -{ /* We can't just compare the procs, or even an individual proc, */ - /* because we might be tracing. Instead, check the identity of */ - /* the device name. */ - const gx_device_memory *bdev = - gdev_mem_device_for_bits(dev->color_info.depth); - - if (bdev != 0 && bdev->dname == dev->dname) - return true; - bdev = gdev_mem_word_device_for_bits(dev->color_info.depth); - return (bdev != 0 && bdev->dname == dev->dname); -} - -/* Close a memory device, freeing the data area if appropriate. */ -int -mem_close(gx_device * dev) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - - if (mdev->bitmap_memory != 0) - gs_free_object(mdev->bitmap_memory, mdev->base, "mem_close"); - return 0; -} - -/* Copy bits to a client. */ -#undef chunk -#define chunk byte -int -mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - gs_get_bits_options_t options = params->options; - int x = prect->p.x, w = prect->q.x - x, y = prect->p.y, h = prect->q.y - y; - - if (options == 0) { - params->options = - (GB_ALIGN_STANDARD | GB_ALIGN_ANY) | - (GB_RETURN_COPY | GB_RETURN_POINTER) | - (GB_OFFSET_0 | GB_OFFSET_SPECIFIED | GB_OFFSET_ANY) | - (GB_RASTER_STANDARD | GB_RASTER_SPECIFIED | GB_RASTER_ANY) | - GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE; - return_error(gs_error_rangecheck); - } - if ((w <= 0) | (h <= 0)) { - if ((w | h) < 0) - return_error(gs_error_rangecheck); - return 0; - } - if (x < 0 || w > dev->width - x || - y < 0 || h > dev->height - y - ) - return_error(gs_error_rangecheck); - { - byte *base = scan_line_base(mdev, y); - int code = gx_get_bits_return_pointer(dev, x, h, params, - GB_COLORS_NATIVE | GB_PACKING_CHUNKY | - GB_ALPHA_NONE, base); - - if (code >= 0) - return code; - return gx_get_bits_copy(dev, x, w, h, params, - GB_COLORS_NATIVE | GB_PACKING_CHUNKY | - GB_ALPHA_NONE, base, - gx_device_raster(dev, true)); - } -} - -#if !arch_is_big_endian - -/* - * Swap byte order in a rectangular subset of a bitmap. If store = true, - * assume the rectangle will be overwritten, so don't swap any bytes where - * it doesn't matter. The caller has already done a fit_fill or fit_copy. - * Note that the coordinates are specified in bits, not in terms of the - * actual device depth. - */ -void -mem_swap_byte_rect(byte * base, uint raster, int x, int w, int h, bool store) -{ - int xbit = x & 31; - - if (store) { - if (xbit + w > 64) { /* Operation spans multiple words. */ - /* Just swap the words at the left and right edges. */ - if (xbit != 0) - mem_swap_byte_rect(base, raster, x, 1, h, false); - x += w - 1; - xbit = x & 31; - if (xbit == 31) - return; - w = 1; - } - } - /* Swap the entire rectangle (or what's left of it). */ - { - byte *row = base + ((x >> 5) << 2); - int nw = (xbit + w + 31) >> 5; - int ny; - - for (ny = h; ny > 0; row += raster, --ny) { - int nx = nw; - bits32 *pw = (bits32 *) row; - - do { - bits32 w = *pw; - - *pw++ = (w >> 24) + ((w >> 8) & 0xff00) + - ((w & 0xff00) << 8) + (w << 24); - } - while (--nx); - } - } -} - -/* Copy a word-oriented rectangle to the client, swapping bytes as needed. */ -int -mem_word_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte *src; - uint dev_raster = gx_device_raster(dev, 1); - int x = prect->p.x; - int w = prect->q.x - x; - int y = prect->p.y; - int h = prect->q.y - y; - int bit_x, bit_w; - int code; - - fit_fill_xywh(dev, x, y, w, h); - if (w <= 0 || h <= 0) { - /* - * It's easiest to just keep going with an empty rectangle. - * We pass the original rectangle to mem_get_bits_rectangle, - * so unread will be filled in correctly. - */ - x = y = w = h = 0; - } - bit_x = x * dev->color_info.depth; - bit_w = w * dev->color_info.depth; - src = scan_line_base(mdev, y); - mem_swap_byte_rect(src, dev_raster, bit_x, bit_w, h, false); - code = mem_get_bits_rectangle(dev, prect, params, unread); - mem_swap_byte_rect(src, dev_raster, bit_x, bit_w, h, false); - return code; -} - -#endif /* !arch_is_big_endian */ - -/* Map a r-g-b color to a color index for a mapped color memory device */ -/* (2, 4, or 8 bits per pixel.) */ -/* This requires searching the palette. */ -gx_color_index -mem_mapped_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte br = gx_color_value_to_byte(r); - byte bg = gx_color_value_to_byte(g); - byte bb = gx_color_value_to_byte(b); - register const byte *pptr = mdev->palette.data; - int cnt = mdev->palette.size; - const byte *which = 0; /* initialized only to pacify gcc */ - int best = 256 * 3; - - while ((cnt -= 3) >= 0) { - register int diff = *pptr - br; - - if (diff < 0) - diff = -diff; - if (diff < best) { /* quick rejection */ - int dg = pptr[1] - bg; - - if (dg < 0) - dg = -dg; - if ((diff += dg) < best) { /* quick rejection */ - int db = pptr[2] - bb; - - if (db < 0) - db = -db; - if ((diff += db) < best) - which = pptr, best = diff; - } - } - pptr += 3; - } - return (gx_color_index) ((which - mdev->palette.data) / 3); -} - -/* Map a color index to a r-g-b color for a mapped color memory device. */ -int -mem_mapped_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - const byte *pptr = mdev->palette.data + (int)color * 3; - - prgb[0] = gx_color_value_from_byte(pptr[0]); - prgb[1] = gx_color_value_from_byte(pptr[1]); - prgb[2] = gx_color_value_from_byte(pptr[2]); - return 0; -} diff --git a/pstoraster/gdevmem.h b/pstoraster/gdevmem.h deleted file mode 100644 index b871f5d0de..0000000000 --- a/pstoraster/gdevmem.h +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevmem.h,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* Private definitions for memory devices. */ - -#ifndef gdevmem_INCLUDED -# define gdevmem_INCLUDED - -#include "gxbitops.h" - -/* - The representation for a "memory" device is simply a - contiguous bitmap stored in something like the PostScript - representation, i.e., each scan line (in left-to-right order), padded - to a multiple of bitmap_align_mod bytes, followed immediately by - the next one. - - The representation of strings in the interpreter limits - the size of a string to 64K-1 bytes, which means we can't simply use - a string for the contents of a memory device. - We get around this problem by making the client read out the - contents of a memory device bitmap in pieces. - - On 80x86 PCs running in 16-bit mode, there may be no way to - obtain a contiguous block of storage larger than 64K bytes, - which typically isn't big enough for a full-screen bitmap. - We take the following compromise position: if the PC is running in - native mode (pseudo-segmenting), we limit the bitmap to 64K; - if the PC is running in protected mode (e.g., under MS Windows), - we assume that blocks larger than 64K have sequential segment numbers, - and that the client arranges things so that an individual scan line, - the scan line pointer table, and any single call on a drawing routine - do not cross a segment boundary. - - Even though the scan lines are stored contiguously, we store a table - of their base addresses, because indexing into it is faster than - the multiplication that would otherwise be needed. - */ - -/* - * Macros for scan line access. - * x_to_byte is different for each number of bits per pixel. - * Note that these macros depend on the definition of chunk: - * each procedure that uses the scanning macros should #define - * (not typedef) chunk as either uint or byte. - */ -#define declare_scan_ptr(ptr)\ - DECLARE_SCAN_PTR_VARS(ptr, chunk *, draster) -#define DECLARE_SCAN_PTR_VARS(ptr, ptype, draster)\ - register ptype ptr;\ - uint draster -#define setup_rect(ptr)\ - SETUP_RECT_VARS(ptr, chunk *, draster) -#define SETUP_RECT_VARS(ptr, ptype, draster)\ - draster = mdev->raster;\ - ptr = (ptype)(scan_line_base(mdev, y) +\ - (x_to_byte(x) & -chunk_align_bytes)) - -/* ------ Generic macros ------ */ - -/* Macro for declaring the essential device procedures. */ -dev_proc_get_initial_matrix(mem_get_initial_matrix); -dev_proc_close_device(mem_close); -#define declare_mem_map_procs(map_rgb_color, map_color_rgb)\ - private dev_proc_map_rgb_color(map_rgb_color);\ - private dev_proc_map_color_rgb(map_color_rgb) -#define declare_mem_procs(copy_mono, copy_color, fill_rectangle)\ - private dev_proc_copy_mono(copy_mono);\ - private dev_proc_copy_color(copy_color);\ - private dev_proc_fill_rectangle(fill_rectangle) - -/* The following are used for all except planar or word-oriented devices. */ -dev_proc_open_device(mem_open); -dev_proc_get_bits_rectangle(mem_get_bits_rectangle); -/* The following are for word-oriented devices. */ -#if arch_is_big_endian -# define mem_word_get_bits_rectangle mem_get_bits_rectangle -#else -dev_proc_get_bits_rectangle(mem_word_get_bits_rectangle); -#endif -/* The following are used for the non-true-color devices. */ -dev_proc_map_rgb_color(mem_mapped_map_rgb_color); -dev_proc_map_color_rgb(mem_mapped_map_color_rgb); - -/* - * Macro for generating the device descriptor. - * Various compilers have problems with the obvious definition - * for max_value, namely: - * (depth >= 8 ? 255 : (1 << depth) - 1) - * I tried changing (1 << depth) to (1 << (depth & 15)) to forestall bogus - * error messages about invalid shift counts, but the H-P compiler chokes - * on this. Since the only values of depth we ever plan to support are - * powers of 2 (and 24), we just go ahead and enumerate them. - */ -#define max_value_gray(rgb_depth, gray_depth)\ - (gray_depth ? (1 << gray_depth) - 1 : max_value_rgb(rgb_depth, 0)) -#define max_value_rgb(rgb_depth, gray_depth)\ - (rgb_depth >= 8 ? 255 : rgb_depth == 4 ? 15 : rgb_depth == 2 ? 3 :\ - rgb_depth == 1 ? 1 : (1 << gray_depth) - 1) -#define mem_full_alpha_device(name, rgb_depth, gray_depth, open, map_rgb_color, map_color_rgb, copy_mono, copy_color, fill_rectangle, map_cmyk_color, copy_alpha, strip_tile_rectangle, strip_copy_rop, get_bits_rectangle)\ -{ std_device_dci_body(gx_device_memory, 0, name,\ - 0, 0, 72, 72,\ - (rgb_depth ? 3 : 0) + (gray_depth ? 1 : 0), /* num_components */\ - rgb_depth + gray_depth, /* depth */\ - max_value_gray(rgb_depth, gray_depth), /* max_gray */\ - max_value_rgb(rgb_depth, gray_depth), /* max_color */\ - max_value_gray(rgb_depth, gray_depth) + 1, /* dither_grays */\ - max_value_rgb(rgb_depth, gray_depth) + 1 /* dither_colors */\ - ),\ - { open, /* differs */\ - mem_get_initial_matrix,\ - gx_default_sync_output,\ - gx_default_output_page,\ - mem_close,\ - map_rgb_color, /* differs */\ - map_color_rgb, /* differs */\ - fill_rectangle, /* differs */\ - gx_default_tile_rectangle,\ - copy_mono, /* differs */\ - copy_color, /* differs */\ - gx_default_draw_line,\ - gx_default_get_bits,\ - gx_default_get_params,\ - gx_default_put_params,\ - map_cmyk_color, /* differs */\ - gx_forward_get_xfont_procs,\ - gx_forward_get_xfont_device,\ - gx_default_map_rgb_alpha_color,\ - gx_forward_get_page_device,\ - gx_default_get_alpha_bits, /* default is no alpha */\ - copy_alpha, /* differs */\ - gx_default_get_band,\ - gx_default_copy_rop,\ - gx_default_fill_path,\ - gx_default_stroke_path,\ - gx_default_fill_mask,\ - gx_default_fill_trapezoid,\ - gx_default_fill_parallelogram,\ - gx_default_fill_triangle,\ - gx_default_draw_thin_line,\ - gx_default_begin_image,\ - gx_default_image_data,\ - gx_default_end_image,\ - strip_tile_rectangle, /* differs */\ - strip_copy_rop, /* differs */\ - gx_default_get_clipping_box,\ - gx_default_begin_typed_image,\ - get_bits_rectangle, /* differs */\ - gx_default_map_color_rgb_alpha,\ - gx_default_create_compositor,\ - gx_default_get_hardware_params,\ - gx_default_text_begin\ - },\ - 0, /* target */\ - mem_device_init_private /* see gxdevmem.h */\ -} -#define mem_full_device(name, rgb_depth, gray_depth, open, map_rgb_color, map_color_rgb, copy_mono, copy_color, fill_rectangle, map_cmyk_color, strip_tile_rectangle, strip_copy_rop, get_bits_rectangle)\ - mem_full_alpha_device(name, rgb_depth, gray_depth, open, map_rgb_color,\ - map_color_rgb, copy_mono, copy_color, fill_rectangle,\ - map_cmyk_color, gx_default_copy_alpha,\ - strip_tile_rectangle, strip_copy_rop,\ - get_bits_rectangle) -#define mem_device(name, rgb_depth, gray_depth, map_rgb_color, map_color_rgb, copy_mono, copy_color, fill_rectangle, strip_copy_rop)\ - mem_full_device(name, rgb_depth, gray_depth, mem_open, map_rgb_color,\ - map_color_rgb, copy_mono, copy_color, fill_rectangle,\ - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle,\ - strip_copy_rop, mem_get_bits_rectangle) - -/* Swap a rectangle of bytes, for converting between word- and */ -/* byte-oriented representation. */ -void mem_swap_byte_rect(P6(byte *, uint, int, int, int, bool)); - -/* Copy a rectangle of bytes from a source to a destination. */ -#define mem_copy_byte_rect(mdev, base, sourcex, sraster, x, y, w, h)\ - bytes_copy_rectangle(scan_line_base(mdev, y) + x_to_byte(x),\ - (mdev)->raster,\ - base + x_to_byte(sourcex), sraster,\ - x_to_byte(w), h) - -/* ------ Implementations ------ */ - -extern const gx_device_memory mem_mono_device; -extern const gx_device_memory mem_mapped2_device; -extern const gx_device_memory mem_mapped4_device; -extern const gx_device_memory mem_mapped8_device; -extern const gx_device_memory mem_true16_device; -extern const gx_device_memory mem_true24_device; -extern const gx_device_memory mem_true32_device; -extern const gx_device_memory mem_planar_device; - -#if arch_is_big_endian -# define mem_mono_word_device mem_mono_device -# define mem_mapped2_word_device mem_mapped2_device -# define mem_mapped4_word_device mem_mapped4_device -# define mem_mapped8_word_device mem_mapped8_device -# define mem_true24_word_device mem_true24_device -# define mem_true32_word_device mem_true32_device -#else -extern const gx_device_memory mem_mono_word_device; -extern const gx_device_memory mem_mapped2_word_device; -extern const gx_device_memory mem_mapped4_word_device; -extern const gx_device_memory mem_mapped8_word_device; -extern const gx_device_memory mem_true24_word_device; -extern const gx_device_memory mem_true32_word_device; - -#endif -/* Provide standard palettes for 1-bit devices. */ -extern const gs_const_string mem_mono_b_w_palette; /* black=1, white=0 */ -extern const gs_const_string mem_mono_w_b_palette; /* black=0, white=1 */ - -#endif /* gdevmem_INCLUDED */ diff --git a/pstoraster/gdevmgr.h b/pstoraster/gdevmgr.h deleted file mode 100644 index 4c7127e53b..0000000000 --- a/pstoraster/gdevmgr.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (C) 1992, 1993, 1994 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevmgr.h,v 1.3 2000/03/13 19:00:46 mike Exp $*/ -/* Common header file for MGR devices */ - -#ifndef gdevmgr_INCLUDED -# define gdevmgr_INCLUDED - -#define MGR_RESERVEDCOLORS 16 - -/* Color mapping routines for 8-bit color (with a fixed palette). */ -dev_proc_map_rgb_color(mgr_8bit_map_rgb_color); -dev_proc_map_color_rgb(mgr_8bit_map_color_rgb); - - -/* extract from dump.h */ - -/* - * format for saved bitmaps - */ - -#define B_PUTHDR8(hdr, w, h, d) ( \ - (hdr)->magic[0] = 'y', (hdr)->magic[1] = 'z', \ - (hdr)->h_wide = (((w) >> 6) & 0x3f) + ' ', \ - (hdr)->l_wide = ((w) & 0x3f) + ' ', \ - (hdr)->h_high = (((h) >> 6) & 0x3f) + ' ', \ - (hdr)->l_high = ((h) & 0x3f) + ' ', \ - (hdr)->depth = ((d) & 0x3f) + ' ', \ - (hdr)->_reserved = ' ' ) - -struct b_header { - char magic[2]; /* magics */ - char h_wide; /* upper byte width (biased with 0x20) */ - char l_wide; /* lower byte width (biased with 0x20) */ - char h_high; /* upper byte height (biased with 0x20) */ - char l_high; /* lower byte height (biased with 0x20) */ - char depth; /* depth (biased with 0x20) */ - char _reserved; /* for alignment */ -}; - -/* - * Color lookup table information - */ -struct nclut { - unsigned short colnum; - unsigned short red, green, blue; -} ; - - -/* extract from color.h */ - -/* - * MGR Color Definitions - */ - -#define LUT_BW 0 -#define LUT_GREY 1 -#define LUT_BGREY 2 -#define LUT_VGA 3 -#define LUT_BCT 4 -#define LUT_USER 5 -#define LUT 6 -#define LUT_8 LUT - -#define RGB_RED 0 -#define RGB_GREEN 1 -#define RGB_BLUE 2 -#define RGB 3 - -#define LUTENTRIES 16 - -#define BW_RED 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0, 15, 0 -#define BW_GREEN BW_RED -#define BW_BLUE BW_RED - -#define GREY_RED 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -#define GREY_GREEN GREY_RED -#define GREY_BLUE GREY_RED - -#define BGREY_RED 1, 0, 2, 8, 4, 3, 13, 11, 7, 6, 10, 12, 14, 5, 9, 15 -#define BGREY_GREEN BGREY_RED -#define BGREY_BLUE BGREY_RED - -#define VGA_RED 0, 0, 0, 0, 8, 8, 8, 12, 8, 0, 0, 0, 15, 15, 15, 15 -#define VGA_GREEN 0, 0, 8, 8, 0, 0, 8, 12, 8, 0, 15, 15, 0, 0, 15, 15 -#define VGA_BLUE 0, 8, 0, 8, 0, 8, 0, 12, 8, 15, 0, 15, 0, 15, 0, 15 - -#define BCT_RED 1, 7, 6, 15, 14, 3, 13, 11, 7, 13, 13, 15, 15, 5, 9, 15 -#define BCT_GREEN 1, 7, 13, 12, 5, 3, 13, 11, 7, 14, 15, 15, 14, 5, 9, 15 -#define BCT_BLUE 1, 14, 6, 8, 5, 3, 13, 11, 7, 15, 14, 12, 13, 5, 9, 15 - -#define USER_RED 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define USER_GREEN USER_RED -#define USER_BLUE USER_RED - -static char mgrlut[LUT][RGB][LUTENTRIES] = { - { { BW_RED }, { BW_GREEN }, { BW_BLUE } }, - { { GREY_RED }, { GREY_GREEN }, { GREY_BLUE } }, - { { BGREY_RED }, { BGREY_GREEN }, { BGREY_BLUE } }, - { { VGA_RED }, { VGA_GREEN }, { VGA_BLUE } }, - { { BCT_RED }, { BCT_GREEN }, { BCT_BLUE } }, - { { USER_RED }, { USER_GREEN }, { USER_BLUE } } -}; - -#endif /* gdevmgr_INCLUDED */ diff --git a/pstoraster/gdevmpla.c b/pstoraster/gdevmpla.c deleted file mode 100644 index 674aaaa656..0000000000 --- a/pstoraster/gdevmpla.c +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (C) 1993, 1994, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevmpla.c,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* Any-depth planar "memory" (stored bitmap) devices */ -#include "memory_.h" -#include "gx.h" -#include "gxdevice.h" -#include "gxdevmem.h" /* semi-public definitions */ -#include "gdevmem.h" /* private definitions */ - -/* - * Planar memory devices store the bits by planes instead of by chunks. - * The plane corresponding to the least significant bit of the color index - * is stored first. - * - * The current implementations are quite inefficient. - * We may improve them someday if anyone cares. - */ - -/* Procedures */ -declare_mem_map_procs(mem_planar_map_rgb_color, mem_planar_map_color_rgb); -declare_mem_procs(mem_planar_copy_mono, mem_planar_copy_color, mem_planar_fill_rectangle); - -/* The device descriptor. */ -/* The instance is public. */ -/* The default instance has depth = 1, but clients may set this */ -/* to other values before opening the device. */ -private dev_proc_open_device(mem_planar_open); -private dev_proc_get_bits_rectangle(mem_planar_get_bits_rectangle); -const gx_device_memory mem_planar_device = -mem_full_device("image(planar)", 0, 1, mem_planar_open, - mem_planar_map_rgb_color, mem_planar_map_color_rgb, - mem_planar_copy_mono, mem_planar_copy_color, mem_planar_fill_rectangle, - gx_default_map_cmyk_color, gx_default_strip_tile_rectangle, - gx_no_strip_copy_rop, mem_planar_get_bits_rectangle); - -/* Open a planar memory device. */ -private int -mem_planar_open(gx_device * dev) -{ /* Temporarily reset the parameters, and call */ - /* the generic open procedure. */ - int depth = dev->color_info.depth; - int height = dev->height; - int code; - - dev->height *= depth; - dev->color_info.depth = 1; - code = mem_open(dev); - dev->height = height; - dev->color_info.depth = depth; - return code; -} - -/* Map a r-g-b color to a color index. */ -private gx_color_index -mem_planar_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - int depth = dev->color_info.depth; - - return (*dev_proc(gdev_mem_device_for_bits(depth), map_rgb_color)) - (dev, r, g, b); -} - -/* Map a color index to a r-g-b color. */ -private int -mem_planar_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - int depth = dev->color_info.depth; - - return (*dev_proc(gdev_mem_device_for_bits(depth), map_color_rgb)) - (dev, color, prgb); -} - -/* Fill a rectangle with a color. */ -private int -mem_planar_fill_rectangle(gx_device * dev, - int x, int y, int w, int h, gx_color_index color) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte **ptrs = mdev->line_ptrs; - int i; - - for (i = 0; i < dev->color_info.depth; - i++, mdev->line_ptrs += dev->height - ) - (*dev_proc(&mem_mono_device, fill_rectangle)) (dev, - x, y, w, h, (color >> i) & 1); - mdev->line_ptrs = ptrs; - return 0; -} - -/* Copy a bitmap. */ -private int -mem_planar_copy_mono(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h, gx_color_index zero, gx_color_index one) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte **ptrs = mdev->line_ptrs; - int i; - - for (i = 0; i < dev->color_info.depth; - i++, mdev->line_ptrs += dev->height - ) - (*dev_proc(&mem_mono_device, copy_mono)) (dev, - base, sourcex, sraster, id, x, y, w, h, - (zero == gx_no_color_index ? gx_no_color_index : - (zero >> i) & 1), - (one == gx_no_color_index ? gx_no_color_index : - (one >> i) & 1)); - mdev->line_ptrs = ptrs; - return 0; -} - -/* Copy a color bitmap. */ -/* This is very slow and messy. */ -private int -mem_planar_copy_color(gx_device * dev, - const byte * base, int sourcex, int sraster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - gx_device_memory * const mdev = (gx_device_memory *)dev; - byte **ptrs = mdev->line_ptrs; - int depth = dev->color_info.depth; - int wleft = w; - int hleft = h; - const byte *srow = base; - int ynext = y; - -#define max_w 32 - union _b { - long l[max_w / sizeof(long)]; - byte b[max_w / 8]; - } buf; - - while (wleft > max_w) { - mem_planar_copy_color(dev, base, - sourcex + wleft - max_w, sraster, gx_no_bitmap_id, - x + wleft - max_w, y, max_w, h); - wleft -= max_w; - } - for (; hleft > 0; - srow += sraster, ynext++, hleft--, - mdev->line_ptrs += dev->height - ) { - int i; - - for (i = 0; i < depth; - i++, mdev->line_ptrs += dev->height - ) { - int sx, bx; - - memset(buf.b, 0, sizeof(buf.b)); - for (sx = 0, bx = sourcex * depth + depth - 1 - i; - sx < w; sx++, bx += depth - ) - if (srow[bx >> 3] & (0x80 >> (bx & 7))) - buf.b[sx >> 3] |= 0x80 >> (sx & 7); - (*dev_proc(&mem_mono_device, copy_mono)) (dev, - buf.b, 0, sizeof(buf), gx_no_bitmap_id, - x, ynext, w, 1, - (gx_color_index) 0, (gx_color_index) 1); - } - mdev->line_ptrs = ptrs; - } - return 0; -} - -/* Copy bits back from a planar memory device. */ -/****** NOT IMPLEMENTED YET ******/ -private int -mem_planar_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - return_error(-1); -} diff --git a/pstoraster/gdevmrop.h b/pstoraster/gdevmrop.h deleted file mode 100644 index 27bff2c694..0000000000 --- a/pstoraster/gdevmrop.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (C) 1995, 1996, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevmrop.h,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* Definitions for device RasterOp implementations. */ -/* Requires gxdevmem.h, gsropt.h */ - -#ifndef gdevmrop_INCLUDED -# define gdevmrop_INCLUDED - -/* Define the table of RasterOp implementation procedures. */ -extern const rop_proc rop_proc_table[256]; - -/* Define the table of RasterOp operand usage. */ -extern const byte /*rop_usage_t */ rop_usage_table[256]; - -/* - * Compute the effective RasterOp for the 1-bit case, - * taking transparency into account. - */ -gs_rop3_t gs_transparent_rop(P1(gs_logical_operation_t lop)); - -#ifdef DEBUG -/* Trace a [strip_]copy_rop call. */ -void trace_copy_rop(P16(const char *cname, gx_device * dev, - const byte * sdata, int sourcex, uint sraster, - gx_bitmap_id id, const gx_color_index * scolors, - const gx_strip_bitmap * textures, - const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop)); -#endif - -/* - * PostScript colors normally act as the texture for RasterOp, with a null - * (all zeros) source. For images with CombineWithColor = true, we need - * a way to use the image data as the source. We implement this with a - * device that applies RasterOp with a specified texture to drawing - * operations, treating the drawing color as source rather than texture. - * The texture is a gx_device_color; it may be any type of color, even a - * pattern. - */ -#ifndef gx_device_color_DEFINED -# define gx_device_color_DEFINED -typedef struct gx_device_color_s gx_device_color; - -#endif - -#ifndef gx_device_rop_texture_DEFINED -# define gx_device_rop_texture_DEFINED -typedef struct gx_device_rop_texture_s gx_device_rop_texture; - -#endif - -struct gx_device_rop_texture_s { - gx_device_forward_common; - gs_logical_operation_t log_op; - gx_device_color texture; -}; - -#define private_st_device_rop_texture() /* in gdevrops.c */\ - gs_private_st_composite(st_device_rop_texture, gx_device_rop_texture,\ - "gx_device_rop_texture", device_rop_texture_enum_ptrs, device_rop_texture_reloc_ptrs) - -/* Create a RasterOp source device. */ -int gx_alloc_rop_texture_device(P3(gx_device_rop_texture ** prsdev, - gs_memory_t * mem, - client_name_t cname)); - -/* Initialize a RasterOp source device. */ -void gx_make_rop_texture_device(P4(gx_device_rop_texture * rsdev, - gx_device * target, - gs_logical_operation_t lop, - const gx_device_color * texture)); - -#endif /* gdevmrop_INCLUDED */ diff --git a/pstoraster/gdevnfwd.c b/pstoraster/gdevnfwd.c deleted file mode 100644 index 9b8d971fa7..0000000000 --- a/pstoraster/gdevnfwd.c +++ /dev/null @@ -1,797 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevnfwd.c,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* Null and forwarding device implementation */ -#include "gx.h" -#include "gserrors.h" -#include "gxdevice.h" - -/* ---------------- Forwarding procedures ---------------- */ - -/* Fill in NULL procedures in a forwarding device procedure record. */ -/* We don't fill in: open_device, close_device, or the lowest-level */ -/* drawing operations. */ -void -gx_device_forward_fill_in_procs(register gx_device_forward * dev) -{ - gx_device_set_procs((gx_device *) dev); - /* NOT open_device */ - fill_dev_proc(dev, get_initial_matrix, gx_forward_get_initial_matrix); - fill_dev_proc(dev, sync_output, gx_forward_sync_output); - fill_dev_proc(dev, output_page, gx_forward_output_page); - /* NOT close_device */ - fill_dev_proc(dev, map_rgb_color, gx_forward_map_rgb_color); - fill_dev_proc(dev, map_color_rgb, gx_forward_map_color_rgb); - /* NOT fill_rectangle */ - /* NOT tile_rectangle */ - /* NOT copy_mono */ - /* NOT copy_color */ - /* NOT draw_line (OBSOLETE) */ - fill_dev_proc(dev, get_bits, gx_forward_get_bits); - fill_dev_proc(dev, get_params, gx_forward_get_params); - fill_dev_proc(dev, put_params, gx_forward_put_params); - fill_dev_proc(dev, map_cmyk_color, gx_forward_map_cmyk_color); - fill_dev_proc(dev, get_xfont_procs, gx_forward_get_xfont_procs); - fill_dev_proc(dev, get_xfont_device, gx_forward_get_xfont_device); - fill_dev_proc(dev, map_rgb_alpha_color, gx_forward_map_rgb_alpha_color); - fill_dev_proc(dev, get_page_device, gx_forward_get_page_device); - fill_dev_proc(dev, get_alpha_bits, gx_forward_get_alpha_bits); - /* NOT copy_alpha */ - fill_dev_proc(dev, get_band, gx_forward_get_band); - fill_dev_proc(dev, copy_rop, gx_forward_copy_rop); - fill_dev_proc(dev, fill_path, gx_forward_fill_path); - fill_dev_proc(dev, stroke_path, gx_forward_stroke_path); - fill_dev_proc(dev, fill_mask, gx_forward_fill_mask); - fill_dev_proc(dev, fill_trapezoid, gx_forward_fill_trapezoid); - fill_dev_proc(dev, fill_parallelogram, gx_forward_fill_parallelogram); - fill_dev_proc(dev, fill_triangle, gx_forward_fill_triangle); - fill_dev_proc(dev, draw_thin_line, gx_forward_draw_thin_line); - fill_dev_proc(dev, begin_image, gx_forward_begin_image); - /* NOT image_data (OBSOLETE) */ - /* NOT end_image (OBSOLETE) */ - /* NOT strip_tile_rectangle */ - fill_dev_proc(dev, strip_copy_rop, gx_forward_strip_copy_rop); - fill_dev_proc(dev, get_clipping_box, gx_forward_get_clipping_box); - fill_dev_proc(dev, begin_typed_image, gx_forward_begin_typed_image); - fill_dev_proc(dev, get_bits_rectangle, gx_forward_get_bits_rectangle); - fill_dev_proc(dev, map_color_rgb_alpha, gx_forward_map_color_rgb_alpha); - fill_dev_proc(dev, create_compositor, gx_no_create_compositor); - fill_dev_proc(dev, get_hardware_params, gx_forward_get_hardware_params); - fill_dev_proc(dev, text_begin, gx_forward_text_begin); - gx_device_fill_in_procs((gx_device *) dev); -} - -/* Forward the color mapping procedures from a device to its target. */ -void -gx_device_forward_color_procs(gx_device_forward * dev) -{ - set_dev_proc(dev, map_rgb_color, gx_forward_map_rgb_color); - set_dev_proc(dev, map_color_rgb, gx_forward_map_color_rgb); - set_dev_proc(dev, map_cmyk_color, gx_forward_map_cmyk_color); - set_dev_proc(dev, map_rgb_alpha_color, gx_forward_map_rgb_alpha_color); - set_dev_proc(dev, map_color_rgb_alpha, gx_forward_map_color_rgb_alpha); -} - -void -gx_forward_get_initial_matrix(gx_device * dev, gs_matrix * pmat) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - if (tdev == 0) - gx_default_get_initial_matrix(dev, pmat); - else - (*dev_proc(tdev, get_initial_matrix)) (tdev, pmat); -} - -int -gx_forward_sync_output(gx_device * dev) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_sync_output(dev) : - (*dev_proc(tdev, sync_output)) (tdev)); -} - -int -gx_forward_output_page(gx_device * dev, int num_copies, int flush) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_output_page(dev, num_copies, flush) : - (*dev_proc(tdev, output_page)) (tdev, num_copies, flush)); -} - -gx_color_index -gx_forward_map_rgb_color(gx_device * dev, gx_color_value r, gx_color_value g, - gx_color_value b) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_map_rgb_color(dev, r, g, b) : - (*dev_proc(tdev, map_rgb_color)) (tdev, r, g, b)); -} - -int -gx_forward_map_color_rgb(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_map_color_rgb(dev, color, prgb) : - (*dev_proc(tdev, map_color_rgb)) (tdev, color, prgb)); -} - -int -gx_forward_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - if (tdev == 0) - return_error(gs_error_Fatal); - return (*dev_proc(tdev, fill_rectangle)) (tdev, x, y, w, h, color); -} - -int -gx_forward_tile_rectangle(gx_device * dev, const gx_tile_bitmap * tile, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1, - int px, int py) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_tile_rectangle((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_tile_rectangle; - else - proc = dev_proc(tdev, tile_rectangle); - return (*proc) (tdev, tile, x, y, w, h, color0, color1, px, py); -} - -int -gx_forward_copy_mono(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - if (tdev == 0) - return_error(gs_error_Fatal); - return (*dev_proc(tdev, copy_mono)) - (tdev, data, dx, raster, id, x, y, w, h, zero, one); -} - -int -gx_forward_copy_color(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - if (tdev == 0) - return_error(gs_error_Fatal); - return (*dev_proc(tdev, copy_color)) - (tdev, data, dx, raster, id, x, y, w, h); -} - -int -gx_forward_get_bits(gx_device * dev, int y, byte * data, byte ** actual_data) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_get_bits(dev, y, data, actual_data) : - (*dev_proc(tdev, get_bits)) (tdev, y, data, actual_data)); -} - -int -gx_forward_get_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_get_params(dev, plist) : - (*dev_proc(tdev, get_params)) (tdev, plist)); -} - -int -gx_forward_put_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_put_params(dev, plist) : - (*dev_proc(tdev, put_params)) (tdev, plist)); -} - -gx_color_index -gx_forward_map_cmyk_color(gx_device * dev, gx_color_value c, gx_color_value m, - gx_color_value y, gx_color_value k) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_map_cmyk_color(dev, c, m, y, k) : - (*dev_proc(tdev, map_cmyk_color)) (tdev, c, m, y, k)); -} - -const gx_xfont_procs * -gx_forward_get_xfont_procs(gx_device * dev) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_get_xfont_procs(dev) : - (*dev_proc(tdev, get_xfont_procs)) (tdev)); -} - -gx_device * -gx_forward_get_xfont_device(gx_device * dev) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_get_xfont_device(dev) : - (*dev_proc(tdev, get_xfont_device)) (tdev)); -} - -gx_color_index -gx_forward_map_rgb_alpha_color(gx_device * dev, gx_color_value r, - gx_color_value g, gx_color_value b, gx_color_value alpha) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? - gx_default_map_rgb_alpha_color(dev, r, g, b, alpha) : - (*dev_proc(tdev, map_rgb_alpha_color)) (tdev, r, g, b, alpha)); -} - -gx_device * -gx_forward_get_page_device(gx_device * dev) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - gx_device *pdev; - - if (tdev == 0) - return gx_default_get_page_device(dev); - pdev = (*dev_proc(tdev, get_page_device)) (tdev); - return (pdev == tdev ? dev : pdev); -} - -int -gx_forward_get_alpha_bits(gx_device * dev, graphics_object_type type) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? - gx_default_get_alpha_bits(dev, type) : - (*dev_proc(tdev, get_alpha_bits)) (tdev, type)); -} - -int -gx_forward_get_band(gx_device * dev, int y, int *band_start) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? - gx_default_get_band(dev, y, band_start) : - (*dev_proc(tdev, get_band)) (tdev, y, band_start)); -} - -int -gx_forward_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_tile_bitmap * texture, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_copy_rop((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_copy_rop; - else - proc = dev_proc(tdev, copy_rop); - return (*proc) (tdev, sdata, sourcex, sraster, id, scolors, - texture, tcolors, x, y, width, height, - phase_x, phase_y, lop); -} - -int -gx_forward_fill_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_fill_params * params, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_fill_path((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_fill_path; - else - proc = dev_proc(tdev, fill_path); - return (*proc) (tdev, pis, ppath, params, pdcolor, pcpath); -} - -int -gx_forward_stroke_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_stroke_params * params, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_stroke_path((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_stroke_path; - else - proc = dev_proc(tdev, stroke_path); - return (*proc) (tdev, pis, ppath, params, pdcolor, pcpath); -} - -int -gx_forward_fill_mask(gx_device * dev, - const byte * data, int dx, int raster, gx_bitmap_id id, - int x, int y, int w, int h, - const gx_drawing_color * pdcolor, int depth, - gs_logical_operation_t lop, const gx_clip_path * pcpath) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_fill_mask((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_fill_mask; - else - proc = dev_proc(tdev, fill_mask); - return (*proc) (tdev, data, dx, raster, id, x, y, w, h, pdcolor, depth, - lop, pcpath); -} - -int -gx_forward_fill_trapezoid(gx_device * dev, - const gs_fixed_edge * left, const gs_fixed_edge * right, - fixed ybot, fixed ytop, bool swap_axes, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_fill_trapezoid((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_fill_trapezoid; - else - proc = dev_proc(tdev, fill_trapezoid); - return (*proc) (tdev, left, right, ybot, ytop, swap_axes, pdcolor, lop); -} - -int -gx_forward_fill_parallelogram(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_fill_parallelogram((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_fill_parallelogram; - else - proc = dev_proc(tdev, fill_parallelogram); - return (*proc) (tdev, px, py, ax, ay, bx, by, pdcolor, lop); -} - -int -gx_forward_fill_triangle(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_fill_triangle((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_fill_triangle; - else - proc = dev_proc(tdev, fill_triangle); - return (*proc) (tdev, px, py, ax, ay, bx, by, pdcolor, lop); -} - -int -gx_forward_draw_thin_line(gx_device * dev, - fixed fx0, fixed fy0, fixed fx1, fixed fy1, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_draw_thin_line((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_draw_thin_line; - else - proc = dev_proc(tdev, draw_thin_line); - return (*proc) (tdev, fx0, fy0, fx1, fy1, pdcolor, lop); -} - -int -gx_forward_begin_image(gx_device * dev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_begin_image((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_begin_image; - else - proc = dev_proc(tdev, begin_image); - return (*proc) (tdev, pis, pim, format, prect, pdcolor, pcpath, - memory, pinfo); -} - -int -gx_forward_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, - int x, int y, int w, int h, gx_color_index color0, gx_color_index color1, - int px, int py) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_strip_tile_rectangle((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_strip_tile_rectangle; - else - proc = dev_proc(tdev, strip_tile_rectangle); - return (*proc) (tdev, tiles, x, y, w, h, color0, color1, px, py); -} - -int -gx_forward_strip_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_strip_bitmap * textures, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_strip_copy_rop((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_strip_copy_rop; - else - proc = dev_proc(tdev, strip_copy_rop); - return (*proc) (tdev, sdata, sourcex, sraster, id, scolors, - textures, tcolors, x, y, width, height, - phase_x, phase_y, lop); -} - -void -gx_forward_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - if (tdev == 0) - gx_default_get_clipping_box(dev, pbox); - else - (*dev_proc(tdev, get_clipping_box)) (tdev, pbox); -} - -int -gx_forward_begin_typed_image(gx_device * dev, - const gs_imager_state * pis, const gs_matrix * pmat, - const gs_image_common_t * pim, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gx_image_enum_common_t ** pinfo) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_begin_typed_image((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_begin_typed_image; - else - proc = dev_proc(tdev, begin_typed_image); - return (*proc) (tdev, pis, pmat, pim, prect, pdcolor, pcpath, - memory, pinfo); -} - -int -gx_forward_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_get_bits_rectangle((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_get_bits_rectangle; - else - proc = dev_proc(tdev, get_bits_rectangle); - return (*proc) (tdev, prect, params, unread); -} - -int -gx_forward_map_color_rgb_alpha(gx_device * dev, gx_color_index color, - gx_color_value prgba[4]) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_map_color_rgb_alpha(dev, color, prgba) : - (*dev_proc(tdev, map_color_rgb_alpha)) (tdev, color, prgba)); -} - -int -gx_forward_get_hardware_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - return (tdev == 0 ? gx_default_get_hardware_params(dev, plist) : - (*dev_proc(tdev, get_hardware_params)) (tdev, plist)); -} - -int -gx_forward_text_begin(gx_device * dev, gs_imager_state * pis, - const gs_text_params_t * text, const gs_font * font, -gx_path * path, const gx_device_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * memory, gs_text_enum_t ** ppenum) -{ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - - dev_proc_text_begin((*proc)); - - if (tdev == 0) - tdev = dev, proc = gx_default_text_begin; - else - proc = dev_proc(tdev, text_begin); - return (*proc) (tdev, pis, text, font, path, pdcolor, pcpath, - memory, ppenum); -} - -/* ---------------- The null device(s) ---------------- */ - -private dev_proc_fill_rectangle(null_fill_rectangle); -private dev_proc_copy_mono(null_copy_mono); -private dev_proc_copy_color(null_copy_color); -private dev_proc_put_params(null_put_params); -private dev_proc_copy_alpha(null_copy_alpha); -private dev_proc_copy_rop(null_copy_rop); -private dev_proc_fill_path(null_fill_path); -private dev_proc_stroke_path(null_stroke_path); -private dev_proc_fill_trapezoid(null_fill_trapezoid); -private dev_proc_fill_parallelogram(null_fill_parallelogram); -private dev_proc_fill_triangle(null_fill_triangle); -private dev_proc_draw_thin_line(null_draw_thin_line); - -/* We would like to have null implementations of begin/data/end image, */ -/* but we can't do this, because image_data must keep track of the */ -/* Y position so it can return 1 when done. */ -private dev_proc_strip_copy_rop(null_strip_copy_rop); - -#define null_procs(get_page_device) {\ - gx_default_open_device,\ - gx_forward_get_initial_matrix,\ - gx_default_sync_output,\ - gx_default_output_page,\ - gx_default_close_device,\ - gx_forward_map_rgb_color,\ - gx_forward_map_color_rgb,\ - null_fill_rectangle,\ - gx_default_tile_rectangle,\ - null_copy_mono,\ - null_copy_color,\ - gx_default_draw_line,\ - gx_default_get_bits,\ - gx_forward_get_params,\ - null_put_params,\ - gx_forward_map_cmyk_color,\ - gx_forward_get_xfont_procs,\ - gx_forward_get_xfont_device,\ - gx_forward_map_rgb_alpha_color,\ - get_page_device, /* differs */\ - gx_forward_get_alpha_bits,\ - null_copy_alpha,\ - gx_forward_get_band,\ - null_copy_rop,\ - null_fill_path,\ - null_stroke_path,\ - gx_default_fill_mask,\ - null_fill_trapezoid,\ - null_fill_parallelogram,\ - null_fill_triangle,\ - null_draw_thin_line,\ - gx_default_begin_image,\ - gx_default_image_data,\ - gx_default_end_image,\ - gx_default_strip_tile_rectangle,\ - null_strip_copy_rop,\ - gx_default_get_clipping_box,\ - gx_default_begin_typed_image,\ - gx_default_get_bits_rectangle,\ - gx_forward_map_color_rgb_alpha,\ - gx_non_imaging_create_compositor,\ - gx_forward_get_hardware_params,\ - gx_default_text_begin\ -} - -const gx_device_null gs_null_device = -{ - std_device_std_body_type_open(gx_device_null, 0, "null", &st_device_null, - 0, 0, 72, 72), - null_procs(gx_default_get_page_device /* not a page device */ ), - 0 /* target */ -}; - -const gx_device_null gs_nullpage_device = -{ -std_device_std_body_type_open(gx_device_null, 0, "nullpage", &st_device_null, - 72 /*nominal */ , 72 /*nominal */ , 72, 72), - null_procs(gx_page_device_get_page_device /* a page device */ ), - 0 /* target */ -}; - -private int -null_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - return 0; -} -private int -null_copy_mono(gx_device * dev, const byte * data, - int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - return 0; -} -private int -null_copy_color(gx_device * dev, const byte * data, - int data_x, int raster, gx_bitmap_id id, - int x, int y, int width, int height) -{ - return 0; -} -private int -null_put_params(gx_device * dev, gs_param_list * plist) -{ - /* - * If this is not a page device, we must defeat attempts to reset - * the size; otherwise this is equivalent to gx_forward_put_params. - */ - gx_device_forward * const fdev = (gx_device_forward *)dev; - gx_device *tdev = fdev->target; - int code; - - if (tdev != 0) - return (*dev_proc(tdev, put_params)) (tdev, plist); - code = gx_default_put_params(dev, plist); - if (code < 0 || (*dev_proc(dev, get_page_device)) (dev) == dev) - return code; - dev->width = dev->height = 0; - return code; -} -private int -null_copy_alpha(gx_device * dev, const byte * data, int data_x, - int raster, gx_bitmap_id id, int x, int y, int width, int height, - gx_color_index color, int depth) -{ - return 0; -} -private int -null_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_tile_bitmap * texture, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - return 0; -} -private int -null_fill_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_fill_params * params, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath) -{ - return 0; -} -private int -null_stroke_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_stroke_params * params, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath) -{ - return 0; -} -private int -null_fill_trapezoid(gx_device * dev, - const gs_fixed_edge * left, const gs_fixed_edge * right, - fixed ybot, fixed ytop, bool swap_axes, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - return 0; -} -private int -null_fill_parallelogram(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - return 0; -} -private int -null_fill_triangle(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - return 0; -} -private int -null_draw_thin_line(gx_device * dev, - fixed fx0, fixed fy0, fixed fx1, fixed fy1, - const gx_drawing_color * pdcolor, gs_logical_operation_t lop) -{ - return 0; -} -private int -null_strip_copy_rop(gx_device * dev, - const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id, - const gx_color_index * scolors, - const gx_strip_bitmap * textures, const gx_color_index * tcolors, - int x, int y, int width, int height, - int phase_x, int phase_y, gs_logical_operation_t lop) -{ - return 0; -} diff --git a/pstoraster/gdevpccm.h b/pstoraster/gdevpccm.h deleted file mode 100644 index 5af4ca1cf4..0000000000 --- a/pstoraster/gdevpccm.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1992 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpccm.h,v 1.3 2000/03/13 19:00:47 mike Exp $ */ -/* Requires gxdevice.h */ - -#ifndef gdevpccm_INCLUDED -# define gdevpccm_INCLUDED - -/* Color mapping routines for EGA/VGA-style color. */ -dev_proc_map_rgb_color(pc_4bit_map_rgb_color); -dev_proc_map_color_rgb(pc_4bit_map_color_rgb); -#define dci_pc_4bit { 3, 4, 3, 2, 4, 3 } - -/* Color mapping routines for 8-bit color (with a fixed palette). */ -dev_proc_map_rgb_color(pc_8bit_map_rgb_color); -dev_proc_map_color_rgb(pc_8bit_map_color_rgb); -#define dci_pc_8bit { 3, 8, 6, 6, 7, 7 } - -/* Write the palette on a file. */ -int pc_write_palette(P3(gx_device *, uint, FILE *)); - -#endif /* gdevpccm_INCLUDED */ diff --git a/pstoraster/gdevpcfb.h b/pstoraster/gdevpcfb.h deleted file mode 100644 index cc217e85ee..0000000000 --- a/pstoraster/gdevpcfb.h +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 1989, 1995 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpcfb.h,v 1.3 2000/03/13 19:00:47 mike Exp $ */ -/* IBM PC frame buffer definitions */ - -#ifndef gdevpcfb_INCLUDED -# define gdevpcfb_INCLUDED - -#ifdef __MSDOS__ -# include "dos_.h" -typedef union REGS registers; - -#endif - -/* For testing, the 16-color display may be defined as a monochrome, */ -/* 8-color, or 16-color device. */ -#define ega_bits_of_color 2 /* 0, 1, or 2 */ -#define rgb_max ega_bits_of_color - -/* Define the short (integer) version of "transparent" color. */ -/* ****** Depends on gx_no_color_index being all 1's. ***** */ -#define no_color ((int)gx_no_color_index) - -/* Procedures */ - - /* See gxdevice.h for the definitions of the procedures. */ - -dev_proc_open_device(ega_open); -dev_proc_close_device(ega_close); -dev_proc_fill_rectangle(ega_fill_rectangle); -dev_proc_tile_rectangle(ega_tile_rectangle); -dev_proc_copy_mono(ega_copy_mono); -dev_proc_copy_color(ega_copy_color); -dev_proc_get_bits(ega_get_bits); - -/* Structure for saving state of BIOS variables. */ -typedef struct pcfb_bios_state_s { - int display_mode; /* must be first, see pcfb_save_state */ - /* in gdevpcfb.c */ - byte text_page; - uint text_cursor_mode; - uint text_font; - byte text_attribute; - byte border_color; -} pcfb_bios_state; - -/* Procedures used by gdevpcfb.c */ -void pcfb_set_signals(P1(gx_device *)); -void pcfb_get_state(P1(pcfb_bios_state *)); -void pcfb_set_mode(P1(int)); -void pcfb_set_state(P1(const pcfb_bios_state *)); - -/* Types for frame buffer pointers. */ -typedef byte *fb_ptr; -typedef volatile byte *volatile_fb_ptr; - -/* Define the nominal page height in inches. */ -#ifdef A4 -# define PAGE_HEIGHT_INCHES 11.69 -#else -# define PAGE_HEIGHT_INCHES 11.0 -#endif - -/* The device descriptor */ -typedef struct gx_device_ega_s gx_device_ega; -struct gx_device_ega_s { - gx_device_common; - int raster; /* frame buffer bytes per line */ - int fb_seg_mult; /* multiplier for segment part */ - /* of frame buffer pointer */ - int fb_byte_mult; /* multiplier for word part ditto */ -#define mk_fb_ptr(x, y)\ - (fb_dev->fb_byte_mult == 0 ?\ - (fb_ptr)MK_PTR(regen + (y) * (fb_dev->fb_seg_mult), (x) >> 3) :\ - (fb_ptr)MK_PTR(regen + ((y) >> 4) * (fb_dev->fb_seg_mult),\ - (((y) & 15) * fb_dev->fb_byte_mult) + ((x) >> 3))) - int video_mode; -}; - -/* Macro for creating instances */ -/* The initial parameters map an appropriate fraction of */ -/* the screen to a full-page coordinate space. */ -/* This may or may not be what is desired! */ -#define ega_device(dev_name, procs, fb_raster, screen_height, aspect_ratio, video_mode)\ - { std_device_dci_body(gx_device_ega, &procs, dev_name,\ - fb_raster * 8, screen_height,\ - (screen_height * (aspect_ratio)) / PAGE_HEIGHT_INCHES, /* x dpi */\ - screen_height / PAGE_HEIGHT_INCHES, /* y dpi */\ - (rgb_max ? 3 : 1), /* num_components */\ - 4, /* depth */\ - (rgb_max ? rgb_max : 1), /* max_gray */\ - rgb_max,\ - (rgb_max ? rgb_max + 1 : 2), /* dither_grays */\ - (rgb_max ? rgb_max + 1 : 0) /* dither_colors */\ - ),\ - { 0 }, /* std_procs */\ - fb_raster,\ - (fb_raster & 15 ? fb_raster : fb_raster >> 4),\ - (fb_raster & 15 ? fb_raster : 0),\ - video_mode\ - } - -/* Define the device port and register numbers, and the regen map base */ -#define seq_addr 0x3c4 -#define s_map 2 -#define set_s_map(mask) outport2(seq_addr, s_map, mask) -#define graph_addr 0x3ce -#define g_const 0 /* set/reset */ -#define set_g_const(color) outport2(graph_addr, g_const, color) -#define g_const_map 1 /* enable set/reset */ -#define set_g_const_map(map) outport2(graph_addr, g_const_map, map) -#define g_function 3 -# define gf_WRITE 0 -# define gf_AND 8 -# define gf_OR 0x10 -# define gf_XOR 0x18 -#define set_g_function(func) outport2(graph_addr, g_function, func) -#define g_read_plane 4 -#define set_g_read_plane(plane) outport2(graph_addr, g_read_plane, plane) -#define g_mode 5 -# define gm_DATA 0 -# define gm_FILL 2 -#define set_g_mode(mode) outport2(graph_addr, g_mode, mode) -#define g_mask 8 -#define set_g_mask(mask) outport2(graph_addr, g_mask, mask) -#define select_g_mask() outportb(graph_addr, g_mask) -#define out_g_mask(mask) outportb(graph_addr+1, mask) -#define regen 0xa000 - -/* Define access to the frame buffer and the video registers */ -/* according to whether we are on a DOS system or a Unix system. */ - -#if defined(M_UNIX) || defined(M_XENIX) || defined(UNIX) || defined(SYSV) || defined(__linux__) - - /* SCO Unix/Xenix, AT&T SVR4, or Linux. */ - -#undef outportb - -#if defined(__GNUC__) - /* Inline assembly version for gcc */ - /* Under SCO, requires installing the gnu assembler as "as" */ -static inline void -outportb(int port, int data) -{ - __asm__ volatile ("outb %0,%1":: - "a" ((unsigned char)data), - "d" ((unsigned short)port)); -} -static inline void -outport2(int port, int index, int data) -{ - __asm__ volatile ("movb %0,%%ah; movb %1,%%al; outw %%ax,%2":: - "qmi" ((unsigned char)data), - "qmi" ((unsigned char)index), - "d" ((unsigned short)port): - "eax"); -} -#else -void outportb(P2(uint, byte)); -void outport2(P3(uint, byte, byte)); - -#endif - -/* Redefine mk_fb_ptr -- no segmented addressing. */ - -#undef mk_fb_ptr -extern fb_ptr fb_addr; - -#define mk_fb_ptr(x, y) (fb_addr + (y) * (fb_dev->raster) + ((x) >> 3)) - -#else - - /* MS-DOS */ - -/* outportb is defined in dos_.h */ -#define outport2(port, index, data)\ - (outportb(port, index), outportb((port)+1, data)) - -#endif - -/* Fetch and discard a byte. Prevent the compiler from */ -/* optimizing this away. */ -static unsigned char byte_discard_; - -#define byte_discard(expr) byte_discard_ = (expr) - -#endif /* gdevpcfb_INCLUDED */ diff --git a/pstoraster/gdevpcl.h b/pstoraster/gdevpcl.h deleted file mode 100644 index 3a581d26ad..0000000000 --- a/pstoraster/gdevpcl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 1992, 1994 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpcl.h,v 1.3 2000/03/13 19:00:47 mike Exp $ */ -/* Requires gdevprn.h */ - -#ifndef gdevpcl_INCLUDED -# define gdevpcl_INCLUDED - -/* Define the PCL paper size codes. */ -#define PAPER_SIZE_LETTER 2 -#define PAPER_SIZE_LEGAL 3 -#define PAPER_SIZE_A4 26 -#define PAPER_SIZE_A3 27 -#define PAPER_SIZE_A2 28 -#define PAPER_SIZE_A1 29 -#define PAPER_SIZE_A0 30 - -/* Get the paper size code, based on width and height. */ -int gdev_pcl_paper_size(P1(gx_device *)); - -/* Color mapping procedures for 3-bit-per-pixel RGB printers */ -dev_proc_map_rgb_color(gdev_pcl_3bit_map_rgb_color); -dev_proc_map_color_rgb(gdev_pcl_3bit_map_color_rgb); - -/* Row compression routines */ -typedef ulong word; -int gdev_pcl_mode2compress(P3(const word * row, const word * end_row, byte * compressed)), - gdev_pcl_mode3compress(P4(int bytecount, const byte * current, byte * previous, byte * compressed)); - -#endif /* gdevpcl_INCLUDED */ diff --git a/pstoraster/gdevpipe.c b/pstoraster/gdevpipe.c deleted file mode 100644 index 09357ad2c6..0000000000 --- a/pstoraster/gdevpipe.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 1993, 1994, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpipe.c,v 1.2 2000/03/08 23:14:24 mike Exp $ */ -/* %pipe% IODevice */ -#include "errno_.h" -#include "pipe_.h" -#include "stdio_.h" -#include "string_.h" -#include "gserror.h" -#include "gstypes.h" -#include "gsmemory.h" /* for gxiodev.h */ -#include "stream.h" -#include "gxiodev.h" - -/* The pipe IODevice */ -private iodev_proc_fopen(pipe_fopen); -private iodev_proc_fclose(pipe_fclose); -const gx_io_device gs_iodev_pipe = -{ - "%pipe%", "FileSystem", - {iodev_no_init, iodev_no_open_device, - NULL /*iodev_os_open_file */ , pipe_fopen, pipe_fclose, - iodev_no_delete_file, iodev_no_rename_file, iodev_no_file_status, - iodev_no_enumerate_files, NULL, NULL, - iodev_no_get_params, iodev_no_put_params - } -}; - -/* The file device procedures */ - -private int -pipe_fopen(gx_io_device * iodev, const char *fname, const char *access, - FILE ** pfile, char *rfname, uint rnamelen) -{ /* The OSF/1 1.3 library doesn't include const in the */ - /* prototype for popen.... */ - errno = 0; - *pfile = popen((char *)fname, (char *)access); - if (*pfile == NULL) - return_error(gs_fopen_errno_to_code(errno)); - if (rfname != NULL) - strcpy(rfname, fname); - return 0; -} - -private int -pipe_fclose(gx_io_device * iodev, FILE * file) -{ - pclose(file); - return 0; -} diff --git a/pstoraster/gdevpm.h b/pstoraster/gdevpm.h deleted file mode 100644 index 03ab5867e5..0000000000 --- a/pstoraster/gdevpm.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1992, 1993 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpm.h,v 1.3 2000/03/13 19:00:47 mike Exp $ */ -/* Defines common to gdevpm.c, gspmdrv.c and PM GSview */ - -#ifndef gdevpm_INCLUDED -# define gdevpm_INCLUDED - -#define SHARED_NAME "\\SHAREMEM\\%s" -#define SYNC_NAME "\\SEM32\\SYNC_%s" -#define NEXT_NAME "\\SEM32\\NEXT_%s" -#define MUTEX_NAME "\\SEM32\\MUTEX_%s" -#define QUEUE_NAME "\\QUEUES\\%s" - -#define GS_UPDATING 1 -#define GS_SYNC 2 -#define GS_PAGE 3 -#define GS_CLOSE 4 -#define GS_ERROR 5 -#define GS_PALCHANGE 6 -#define GS_BEGIN 7 -#define GS_END 8 - -#endif /* gdevpm_INCLUDED */ diff --git a/pstoraster/gdevprn.c b/pstoraster/gdevprn.c deleted file mode 100644 index 63718242a1..0000000000 --- a/pstoraster/gdevprn.c +++ /dev/null @@ -1,837 +0,0 @@ -/* - Copyright 1993-2001 by Easy Software Products. - Copyright 1990, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevprn.c,v 1.13 2001/03/27 15:45:20 mike Exp $ */ -/* Generic printer driver support */ -#include "ctype_.h" -#include "gdevprn.h" -#include "gp.h" -#include "gsparam.h" -#include "gxclio.h" -#include - -/* ---------------- Standard device procedures ---------------- */ - -/* Define the standard printer procedure vector. */ -const gx_device_procs prn_std_procs = - prn_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close); - -/* Forward references */ -int gdev_prn_maybe_reallocate_memory(P4(gx_device_printer *pdev, - gdev_prn_space_params *old_space, - int old_width, int old_height)); - -/* ------ Open/close ------ */ - -/* Open a generic printer device. */ -/* Specific devices may wish to extend this. */ -int -gdev_prn_open(gx_device * pdev) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - int code; - - ppdev->file = NULL; - code = gdev_prn_allocate_memory(pdev, NULL, 0, 0); - if (code < 0) - return code; - if (ppdev->OpenOutputFile) - code = gdev_prn_open_printer(pdev, 1); - return code; -} - -/* Generic closing for the printer device. */ -/* Specific devices may wish to extend this. */ -int -gdev_prn_close(gx_device * pdev) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - - gdev_prn_free_memory(pdev); - if (ppdev->file != NULL) { - if (ppdev->file != stdout) - gp_close_printer(ppdev->file, ppdev->fname); - ppdev->file = NULL; - } - return 0; -} - -private int /* returns 0 ok, else -ve error cde */ -gdev_prn_setup_as_command_list(gx_device *pdev, gs_memory_t *buffer_memory, - byte **the_memory, - const gdev_prn_space_params *space_params, - bool bufferSpace_is_exact) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - uint space; - int code; - gx_device_clist *const pclist_dev = (gx_device_clist *)pdev; - gx_device_clist_common * const pcldev = &pclist_dev->common; - bool reallocate = *the_memory != 0; - byte *base; - - /* Try to allocate based simply on param-requested buffer size */ - for ( space = space_params->BufferSpace; ; ) { - base = (reallocate ? - gs_resize_object(buffer_memory, *the_memory, space, - "cmd list buffer") : - gs_alloc_bytes(buffer_memory, space, - "cmd list buffer")); - if (base != 0) - break; - if (bufferSpace_is_exact || (space >>= 1) < PRN_MIN_BUFFER_SPACE) - break; - } - if (base == 0) - return_error(gs_error_VMerror); - *the_memory = base; - - /* Try opening the command list, to see if we allocated */ - /* enough buffer space. */ -open_c: - ppdev->buf = base; - ppdev->buffer_space = space; - clist_init_params(pclist_dev, base, space, pdev, - ppdev->printer_procs.make_buffer_device, - space_params->band, ppdev->is_async_renderer, - (ppdev->bandlist_memory == 0 ? &gs_memory_default : - ppdev->bandlist_memory), - ppdev->free_up_bandlist_memory, - ppdev->clist_disable_mask); - code = (*gs_clist_device_procs.open_device)( (gx_device *)pcldev ); - if (code < 0) { - /* If there wasn't enough room, and we haven't */ - /* already shrunk the buffer, try enlarging it. */ - if ( code == gs_error_limitcheck && - space >= space_params->BufferSpace && - !bufferSpace_is_exact - ) { - space <<= 1; - if (reallocate) { - base = gs_resize_object(buffer_memory, - *the_memory, space, - "cmd list buf(retry open)"); - if (base != 0) - *the_memory = base; - } else { - gs_free_object(buffer_memory, base, - "cmd list buf(retry open)"); - *the_memory = base = - gs_alloc_bytes(buffer_memory, space, - "cmd list buf(retry open)"); - } - ppdev->buf = *the_memory; - if (base != 0) - goto open_c; - } - /* Failure. */ - if (!reallocate) { - gs_free_object(buffer_memory, base, "cmd list buf"); - ppdev->buffer_space = 0; - *the_memory = 0; - } - } - return code; -} - -private bool /* ret true if device was cmd list, else false */ -gdev_prn_tear_down(gx_device *pdev, byte **the_memory) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - gx_device_memory * const pmemdev = (gx_device_memory *)pdev; - gx_device_clist *const pclist_dev = (gx_device_clist *)pdev; - gx_device_clist_common * const pcldev = &pclist_dev->common; - bool is_command_list; - - if (ppdev->buffer_space != 0) { - /* Close cmd list device & point to the storage */ - (*gs_clist_device_procs.close_device)( (gx_device *)pcldev ); - *the_memory = ppdev->buf; - ppdev->buf = 0; - ppdev->buffer_space = 0; - is_command_list = true; - } else { - /* point at the device bitmap, no need to close mem dev */ - *the_memory = pmemdev->base; - pmemdev->base = 0; - is_command_list = false; - } - - /* Reset device proc vector to default */ - if (ppdev->orig_procs.open_device != 0) - pdev->procs = ppdev->orig_procs; - ppdev->orig_procs.open_device = 0; /* prevent uninit'd restore of procs */ - - return is_command_list; -} - -private int -gdev_prn_allocate(gx_device *pdev, gdev_prn_space_params *new_space_params, - int new_width, int new_height, bool reallocate) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - gx_device_memory * const pmemdev = (gx_device_memory *)pdev; - byte *the_memory = 0; - gdev_prn_space_params save_params; - int save_width, save_height; - bool is_command_list = false; - bool save_is_command_list; - int ecode = 0; - int pass; - gs_memory_t *buffer_memory = - (ppdev->buffer_memory == 0 ? &gs_memory_default : - ppdev->buffer_memory); - - /* If reallocate, find allocated memory & tear down buffer device */ - if (reallocate) - save_is_command_list = gdev_prn_tear_down(pdev, &the_memory); - - /* Re/allocate memory */ - ppdev->orig_procs = pdev->procs; - for ( pass = 1; pass <= (reallocate ? 2 : 1); ++pass ) { - ulong mem_space; - byte *base = 0; - bool bufferSpace_is_default = false; - gdev_prn_space_params space_params; - - if (reallocate) - switch (pass) - { - case 1: - /* Setup device to get reallocated */ - save_params = ppdev->space_params; - ppdev->space_params = *new_space_params; - save_width = ppdev->width; - ppdev->width = new_width; - save_height = ppdev->height; - ppdev->height = new_height; - break; - case 2: /* only comes here if reallocate */ - /* Restore device to previous contents */ - ppdev->space_params = save_params; - ppdev->width = save_width; - ppdev->height = save_height; - break; - } - - /* Init clist/mem device-specific fields */ - memset(ppdev->skip, 0, sizeof(ppdev->skip)); - mem_space = gdev_mem_bitmap_size(pmemdev); - - /* Compute desired space params: never use the space_params as-is. */ - /* Rather, give the dev-specific driver a chance to adjust them. */ - space_params = ppdev->space_params; - space_params.BufferSpace = 0; - (*ppdev->printer_procs.get_space_params)(ppdev, &space_params); - if (ppdev->is_async_renderer && space_params.band.BandBufferSpace != 0) - space_params.BufferSpace = space_params.band.BandBufferSpace; - else if (space_params.BufferSpace == 0) { - if (space_params.band.BandBufferSpace > 0) - space_params.BufferSpace = space_params.band.BandBufferSpace; - else { - space_params.BufferSpace = ppdev->space_params.BufferSpace; - bufferSpace_is_default = true; - } - } - - /* Determine if we can use a full bitmap buffer, or have to use banding */ - if (pass > 1) - is_command_list = save_is_command_list; - else { - is_command_list = space_params.banding_type == BandingAlways || - mem_space >= space_params.MaxBitmap || - mem_space != (uint)mem_space; /* too big to allocate */ - } - if (!is_command_list) { - /* Try to allocate memory for full memory buffer */ - base = reallocate - ? gs_resize_object( buffer_memory, the_memory, - (uint)mem_space, "printer buffer" ) - : gs_alloc_bytes( buffer_memory, (uint)mem_space, - "printer_buffer" ); - if (base == 0) - is_command_list = true; - else - the_memory = base; - } - if (!is_command_list && pass == 1 && PRN_MIN_MEMORY_LEFT != 0 - && buffer_memory == &gs_memory_default) { - /* before using full memory buffer, ensure enough working mem left */ - byte * left = gs_alloc_bytes( buffer_memory, - PRN_MIN_MEMORY_LEFT, "printer mem left"); - if (left == 0) - is_command_list = true; - else - gs_free_object(buffer_memory, left, "printer mem left"); - } - - if (is_command_list) { - /* Buffer the image in a command list. */ - /* Release the buffer if we allocated it. */ - int code; - if (!reallocate) { - gs_free_object(buffer_memory, the_memory, - "printer buffer(open)"); - the_memory = 0; - } - if (space_params.banding_type == BandingNever) { - ecode = gs_note_error(gs_error_VMerror); - continue; - } - code = gdev_prn_setup_as_command_list(pdev, buffer_memory, - &the_memory, &space_params, - !bufferSpace_is_default); - if (ecode == 0) - ecode = code; - - if ( code >= 0 || (reallocate && pass > 1) ) - ppdev->procs = gs_clist_device_procs; - } else { - /* Render entirely in memory. */ - int code; - - ppdev->buffer_space = 0; - code = (*ppdev->printer_procs.make_buffer_device) - (pmemdev, pdev, buffer_memory, false); - if (code < 0) { /* Catastrophic. Shouldn't ever happen */ - gs_free_object(buffer_memory, base, "printer buffer"); - pdev->procs = ppdev->orig_procs; - ppdev->orig_procs.open_device = 0; /* prevent uninit'd restore of procs */ - return_error(code); - } - pmemdev->base = base; - } - if (ecode == 0) - break; - } - - if (ecode >= 0 || reallocate) { /* even if realloc failed */ - /* Synthesize the procedure vector. */ - /* Rendering operations come from the memory or clist device, */ - /* non-rendering come from the printer device. */ -#define COPY_PROC(p) set_dev_proc(ppdev, p, ppdev->orig_procs.p) - COPY_PROC(get_initial_matrix); - COPY_PROC(output_page); - COPY_PROC(close_device); - COPY_PROC(map_rgb_color); - COPY_PROC(map_color_rgb); - COPY_PROC(get_params); - COPY_PROC(put_params); - COPY_PROC(map_cmyk_color); - COPY_PROC(get_xfont_procs); - COPY_PROC(get_xfont_device); - COPY_PROC(map_rgb_alpha_color); - /* All printers are page devices, even if they didn't use the */ - /* standard macros for generating their procedure vectors. */ - set_dev_proc(ppdev, get_page_device, gx_page_device_get_page_device); - COPY_PROC(get_alpha_bits); - COPY_PROC(get_clipping_box); - COPY_PROC(map_color_rgb_alpha); - COPY_PROC(get_hardware_params); -#undef COPY_PROC - /* If using a command list, already opened the device. */ - if (is_command_list) - return ecode; - else - return (*dev_proc(pdev, open_device))(pdev); - } else { - pdev->procs = ppdev->orig_procs; - ppdev->orig_procs.open_device = 0; /* prevent uninit'd restore of procs */ - return ecode; - } -} - -int -gdev_prn_allocate_memory(gx_device *pdev, - gdev_prn_space_params *new_space_params, - int new_width, int new_height) -{ - return gdev_prn_allocate(pdev, new_space_params, - new_width, new_height, false); -} - -int -gdev_prn_reallocate_memory(gx_device *pdev, - gdev_prn_space_params *new_space_params, - int new_width, int new_height) -{ - return gdev_prn_allocate(pdev, new_space_params, - new_width, new_height, true); -} - -int -gdev_prn_free_memory(gx_device *pdev) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - byte *the_memory = 0; - gs_memory_t *buffer_memory = - (ppdev->buffer_memory == 0 ? &gs_memory_default : - ppdev->buffer_memory); - - gdev_prn_tear_down(pdev, &the_memory); - gs_free_object(buffer_memory, the_memory, "gdev_prn_free_memory"); - return 0; -} - -/* ------------- Stubs related only to async rendering ------- */ - -int /* rets 0 ok, -ve error if couldn't start thread */ -gx_default_start_render_thread(gdev_prn_start_render_params *params) -{ - return gs_error_unknownerror; -} - -/* Open the renderer's copy of a device. */ -/* This is overriden in gdevprna.c */ -int -gx_default_open_render_device(gx_device_printer *pdev) -{ - return gs_error_unknownerror; -} - -/* Close the renderer's copy of a device. */ -int -gx_default_close_render_device(gx_device_printer *pdev) -{ - return gdev_prn_close( (gx_device *)pdev ); -} - -/* ------ Get/put parameters ------ */ - -/* Get parameters. Printer devices add several more parameters */ -/* to the default set. */ -int -gdev_prn_get_params(gx_device * pdev, gs_param_list * plist) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - int code = gx_default_get_params(pdev, plist); - - if (code < 0 || - (ppdev->Duplex_set >= 0 && - (code = (ppdev->Duplex_set ? - param_write_bool(plist, "Duplex", &ppdev->Duplex) : - param_write_null(plist, "Duplex"))) < 0) - ) - return code; - - return 0; -} - -/* Put parameters. */ -int -gdev_prn_put_params(gx_device * pdev, gs_param_list * plist) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - int ecode = 0; - int code; - const char *param_name; - bool is_open = pdev->is_open; - bool oof = ppdev->OpenOutputFile; - bool rpp = ppdev->ReopenPerPage; - bool duplex; - int duplex_set = -1; - int width = pdev->width; - int height = pdev->height; - gdev_prn_space_params sp, save_sp; - gs_param_dict mdict; - - sp = ppdev->space_params; - save_sp = sp; - - switch (code = param_read_bool(plist, (param_name = "OpenOutputFile"), &oof)) { - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 0: - case 1: - break; - } - - switch (code = param_read_bool(plist, (param_name = "ReopenPerPage"), &rpp)) { - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 0: - case 1: - break; - } - - if (ppdev->Duplex_set >= 0) /* i.e., Duplex is supported */ - switch (code = param_read_bool(plist, (param_name = "Duplex"), - &duplex)) { - case 0: - duplex_set = 1; - break; - default: - if ((code = param_read_null(plist, param_name)) == 0) { - duplex_set = 0; - break; - } - ecode = code; - param_signal_error(plist, param_name, ecode); - case 1: - ; - } -#define CHECK_PARAM_CASES(member, bad, label)\ - case 0:\ - if ((sp.params_are_read_only ? sp.member != save_sp.member : bad))\ - ecode = gs_error_rangecheck;\ - else\ - break;\ - goto label;\ - default:\ - ecode = code;\ -label:\ - param_signal_error(plist, param_name, ecode);\ - case 1:\ - break - - /* Read InputAttributes and OutputAttributes just for the type */ - /* check and to indicate that they aren't undefined. */ -#define read_media(pname)\ - switch ( code = param_begin_read_dict(plist, (param_name = pname), &mdict, true) )\ - {\ - case 0:\ - param_end_read_dict(plist, pname, &mdict);\ - break;\ - default:\ - ecode = code;\ - param_signal_error(plist, param_name, ecode);\ - case 1:\ - ;\ - } - - read_media("InputAttributes"); - read_media("OutputAttributes"); - - if (ecode < 0) - return ecode; - /* Prevent gx_default_put_params from closing the printer. */ - pdev->is_open = false; - code = gx_default_put_params(pdev, plist); - pdev->is_open = is_open; - if (code < 0) - return code; - - ppdev->OpenOutputFile = oof; - ppdev->ReopenPerPage = rpp; - if (duplex_set >= 0) { - ppdev->Duplex = duplex; - ppdev->Duplex_set = duplex_set; - } - ppdev->space_params = sp; - - /* If necessary, free and reallocate the printer memory. */ - /* Formerly, would not reallocate if device is not open: */ - /* we had to patch this out (see News for 5.50). */ - code = gdev_prn_maybe_reallocate_memory(ppdev, &save_sp, width, height); - if (code < 0) - return code; - - return 0; -} - -/* ------ Others ------ */ - -#define TILE_SIZE 256 - -/* Default routine to override current space_params. */ -void -gdev_prn_default_get_space_params(const gx_device_printer *printer_dev, - gdev_prn_space_params *space_params) -{ - int cache_size; /* Size of tile cache in bytes */ - char *cache_env, /* Cache size environment variable */ - cache_units[255]; /* Cache size units */ - - - if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL) - { - switch (sscanf(cache_env, "%d%254s", &cache_size, cache_units)) - { - case 0 : - cache_size = 8 * 1024 * 1024; - break; - case 1 : - cache_size *= 4 * TILE_SIZE * TILE_SIZE; - break; - case 2 : - if (tolower(cache_units[0]) == 'g') - cache_size *= 1024 * 1024 * 1024; - else if (tolower(cache_units[0]) == 'm') - cache_size *= 1024 * 1024; - else if (tolower(cache_units[0]) == 'k') - cache_size *= 1024; - else if (tolower(cache_units[0]) == 't') - cache_size *= 4 * TILE_SIZE * TILE_SIZE; - break; - } - } - else - cache_size = 8 * 1024 * 1024; - - space_params->MaxBitmap = cache_size; - space_params->BufferSpace = cache_size / 10; -} - -/* Generic routine to send the page to the printer. */ -int /* 0 ok, -ve error, or 1 if successfully upgraded to buffer_page */ -gdev_prn_output_page(gx_device * pdev, int num_copies, int flush) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - int outcode = 0, closecode = 0, errcode = 0, endcode; - bool upgraded_copypage = false; - - if (num_copies > 0 || !flush) { - int code = gdev_prn_open_printer(pdev, 1); - - if (code < 0) - return code; - - /* If copypage request, try to do it using buffer_page */ - if ( !flush && - (*ppdev->printer_procs.buffer_page) - (ppdev, ppdev->file, num_copies) >= 0 - ) { - upgraded_copypage = true; - flush = true; - } - else if (num_copies > 0) - /* Print the accumulated page description. */ - outcode = - (*ppdev->printer_procs.print_page_copies)(ppdev, ppdev->file, - num_copies); - if (ppdev->file) - { - fflush(ppdev->file); - errcode = - (ferror(ppdev->file) ? gs_note_error(gs_error_ioerror) : 0); - } - else - errcode = 0; - - if (!upgraded_copypage) - closecode = gdev_prn_close_printer(pdev); - } - endcode = (ppdev->buffer_space ? clist_finish_page(pdev, flush) : 0); - - if (outcode < 0) - return outcode; - if (errcode < 0) - return errcode; - if (closecode < 0) - return closecode; - if (endcode < 0) - return endcode; - return (upgraded_copypage ? 1 : 0); -} - -/* Print multiple copies of a page by calling print_page multiple times. */ -int -gx_default_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, - int num_copies) -{ - int i = num_copies; - int code = 0; - - while (code >= 0 && i-- > 0) - code = (*pdev->printer_procs.print_page) (pdev, prn_stream); - return code; -} - -/* - * Buffer a (partial) rasterized page & optionally print result multiple times. - * The default implementation returns error, since the driver needs to override - * this (in procedure vector) in configurations where this call may occur. - */ -int -gx_default_buffer_page(gx_device_printer *pdev, FILE *prn_stream, - int num_copies) -{ - return gs_error_unknownerror; -} - -/* ---------------- Driver services ---------------- */ - -/* Return the number of scan lines that should actually be passed */ -/* to the device. */ -int -gdev_prn_print_scan_lines(gx_device * pdev) -{ - int height = pdev->height; - gs_matrix imat; - float yscale; - int top, bottom, offset, end; - - (*dev_proc(pdev, get_initial_matrix)) (pdev, &imat); - yscale = imat.yy * 72.0; /* Y dpi, may be negative */ - top = (int)(dev_t_margin(pdev) * yscale); - bottom = (int)(dev_b_margin(pdev) * yscale); - offset = (int)(dev_y_offset(pdev) * yscale); - if (yscale < 0) { /* Y=0 is top of page */ - end = -offset + height + bottom; - } else { /* Y=0 is bottom of page */ - end = offset + height - top; - } - return min(height, end); -} - -/* Open the current page for printing. */ -int -gdev_prn_open_printer_positionable(gx_device *pdev, bool binary_mode, - bool positionable) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - - if (ppdev->file != 0) { - ppdev->file_is_new = false; - return 0; - } - { - int code = gx_device_open_output_file(pdev, ppdev->fname, - binary_mode, positionable, - &ppdev->file); - if (code < 0) - return code; - } - ppdev->file_is_new = true; - return 0; -} -int -gdev_prn_open_printer(gx_device *pdev, bool binary_mode) -{ - return gdev_prn_open_printer_positionable(pdev, binary_mode, false); -} - -/* Copy a scan line from the buffer to the printer. */ -int -gdev_prn_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data) -{ - int code = (*dev_proc(pdev, get_bits)) ((gx_device *) pdev, y, str, actual_data); - uint line_size = gdev_prn_raster(pdev); - int last_bits = -(pdev->width * pdev->color_info.depth) & 7; - - if (code < 0) - return code; - if (last_bits != 0) { - byte *dest = (actual_data != 0 ? *actual_data : str); - - dest[line_size - 1] &= 0xff << last_bits; - } - return 0; -} -/* Copy scan lines to a buffer. Return the number of scan lines, */ -/* or <0 if error. */ -int -gdev_prn_copy_scan_lines(gx_device_printer * pdev, int y, byte * str, uint size) -{ - uint line_size = gdev_prn_raster(pdev); - int count = size / line_size; - int i; - byte *dest = str; - - count = min(count, pdev->height - y); - for (i = 0; i < count; i++, dest += line_size) { - int code = gdev_prn_get_bits(pdev, y + i, dest, NULL); - - if (code < 0) - return code; - } - return count; -} - -/* Like get_bits, but accepts initial raster contents */ -int -gdev_prn_get_overlay_bits(gx_device_printer *pdev, int y, int lineCount, - byte *data) -{ - if (pdev->buffer_space) { - /* Command lists have built-in support for this function */ - return clist_get_overlay_bits(pdev, y, lineCount, data); - } else { - /* Memory devices cannot support this function. */ - return_error(gs_error_unknownerror); - } -} - -/* Find out where the band buffer for a given line is going to fall on the */ -/* next call to get_bits. */ -int /* rets # lines from y till end of buffer, or -ve error code */ -gdev_prn_locate_overlay_buffer(gx_device_printer *pdev, int y, byte **data) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - - if (ppdev->buffer_space) { - /* Command lists have built-in support for this function */ - return clist_locate_overlay_buffer(pdev, y, data); - } else { - /* Memory devices cannot support this function. */ - return_error(gs_error_unknownerror); - } -} - -/* Close the current page. */ -int -gdev_prn_close_printer(gx_device * pdev) -{ - gx_device_printer * const ppdev = (gx_device_printer *)pdev; - - if (strchr(ppdev->fname, '%') /* file per page */ || - ppdev->ReopenPerPage /* close and reopen for each page */ - ) { - gp_close_printer(ppdev->file, ppdev->fname); - ppdev->file = NULL; - } - return 0; -} - -/* If necessary, free and reallocate the printer memory after changing params */ -int -gdev_prn_maybe_reallocate_memory(gx_device_printer *prdev, - gdev_prn_space_params *old_sp, - int old_width, int old_height) -{ - int code = 0; - gx_device *const pdev = (gx_device *)prdev; - - if (prdev->is_open && - (memcmp(&prdev->space_params, old_sp, sizeof(*old_sp)) != 0 || - prdev->width != old_width || prdev->height != old_height ) - ) { - int new_width = prdev->width; - int new_height = prdev->height; - gdev_prn_space_params new_sp = prdev->space_params; - - prdev->width = old_width; - prdev->height = old_height; - prdev->space_params = *old_sp; - code = gdev_prn_reallocate_memory(pdev, &new_sp, - new_width, new_height); - /* If this fails, device should be usable w/old params, but */ - /* band files may not be open. */ - } - return code; -} diff --git a/pstoraster/gdevprn.h b/pstoraster/gdevprn.h deleted file mode 100644 index 18b7e5ed20..0000000000 --- a/pstoraster/gdevprn.h +++ /dev/null @@ -1,560 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevprn.h,v 1.5 2001/03/16 20:42:06 mike Exp $ */ -/* Common header file for memory-buffered printers */ - -#ifndef gdevprn_INCLUDED -# define gdevprn_INCLUDED - -#include "memory_.h" -#include "string_.h" -#include "gx.h" -#include "gp.h" /* for gp_file_name_sizeof */ -#include "gserrors.h" -#include "gsmatrix.h" /* for gxdevice.h */ -#include "gsutil.h" /* for memflip8x8 */ -#include "gxdevice.h" -#include "gxdevmem.h" -#include "gxcldev.h" -#include "gsparam.h" - -/* - * Define the parameters for the printer rendering method. - * If the entire bitmap fits in PRN_MAX_BITMAP, and there is at least - * PRN_MIN_MEMORY_LEFT memory left after allocating it, render in RAM, - * otherwise use a command list with a size of PRN_BUFFER_SPACE. - * (These are parameters that can be changed by a client program.) - */ -/* Define parameters for machines with little dinky RAMs.... */ -#define PRN_MAX_BITMAP_SMALL 32000 -#define PRN_BUFFER_SPACE_SMALL 25000 -#define PRN_MIN_MEMORY_LEFT_SMALL 32000 -/* Define parameters for machines with great big hulking RAMs.... */ -#define PRN_MAX_BITMAP_LARGE 10000000L -#define PRN_BUFFER_SPACE_LARGE 1000000L -#define PRN_MIN_MEMORY_LEFT_LARGE 500000L -/* Define parameters valid on all machines. */ -#define PRN_MIN_BUFFER_SPACE 10000 /* give up if less than this */ -/* Now define conditional parameters. */ -#if arch_small_memory -# define PRN_MAX_BITMAP PRN_MAX_BITMAP_SMALL -# define PRN_BUFFER_SPACE PRN_BUFFER_SPACE_SMALL -# define PRN_MIN_MEMORY_LEFT PRN_MIN_MEMORY_LEFT_SMALL -#else -/****** These should really be conditional on gs_debug_c('.') if - ****** DEBUG is defined, but they're used in static initializers, - ****** so we can't do it. - ******/ -# if 0 /****** # ifdef DEBUG ***** */ -# define PRN_MAX_BITMAP\ - (gs_debug_c('.') ? PRN_MAX_BITMAP_SMALL : PRN_MAX_BITMAP_LARGE) -# define PRN_BUFFER_SPACE\ - (gs_debug_c('.') ? PRN_BUFFER_SPACE_SMALL : PRN_BUFFER_SPACE_LARGE) -# define PRN_MIN_MEMORY_LEFT\ - (gs_debug_c('.') ? PRN_MIN_MEMORY_LEFT_SMALL : PRN_MIN_MEMORY_LEFT_LARGE) -# else -# define PRN_MAX_BITMAP PRN_MAX_BITMAP_LARGE -# define PRN_BUFFER_SPACE PRN_BUFFER_SPACE_LARGE -# define PRN_MIN_MEMORY_LEFT PRN_MIN_MEMORY_LEFT_LARGE -# endif -#endif - -/* Define the abstract type for a printer device. */ -#ifndef gx_device_printer_DEFINED -# define gx_device_printer_DEFINED -typedef struct gx_device_printer_s gx_device_printer; -#endif - -/* Define the abstract type for some band device procedures' arguments. */ -typedef struct gdev_prn_start_render_params_s gdev_prn_start_render_params; - -/* Define the abstract type for a page queue for async rendering. */ -#ifndef gx_page_queue_DEFINED -# define gx_page_queue_DEFINED -typedef struct gx_page_queue_s gx_page_queue; -#endif - -/* Define the abstract type for parameters describing buffer space. */ -#ifndef gdev_prn_space_params_DEFINED -# define gdev_prn_space_params_DEFINED -typedef struct gdev_prn_space_params_s gdev_prn_space_params; -#endif - -/* - * Define the special procedures for band devices. - */ -typedef struct gx_printer_device_procs_s { - - /* - * Print the page on the output file. Required only for devices - * where output_page is gdev_prn_output_page; ignored for other - * devices. - */ - -#define prn_dev_proc_print_page(proc)\ - int proc(P2(gx_device_printer *, FILE *)) - prn_dev_proc_print_page((*print_page)); -/* BACKWARD COMPATIBILITY */ -#define dev_proc_print_page(proc) prn_dev_proc_print_page(proc) - - /* Print the page on the output file, with a given # of copies. */ - -#define prn_dev_proc_print_page_copies(proc)\ - int proc(P3(gx_device_printer *, FILE *, int)) - prn_dev_proc_print_page_copies((*print_page_copies)); -/* BACKWARD COMPATIBILITY */ -#define dev_proc_print_page_copies(proc) prn_dev_proc_print_page_copies(proc) - - /* Initialize the memory device for a page or a band. */ - /* (The macro definition is in gxdevcli.h.) */ - - dev_proc_make_buffer_device((*make_buffer_device)); - - /* - * Compute effective space params. These results effectively override - * the space_params in the device, but does not replace them; that is to - * say that computed space params are temps used for computation. - * Procedure must fill in only those space_params that it wishes to - * override, using curr width, height, margins, etc. - * - * Caller is gdevprn.open & gdevprn.put_params, calls driver or - * default. - */ - -#define prn_dev_proc_get_space_params(proc)\ - void proc(P2(const gx_device_printer *, gdev_prn_space_params *)) - prn_dev_proc_get_space_params((*get_space_params)); - - /* - * Only for gx_device_printer devices that overlap interpreting and - * rasterizing. Since there are 2 instances of the device (1 for writing - * the cmd list & 1 for rasterizing it), and each device is associated - * with an different thread, this function is called to start the - * rasterizer's thread. Once started, the rasterizer thread must call - * down to gdev_prn_asnyc_render_thread, which will only return after - * device closes. - * - * Caller is gdevprna.open, calls driver implementation or default. - */ - -#define prn_dev_proc_start_render_thread(proc)\ - int proc(P1(gdev_prn_start_render_params *)) - prn_dev_proc_start_render_thread((*start_render_thread)); - - /* - * Only for gx_device_printer devices that overlap interpreting and - * rasterizing. Since there are 2 instances of the device (1 for writing - * the cmd list & 1 for rasterizing it), these fns are called to - * open/close the rasterizer's instance, once the writer's instance has - * been created & init'd. These procs must cascade down to - * gdev_prn_async_render_open/close. - * - * Caller is gdevprna, calls driver implementation or default. - */ - -#define prn_dev_proc_open_render_device(proc)\ - int proc(P1(gx_device_printer *)) - prn_dev_proc_open_render_device((*open_render_device)); - -#define prn_dev_proc_close_render_device(proc)\ - int proc(P1(gx_device_printer *)) - prn_dev_proc_close_render_device((*close_render_device)); - - /* - * Buffer a page on the output device. A page may or may not have been - * fully rendered, but the rasterizer needs to realize the page to free - * up resources or support copypage. Printing a page may involve zero or - * more buffer_pages. All buffer_page output is overlaid in the buffer - * until a terminating print_page or print_page_copies clears the - * buffer. Note that, after the first buffer_page, the driver must use - * the get_overlay_bits function instead of get_bits. The difference is - * that get_overlay_bits requires the caller to supply the same buffered - * bitmap that was computed as a result of a previous buffer_page, so - * that get_overlay_bits can add further marks to the existing buffered - * image. NB that output must be accumulated in buffer even if - * num_copies == 0. - * - * Caller is expected to be gdevprn, calls driver implementation or - * default. - */ - -#define prn_dev_proc_buffer_page(proc)\ - int proc(P3(gx_device_printer *, FILE *, int)) - prn_dev_proc_buffer_page((*buffer_page)); - - /* - * Transform a given set of bits by marking it per the current page - * description. This is a different version of get_bits, where this - * procedure accepts a bitmap and merely adds further marks, without - * clearing the bits. - * - * Driver implementation is expected to be the caller. - */ - -#define prn_dev_proc_get_overlay_bits(proc)\ - int proc(P4(gx_device_printer *, int, int, byte *)) - prn_dev_proc_get_overlay_bits((*get_overlay_bits)); - - /* - * Find out where the band buffer for a given line is going to fall on - * the next call to get_bits. This is an alternative to get_overlay_bits - * in cases where the client doesn't own a suitably formatted buffer to - * deposit bits into. When using this function, do a - * locate_overlay_buffer, copy the background data into the returned - * buffer, then do get_bits to get the transformed data. IMPORTANT: the - * locate_overlay_buffer for a specific range of lines must immediately - * be followed by one or more get_bits for the same line range with no - * other intervening driver calls. If this condition is violated, - * results are undefined. - */ - -#define prn_dev_proc_locate_overlay_buffer(proc)\ - int proc(P3(gx_device_printer *, int, byte **)) - prn_dev_proc_locate_overlay_buffer((*locate_overlay_buffer)); - -} gx_printer_device_procs; - -/* ------ Printer device definition ------ */ - -/* Structure for generic printer devices. */ -/* This must be preceded by gx_device_common. */ -/* Printer devices are actually a union of a memory device */ -/* and a clist device, plus some additional state. */ -#define prn_fname_sizeof gp_file_name_sizeof -typedef enum { - BandingAuto = 0, - BandingAlways, - BandingNever -} gdev_prn_banding_type; -struct gdev_prn_space_params_s { - long MaxBitmap; /* max size of non-buffered bitmap */ - long BufferSpace; /* space to use for buffer */ - gx_band_params band; /* see gxclist.h */ - bool params_are_read_only; /* true if put_params may not modify this struct */ - gdev_prn_banding_type banding_type; /* used to force banding or bitmap */ -}; - -#define gx_prn_device_common\ - byte skip[max(sizeof(gx_device_memory), sizeof(gx_device_clist)) -\ - sizeof(gx_device) + sizeof(double) /* padding */];\ - gx_printer_device_procs printer_procs;\ - /* ------ Device parameters that must be set ------ */\ - /* ------ before calling the device open routine. ------ */\ - gdev_prn_space_params space_params;\ - char fname[prn_fname_sizeof]; /* OutputFile */\ - /* ------ Other device parameters ------ */\ - bool OpenOutputFile;\ - bool ReopenPerPage;\ - bool Duplex;\ - int Duplex_set; /* -1 = not supported */\ - /* ------ End of parameters ------ */\ - bool file_is_new; /* true iff file just opened */\ - FILE *file; /* output file */\ - long buffer_space; /* amount of space for clist buffer, */\ - /* 0 means not using clist */\ - byte *buf; /* buffer for rendering */\ - /* ---- Begin async rendering support --- */\ - gs_memory_t *buffer_memory; /* allocator for command list */\ - gs_memory_t *bandlist_memory; /* allocator for bandlist files */\ - proc_free_up_bandlist_memory((*free_up_bandlist_memory)); /* if nz, proc to free some bandlist memory */\ - gx_page_queue *page_queue; /* if <> 0,page queue for gdevprna NOT GC'd */\ - bool is_async_renderer; /* device is only the rendering part of async device */\ - gx_device_printer *async_renderer; /* in async writer, pointer to async renderer */\ - uint clist_disable_mask; /* mask of clist options to disable */\ - /* ---- End async rendering support --- */\ - gx_device_procs orig_procs /* original (std_)procs */ - -/* The device descriptor */ -struct gx_device_printer_s { - gx_device_common; - gx_prn_device_common; -}; - -/* Define a typedef for the sake of ansi2knr. */ -typedef dev_proc_print_page((*dev_proc_print_page_t)); - -/* Standard device procedures for printers */ -dev_proc_open_device(gdev_prn_open); -dev_proc_output_page(gdev_prn_output_page); -dev_proc_close_device(gdev_prn_close); -#define gdev_prn_map_rgb_color gx_default_b_w_map_rgb_color -#define gdev_prn_map_color_rgb gx_default_b_w_map_color_rgb -dev_proc_get_params(gdev_prn_get_params); -dev_proc_put_params(gdev_prn_put_params); - -/* Default printer-specific procedures */ -prn_dev_proc_get_space_params(gdev_prn_default_get_space_params); -prn_dev_proc_start_render_thread(gx_default_start_render_thread); /* for async rendering only, see gdevprna.c */ -prn_dev_proc_open_render_device(gx_default_open_render_device); -prn_dev_proc_close_render_device(gx_default_close_render_device); -prn_dev_proc_buffer_page(gx_default_buffer_page); /* returns an error */ -prn_dev_proc_get_overlay_bits(gdev_prn_get_overlay_bits); -prn_dev_proc_locate_overlay_buffer(gdev_prn_locate_overlay_buffer); - -/* Macro for generating procedure table */ -#define prn_procs(p_open, p_output_page, p_close)\ - prn_color_procs(p_open, p_output_page, p_close, gdev_prn_map_rgb_color, gdev_prn_map_color_rgb) -#define prn_params_procs(p_open, p_output_page, p_close, p_get_params, p_put_params)\ - prn_color_params_procs(p_open, p_output_page, p_close, gdev_prn_map_rgb_color, gdev_prn_map_color_rgb, p_get_params, p_put_params) -#define prn_color_procs(p_open, p_output_page, p_close, p_map_rgb_color, p_map_color_rgb)\ - prn_color_params_procs(p_open, p_output_page, p_close, p_map_rgb_color, p_map_color_rgb, gdev_prn_get_params, gdev_prn_put_params) -/* See gdev_prn_open for explanation of the NULLs below. */ -#define prn_color_params_procs(p_open, p_output_page, p_close, p_map_rgb_color, p_map_color_rgb, p_get_params, p_put_params) {\ - p_open,\ - NULL, /* get_initial_matrix */\ - NULL, /* sync_output */\ - p_output_page,\ - p_close,\ - p_map_rgb_color,\ - p_map_color_rgb,\ - NULL, /* fill_rectangle */\ - NULL, /* tile_rectangle */\ - NULL, /* copy_mono */\ - NULL, /* copy_color */\ - NULL, /* draw_line */\ - NULL, /* get_bits */\ - p_get_params,\ - p_put_params,\ - NULL, /* map_cmyk_color */\ - NULL, /* get_xfont_procs */\ - NULL, /* get_xfont_device */\ - NULL, /* map_rgb_alpha_color */\ - gx_page_device_get_page_device,\ - NULL, /* get_alpha_bits */\ - NULL, /* copy_alpha */\ - NULL, /* get_band */\ - NULL, /* copy_rop */\ - NULL, /* fill_path */\ - NULL, /* stroke_path */\ - NULL, /* fill_mask */\ - NULL, /* fill_trapezoid */\ - NULL, /* fill_parallelogram */\ - NULL, /* fill_triangle */\ - NULL, /* draw_thin_line */\ - NULL, /* begin_image */\ - NULL, /* image_data */\ - NULL, /* end_image */\ - NULL, /* strip_tile_rectangle */\ - NULL, /* strip_copy_rop, */\ - NULL, /* get_clipping_box */\ - NULL, /* begin_typed_image */\ - NULL, /* map_color_rgb_alpha */\ - NULL, /* create_compositor */\ - NULL, /* get_hardware_params */\ - NULL /* text_begin */\ -} - -/* The standard printer device procedures */ -/* (using gdev_prn_open/output_page/close). */ -extern const gx_device_procs prn_std_procs; - -/* - * Define macros for generating the device structure, - * analogous to the std_device_body macros in gxdevice.h - * Note that the macros are broken up so as to be usable for devices that - * add further initialized state to the printer device. - * - * The 'margin' values provided here specify the unimageable region - * around the edges of the page (in inches), and the left and top margins - * also specify the displacement of the device (0,0) point from the - * upper left corner. We should provide macros that allow specifying - * all 6 values independently, but we don't yet. - */ -#define prn_device_body_rest_(print_page)\ - { 0 }, /* std_procs */\ - { 0 }, /* skip */\ - { print_page,\ - gx_default_print_page_copies,\ - gx_default_make_buffer_device,\ - gdev_prn_default_get_space_params,\ - gx_default_start_render_thread,\ - gx_default_open_render_device,\ - gx_default_close_render_device,\ - gx_default_buffer_page,\ - gdev_prn_get_overlay_bits,\ - gdev_prn_locate_overlay_buffer\ - },\ - { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\ - { band_params_initial_values },\ - 0/*false*/, /* params_are_read_only */\ - BandingAuto /* banding_type */\ - },\ - { 0 }, /* fname */\ - 0/*false*/, /* OpenOutputFile */\ - 0/*false*/, /* ReopenPerPage */\ - 0/*false*/, -1, /* Duplex[_set] */\ - 0/*false*/, 0, 0, 0, /* file_is_new ... buf */\ - 0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\ - { 0 } /* ... orig_procs */ - -/* The Sun cc compiler won't allow \ within a macro argument list. */ -/* This accounts for the short parameter names here and below. */ -#define prn_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\ - std_device_full_body(dtype, &procs, dname,\ - (int)((long)(w10) * (xdpi) / 10),\ - (int)((long)(h10) * (ydpi) / 10),\ - xdpi, ydpi,\ - ncomp, depth, mg, mc, dg, dc,\ - -(lo) * (xdpi), -(to) * (ydpi),\ - (lm) * 72.0, (bm) * 72.0,\ - (rm) * 72.0, (tm) * 72.0\ - ),\ - prn_device_body_rest_(print_page) - -#define prn_device_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page)\ - prn_device_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi,\ - lm, tm, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page) - -#define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\ - std_device_full_body(dtype, &procs, dname,\ - (int)((long)w10 * xdpi / 10),\ - (int)((long)h10 * ydpi / 10),\ - xdpi, ydpi,\ - ncomp, depth, mg, mc, dg, dc,\ - -(lm) * (xdpi), -(tm) * (ydpi),\ - (lm) * 72.0, (bm) * 72.0,\ - (rm) * 72.0, (tm) * 72.0\ - ),\ - { 0 }, /* std_procs */\ - { 0 }, /* skip */\ - { NULL,\ - print_pages,\ - gx_default_make_buffer_device,\ - gdev_prn_default_get_space_params,\ - gx_default_start_render_thread,\ - gx_default_open_render_device,\ - gx_default_close_render_device,\ - gx_default_buffer_page,\ - gdev_prn_get_overlay_bits,\ - gdev_prn_locate_overlay_buffer\ - },\ - { PRN_MAX_BITMAP, PRN_BUFFER_SPACE,\ - { band_params_initial_values },\ - 0/*false*/, /* params_are_read_only */\ - BandingAuto /* banding_type */\ - },\ - { 0 }, /* fname */\ - 0/*false*/, /* OpenOutputFile */\ - 0/*false*/, /* ReopenPerPage */\ - 0/*false*/, -1, /* Duplex[_set] */\ - 0/*false*/, 0, 0, 0, /* file_is_new ... buf */\ - 0, 0, 0, 0, 0/*false*/, 0, 0, /* buffer_memory ... clist_dis'_mask */\ - { 0 } /* ... orig_procs */ -#define prn_device_std_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, color_bits, print_page)\ - std_device_std_color_full_body(dtype, &procs, dname,\ - (int)((long)(w10) * (xdpi) / 10),\ - (int)((long)(h10) * (ydpi) / 10),\ - xdpi, ydpi, color_bits,\ - -(lo) * (xdpi), -(to) * (ydpi),\ - (lm) * 72.0, (bm) * 72.0,\ - (rm) * 72.0, (tm) * 72.0\ - ),\ - prn_device_body_rest_(print_page) - -#define prn_device_std_body(dtype, procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, color_bits, print_page)\ - prn_device_std_margins_body(dtype, procs, dname, w10, h10, xdpi, ydpi,\ - lm, tm, lm, bm, rm, tm, color_bits, print_page) - -#define prn_device_margins(procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, color_bits, print_page)\ -{ prn_device_std_margins_body(gx_device_printer, procs, dname,\ - w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, color_bits, print_page)\ -} - -#define prn_device(procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, color_bits, print_page)\ - prn_device_margins(procs, dname, w10, h10, xdpi, ydpi,\ - lm, tm, lm, bm, rm, tm, color_bits, print_page)\ - -/* ------ Utilities ------ */ -/* These are defined in gdevprn.c. */ - -int gdev_prn_open_printer_positionable(P3(gx_device *dev, bool binary_mode, - bool positionable)); -/* open_printer defaults positionable = false */ -int gdev_prn_open_printer(P2(gx_device * dev, bool binary_mode)); -#define gdev_prn_file_is_new(pdev) ((pdev)->file_is_new) -#define gdev_prn_raster(pdev) gx_device_raster((gx_device *)(pdev), 0) -int gdev_prn_get_bits(P4(gx_device_printer *, int, byte *, byte **)); -int gdev_prn_copy_scan_lines(P4(gx_device_printer *, int, byte *, uint)); -int gdev_prn_close_printer(P1(gx_device *)); - -/* The default print_page_copies procedure just calls print_page */ -/* the given number of times. */ -prn_dev_proc_print_page_copies(gx_default_print_page_copies); - -/* Define the number of scan lines that should actually be passed */ -/* to the device. */ -int gdev_prn_print_scan_lines(P1(gx_device *)); - -/* Allocate / reallocate / free printer memory. */ -int gdev_prn_allocate_memory(P4(gx_device *pdev, - gdev_prn_space_params *space, - int new_width, int new_height)); -int gdev_prn_reallocate_memory(P4(gx_device *pdev, - gdev_prn_space_params *space, - int new_width, int new_height)); -int gdev_prn_free_memory(P1(gx_device *pdev)); - -/* BACKWARD COMPATIBILITY */ -#define dev_print_scan_lines(dev)\ - gdev_prn_print_scan_lines((gx_device *)(dev)) -#define gdev_mem_bytes_per_scan_line(dev)\ - gdev_prn_raster((gx_device_printer *)(dev)) -#define gdev_prn_transpose_8x8(inp,ils,outp,ols)\ - memflip8x8(inp,ils,outp,ols) - -/* ------ Printer device types ------ */ -/**************** THE FOLLOWING CODE IS NOT USED YET. ****************/ - -#if 0 /**************** VMS linker gets upset *************** */ -extern_st(st_prn_device); -#endif -int gdev_prn_initialize(P3(gx_device *, const char *, dev_proc_print_page((*)))); -void gdev_prn_init_color(P4(gx_device *, int, dev_proc_map_rgb_color((*)), dev_proc_map_color_rgb((*)))); - -#define prn_device_type(dtname, initproc, pageproc)\ -private dev_proc_print_page(pageproc);\ -device_type(dtname, st_prn_device, initproc) - -/****** FOLLOWING SHOULD CHECK __PROTOTYPES__ ******/ -#define prn_device_type_mono(dtname, dname, initproc, pageproc)\ -private dev_proc_print_page(pageproc);\ -private int \ -initproc(gx_device *dev)\ -{ return gdev_prn_initialize(dev, dname, pageproc);\ -}\ -device_type(dtname, st_prn_device, initproc) - -/****** DITTO ******/ -#define prn_device_type_color(dtname, dname, depth, initproc, pageproc, rcproc, crproc)\ -private dev_proc_print_page(pageproc);\ -private int \ -initproc(gx_device *dev)\ -{ int code = gdev_prn_initialize(dev, dname, pageproc);\ - gdev_prn_init_color(dev, depth, rcproc, crproc);\ - return code;\ -}\ -device_type(dtname, st_prn_device, initproc) - -#endif /* gdevprn_INCLUDED */ diff --git a/pstoraster/gdevprna.h b/pstoraster/gdevprna.h deleted file mode 100644 index d9ef4726e8..0000000000 --- a/pstoraster/gdevprna.h +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevprna.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Generic asynchronous printer driver support */ - -/* Initial version 2/1/1998 by John Desrosiers (soho@crl.com) */ -/* 7/28/98 ghost@aladdin.com - Updated to Ghostscript coding standards. */ - -#ifndef gdevprna_INCLUDED -# define gdevprna_INCLUDED - -# include "gdevprn.h" -# include "gxsync.h" - -/* - * General - * ------- - * Async drivers actually create two separate instances of the device at - * the same time. The first (the writer instance) is only used in the - * interpretation operation; it feeds rendering commands into the command - * lists. The second device instance is used only for rendering the - * commands placed into the command list by the writer. - - * The writer builds a command list for an entire page; the command list - * is only queued for rendering once a page's command list is completely - * built. The only exception to this rule is when the interpreter runs - * out of memory, or when no free command list memory is available. In - * such cases, the interpreter queues a "partial page" consisting of all - * command list data written so far, plus a command indicating that the - * page description is not complete. After queuing the partial page, the - * interpereter waits until the rendering process has freed enough - * command list memory to enable the interpreter to proceed. - - * To avoid deadlocks when the system runs out of memory, special - * memory allocation provisions are made on both the writer and - * renderer sides. On the writer side, enough "reserve" bandlist - * memory is set aside at startup time to cover the needs of queuing a - * partial page to the renderer. The renderer operates out of a fixed - * memory space; that way, it can always complete rendering pages with - * the memory it has. To this end, the writer protects the renderer - * from consuming unbounded amounts of memory by a) never putting - * complex paths into the command list, b) pre-clipping any output - * unless the clip path consists of a single rectangle, c) never putting - * high-level images into the clip path unless the image in question - * meets some very stringent requirements, such as only being rotated by - * even multiples of 90 degrees and having source-image data rows which - * fit into the command buffer in one piece. These restrictions are what - * dictate the "restricted bandlist format." - - * Note that the renderer's instance of the device driver uses the - * renderer's memory. That implies that it must also operate in a small, - * fixed amount of memory, and must do all memory allocation using the - * memory allocator pointed to by the render device's ->memory member. - - * Opening the Device - * ------------------ - * The writer instance is opened first. This occurs when the system - * calls the "standard" open procedure via the device's procedure - * vector. The driver must implement the open function, but must call - * down to gdev_prn_async_write_open instead of calling down to - * gdev_prn_open. Before calling down to gdev_prn_async_write_open, the - * driver must: - * a - init several procedure vectors, to wit: start_render_thread, - * buffer_page, print_page_copies, - * b - init space_params.band.BandWidth, space_params.band.BandHeight, - * space_params.BufferSpace (see extended comments in gdevasyn.c - * for details on computing appropriate values). - * c - if it implements those functions, the driver must init the - * procedure vectors for: put_params, get_hardware_params, - * output_page, open_render_device. - * Notice that there are two procedure vectors: the usual std_procs, and - * the printer-specific printer_procs. - - * Since partial page support imposes extra requirements on drivers, - * such support can be disabled by zeroing out (in the async writer open - * routine, after calling down to gdev_prn_async_write_open) the - * free_up_bandlist_memory member of the driver structure. Doing so - * will, of course, cause interpretation to fail if memory runs out. - - * Once the driver calls down to gdev_prn_async_write_open, the async - * support logic will create a second instance of the driver for - * rendering, but will not open it just yet. Instead, the async logic - * will attempt to synchronize the two device instances. - - * Synchrnonizing the instances - * ---------------------------- - * While still in the gdev_prn_async_write_open routine, the async logic - * will call printer_procs.start_render_thread (which the driver is - * required to implement). start_render_thread must somehow either start a new - * thread or rendez-vous with an existing thread for use in rendering, - * then return. start_render_thread must also have caused the render thread - * to call gdev_prn_async_render_thread, passing it as an argument a magic - * cookie passed to start_render_thread. start_render_thread will only - * return once the device has been closed and all renering has been - * completed. - - * The render device will be opened on the render device's thread, by - * calling printer_procs.open_render_device. - - * Rendering Operation - * ------------------- - * During rendering, the device will not see rendering operations -- the - * first "rendering" operations the driver will see is when the renderer - * instance's print_page_copies or buffer_page routines get called. In - * both cases, the appropriate routine must then perform get_bits calls - * on the async logic in order to retrieve rendered bits, then transmit - * them to the appropriate device buffers. - - * The complication that is introduced is that which is related to - * partial pages: A buffer_page call instructs the driver to grab the - * rendered bits, but to keep the rendered bits available for later - * instead of marking on media. This implies that a buffer_page call - * opens a context where subsequent buffer_page's and print_page_copies' - * must first initialize the rendering buffers with the previous - * rendering results before calling get_bits. Drivers use the - * locate_overlay_buffer function to initialize the driver's rendering - * buffers. The first print_page_copies closes the context that was - * opened by the initial buffer_page -- the driver must go back to - * normal rendering until a new buffer_page comes along. - */ - -/* -------------- Type declarations --------------- */ - -/* typedef is in gdevprn.h */ -/* typedef struct gdev_prn_start_render_params_s gdev_prn_start_render_params;*/ -struct gdev_prn_start_render_params_s { - gx_device_printer *writer_device;/* writer dev that points to render dev */ - gx_semaphore_t *open_semaphore; /* signal this once open_code is set */ - int open_code; /* RETURNS status of open of reader device */ -}; - -/* -------- Macros used to initialize render-specific structures ------ */ - -#define init_async_render_procs(xpdev, xstart_render_thread,\ - xbuffer_page, xprint_page_copies)\ - BEGIN\ - (xpdev)->printer_procs.start_render_thread = (xstart_render_thread);\ - (xpdev)->printer_procs.buffer_page = (xbuffer_page);\ - (xpdev)->printer_procs.print_page_copies = (xprint_page_copies);\ - END - -/* -------------- Global procedure declarations --------- */ - -/* Open this printer device in ASYNC (overlapped) mode. - * - * This routine is always called by the concrete device's xx_open routine - * in lieu of gdev_prn_open. - */ -int gdev_prn_async_write_open(P4(gx_device_printer *pdev, int max_raster, - int min_band_height, int max_src_image_row)); - -/* Open the render portion of a printer device in ASYNC (overlapped) mode. - * - * This routine is always called by concrete device's xx_open_render_device - * in lieu of gdev_prn_open. - */ -int gdev_prn_async_render_open(P1(gx_device_printer *prdev)); - -/* - * Must be called by async device driver implementation (see - * gdevprna.h under "Synchronizing the Instances"). This is the - * rendering loop, which requires its own thread for as long as - * the device is open. This proc only returns after the device is closed. - */ -int /* rets 0 ok, -ve error code */ -gdev_prn_async_render_thread(P1(gdev_prn_start_render_params *)); - -#endif /* gdevprna_INCLUDED */ diff --git a/pstoraster/gdevps.c b/pstoraster/gdevps.c deleted file mode 100644 index 36df7d55b7..0000000000 --- a/pstoraster/gdevps.c +++ /dev/null @@ -1,1151 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevps.c,v 1.4 2000/04/20 19:56:41 mike Exp $ */ -/* PostScript-writing driver */ -#include "math_.h" -#include "memory_.h" -#include "time_.h" -#include "gx.h" -#include "gserrors.h" -#include "gscdefs.h" -#include "gsmatrix.h" /* for gsiparam.h */ -#include "gsiparam.h" -#include "gsline.h" -#include "gsparam.h" -#include "gxdevice.h" -#include "gscspace.h" -#include "gxdcolor.h" -#include "gzpath.h" -#include "gdevpsdf.h" -#include "gdevpstr.h" -#include "strimpl.h" -#include "sa85x.h" - -/**************************************************************** - * Notes: - * ASCII85EncodePages should use ASCIIHexEncode if LanguageLevel < 2. - * Images are never compressed; in fact, none of the other - * Distiller parameters do anything. - ****************************************************************/ - -/* ---------------- Device definition ---------------- */ - -/* Device procedures */ -private dev_proc_open_device(psw_open); -private dev_proc_output_page(psw_output_page); -private dev_proc_close_device(psw_close); -private dev_proc_copy_mono(psw_copy_mono); -private dev_proc_copy_color(psw_copy_color); -private dev_proc_put_params(psw_put_params); -private dev_proc_get_params(psw_get_params); -private dev_proc_fill_path(psw_fill_path); -private dev_proc_stroke_path(psw_stroke_path); -private dev_proc_fill_mask(psw_fill_mask); -private dev_proc_begin_image(psw_begin_image); - -#define X_DPI 720 -#define Y_DPI 720 - -typedef struct psw_path_state_s { - int num_points; /* # of points since last non-lineto */ - bool move; /* true iff last non-lineto was moveto */ - gs_point dprev[2]; /* line deltas before previous point, */ - /* if num_points - move >= 2 */ -} psw_path_state_t; - -typedef struct psw_image_params_s { - gx_bitmap_id id; - ushort width, height; -} psw_image_params_t; - -typedef struct gx_device_pswrite_s { - gx_device_psdf_common; - /* Settable parameters */ -#define LanguageLevel_default 2.0 -#define psdf_version_default psdf_version_level2 - float LanguageLevel; - /* End of parameters */ - bool ProduceEPS; - bool first_page; - long bbox_position; - psdf_binary_writer image_writer; -#define image_stream image_writer.strm -#define image_cache_size 197 -#define image_cache_reprobe_step 121 - psw_image_params_t image_cache[image_cache_size]; - bool cache_toggle; - /* Temporary state while writing a path */ - psw_path_state_t path_state; -} gx_device_pswrite; - -gs_private_st_suffix_add1_final(st_device_pswrite, gx_device_pswrite, - "gx_device_pswrite", device_pswrite_enum_ptrs, device_pswrite_reloc_ptrs, - gx_device_finalize, st_device_psdf, image_stream); - -#define psw_procs\ - { psw_open,\ - gx_upright_get_initial_matrix,\ - NULL, /* sync_output */\ - psw_output_page,\ - psw_close,\ - gx_default_rgb_map_rgb_color,\ - gx_default_rgb_map_color_rgb,\ - gdev_vector_fill_rectangle,\ - NULL, /* tile_rectangle */\ - psw_copy_mono,\ - psw_copy_color,\ - NULL, /* draw_line */\ - NULL, /* get_bits */\ - psw_get_params,\ - psw_put_params,\ - NULL, /* map_cmyk_color */\ - NULL, /* get_xfont_procs */\ - NULL, /* get_xfont_device */\ - NULL, /* map_rgb_alpha_color */\ - gx_page_device_get_page_device,\ - NULL, /* get_alpha_bits */\ - NULL, /* copy_alpha */\ - NULL, /* get_band */\ - NULL, /* copy_rop */\ - psw_fill_path,\ - psw_stroke_path,\ - psw_fill_mask,\ - gdev_vector_fill_trapezoid,\ - gdev_vector_fill_parallelogram,\ - gdev_vector_fill_triangle,\ - NULL /****** WRONG ******/, /* draw_thin_line */\ - psw_begin_image,\ - NULL, /* image_data */\ - NULL, /* end_image */\ - NULL, /* strip_tile_rectangle */\ - NULL/******psw_strip_copy_rop******/\ - } - -const gx_device_pswrite gs_pswrite_device = -{std_device_dci_type_body(gx_device_pswrite, 0, "pswrite", - &st_device_pswrite, - DEFAULT_WIDTH_10THS * X_DPI / 10, DEFAULT_HEIGHT_10THS * Y_DPI / 10, - X_DPI, Y_DPI, 3, 24, 255, 255, 256, 256), - psw_procs, - psdf_initial_values(psdf_version_default, 1 /*true */ ), /* (ASCII85EncodePages) */ - LanguageLevel_default, /* LanguageLevel */ - 0 /*false *//* ProduceEPS */ -}; - -const gx_device_pswrite gs_epswrite_device = -{std_device_dci_type_body(gx_device_pswrite, 0, "epswrite", - &st_device_pswrite, - DEFAULT_WIDTH_10THS * X_DPI / 10, DEFAULT_HEIGHT_10THS * Y_DPI / 10, - X_DPI, Y_DPI, 3, 24, 255, 255, 256, 256), - psw_procs, - psdf_initial_values(psdf_version_default, 1 /*true */ ), /* (ASCII85EncodePages) */ - LanguageLevel_default, /* LanguageLevel */ - 1 /*true *//* ProduceEPS */ -}; - -/* Vector device implementation */ -private int - psw_beginpage(P1(gx_device_vector * vdev)), psw_setlinewidth(P2(gx_device_vector * vdev, floatp width)), - psw_setcolors(P2(gx_device_vector * vdev, const gx_drawing_color * pdc)), - psw_dorect(P6(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, fixed y1, - gx_path_type_t type)), psw_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type)), - psw_moveto(P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, gx_path_type_t type)), psw_lineto(P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, gx_path_type_t type)), - psw_curveto(P10(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x1, floatp y1, floatp x2, floatp y2, - floatp x3, floatp y3, gx_path_type_t type)), psw_closepath(P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x_start, floatp y_start, gx_path_type_t type)), - psw_endpath(P2(gx_device_vector * vdev, gx_path_type_t type)); -private const gx_device_vector_procs psw_vector_procs = -{ - /* Page management */ - psw_beginpage, - /* Imager state */ - psw_setlinewidth, - psdf_setlinecap, - psdf_setlinejoin, - psdf_setmiterlimit, - psdf_setdash, - psdf_setflat, - psdf_setlogop, - /* Other state */ - psw_setcolors, /* fill & stroke colors are the same */ - psw_setcolors, - /* Paths */ - psdf_dopath, - psw_dorect, - psw_beginpath, - psw_moveto, - psw_lineto, - psw_curveto, - psw_closepath, - psw_endpath -}; - -/* ---------------- File header ---------------- */ - -private const char *const psw_ps_header[] = -{ - "%!PS-Adobe-3.0", - "%%Pages: (atend)", - 0 -}; - -private const char *const psw_eps_header[] = -{ - "%!PS-Adobe-3.0 EPSF-3.0", - 0 -}; - -private const char *const psw_header[] = -{ - "%%EndComments", - "%%BeginProlog", - 0 -}; - -private const char *const psw_prolog[] = -{ - "%%BeginResource: procset GS_pswrite_ProcSet", - "/GS_pswrite_ProcSet 40 dict dup begin", - "/!{bind def}bind def/#{load def}!", - /* rG - */ - /* G - */ - "/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!", - /* r6 - */ - /* r5 - */ - /* r3 - */ - "/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!", - "/w/setlinewidth #/J/setlinecap #", - "/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #", - "/m/moveto #/l/lineto #/c/rcurveto #/h{p closepath}!/H{P closepath}!", - /* lx - */ - /* ly - */ - /* v - */ - /* y - */ - "/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!", - /* re - */ - "/re{4 -2 roll m exch dup lx exch ly neg lx h}!", - /* ^ <-a> <-y> */ - "/^{3 index neg 3 index neg}!", - /* ... P - */ - "/P{count 0 gt{count -2 roll moveto p}if}!", - /* ... p - */ - "/p{count 2 idiv{count -2 roll rlineto}repeat}!", -"/f{P fill}!/f*{P eofill}!/S{P stroke}!/q/gsave #/Q/grestore #/rf{re fill}!", - "/Y{initclip P clip newpath}!/Y*{initclip P eoclip newpath}!/rY{re Y}!", - /* | */ - "/|{exch string readstring pop exch 4 1 roll 3 packedarray cvx exch 1 index def exec}!", - /* (|) + */ - "/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}!", - /* (|) $ */ - "/@/currentfile #/${+ @ |}!", - /* Ix */ - "/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}!", - /* , - */ - /* If - */ - /* I - */ -"/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}!", - 0 -}; - -private const char *const psw_1_prolog[] = -{ - 0 -}; - -private const char *const psw_1_5_prolog[] = -{ - "/Ic{exch Ix false 3 colorimage}!", - 0 -}; - -private const char *const psw_2_prolog[] = -{ - /* F */ - "/F{<>/CCITTFaxDecode filter}!", - /* X */ - /* - @X */ - /* +F */ - /* +F */ - /* @F */ - /* @C */ - "/X{/ASCII85Decode filter}!/@X{@ X}!/+F{2 index 2 index F}!/@F{@ +F}!/@C{@X +F}!", - /* (|) $X */ - /* -F */ - /* (|) $F */ - /* (|) $C */ - "/$X{+ @X |}!/-F{4 index 4 index F}!/$F{+ @ -F |}!/$C{+ @X -F |}!", - 0 -}; - -private const char *const psw_end_prolog[] = -{ - "end def", - "%%EndResource", - "%%EndProlog", - 0 -}; - -private void -psw_put_lines(stream * s, const char *const lines[]) -{ - int i; - - for (i = 0; lines[i] != 0; ++i) - pprints1(s, "%s\n", lines[i]); -} - -/* ---------------- Utilities ---------------- */ - -/* Reset the image cache. */ -private void -image_cache_reset(gx_device_pswrite * pdev) -{ - int i; - - for (i = 0; i < image_cache_size; ++i) - pdev->image_cache[i].id = gx_no_bitmap_id; - pdev->cache_toggle = false; -} - -/* Look up or enter image parameters in the cache. */ -/* Return -1 if the key is not in the cache, or its index. */ -/* If id is gx_no_bitmap_id or enter is false, do not enter it. */ -private int -image_cache_lookup(gx_device_pswrite * pdev, gx_bitmap_id id, - int width, int height, bool enter) -{ - int i1, i2; - psw_image_params_t *pip1; - psw_image_params_t *pip2; - - if (id == gx_no_bitmap_id) - return -1; - i1 = id % image_cache_size; - pip1 = &pdev->image_cache[i1]; - if (pip1->id == id && pip1->width == width && pip1->height == height) { - return i1; - } - i2 = (i1 + image_cache_reprobe_step) % image_cache_size; - pip2 = &pdev->image_cache[i2]; - if (pip2->id == id && pip2->width == width && pip2->height == height) { - return i2; - } - if (enter) { - int i = ((pdev->cache_toggle = !pdev->cache_toggle) ? i2 : i1); - psw_image_params_t *pip = &pdev->image_cache[i]; - - pip->id = id, pip->width = width, pip->height = height; - return i; - } - return -1; -} - -/* Prepare the encoding stream for image data. */ -/* Return 1 if we are using ASCII85 encoding. */ -private int -psw_image_stream_setup(gx_device_pswrite * pdev) -{ - int code = - psdf_begin_binary((gx_device_psdf *) pdev, &pdev->image_writer); - - return - (code < 0 ? code : - pdev->image_stream->state->template == &s_A85E_template ? 1 : 0); -} - -/* Clean up after writing an image. */ -private void -psw_image_cleanup(gx_device_pswrite * pdev) -{ - if (pdev->image_stream != 0) { - psdf_end_binary(&pdev->image_writer); - pdev->image_stream = 0; - } -} - -/* Write data for an image. Assumes width > 0, height > 0. */ -/****** IGNORES data_x ******/ -private void -psw_put_bits(stream * s, const byte * data, int data_x_bit, uint raster, - uint width_bits, int height) -{ - int y; - - for (y = 0; y < height; ++y) - pwrite(s, data + (data_x_bit >> 3) + y * raster, - (width_bits + 7) >> 3); -} -private int -psw_image_write(gx_device_pswrite * pdev, const char *imagestr, - const byte * data, int data_x, uint raster, gx_bitmap_id id, - int x, int y, int width, int height, int depth) -{ - stream *s = gdev_vector_stream((gx_device_vector *) pdev); - uint width_bits = width * depth; - int data_x_bit = data_x * depth; - int index = image_cache_lookup(pdev, id, width_bits, height, false); - char str[40]; - int code, encode; - - if (index >= 0) { - sprintf(str, "%d%c", index / 26, index % 26 + 'A'); - pprintd2(s, "%d %d ", x, y); - pprints2(s, "%s %s\n", str, imagestr); - return 0; - } - pprintd4(s, "%d %d %d %d ", x, y, width, height); - encode = code = psw_image_stream_setup(pdev); - if (code < 0) - return code; - if (depth == 1 && width > 16) { - /* - * We should really look at the statistics of the image before - * committing to using G4 encoding.... - */ - code = psdf_CFE_binary(&pdev->image_writer, width, height, false); - if (code < 0) - return code; - encode += 2; - } - if (id == gx_no_bitmap_id || width_bits * (ulong) height > 8000) { - const char *const uncached[4] = - { - "@", "@X", "@F", "@C" - }; - - pprints2(s, "%s %s\n", uncached[encode], imagestr); - psw_put_bits(pdev->image_stream, data, data_x_bit, raster, - width_bits, height); - psw_image_cleanup(pdev); - spputc(s, '\n'); - } else { - const char *const cached[4] = - { - "$", "$X", "$F", "$C" - }; - - index = image_cache_lookup(pdev, id, width_bits, height, true); - sprintf(str, "/%d%c ", index / 26, index % 26 + 'A'); - pputs(s, str); - if (depth != 1) - pprintld1(s, "%ld ", ((width_bits + 7) >> 3) * (ulong) height); - pprints1(s, "%s\n", cached[encode]); - psw_put_bits(pdev->image_stream, data, data_x_bit, raster, - width_bits, height); - psw_image_cleanup(pdev); - pprints1(s, "\n%s\n", imagestr); - } - return 0; -} - -/* Print a matrix. */ -private void -psw_put_matrix(stream * s, const gs_matrix * pmat) -{ - pprintg6(s, "[%g %g %g %g %g %g]", - pmat->xx, pmat->xy, pmat->yx, pmat->yy, pmat->tx, pmat->ty); -} - -/* ---------------- Vector device implementation ---------------- */ - -#define pdev ((gx_device_pswrite *)vdev) - -private int -psw_beginpage(gx_device_vector * vdev) -{ - stream *s = vdev->strm; - long page = vdev->PageCount + 1; - - if (pdev->first_page) { - psw_put_lines(s, - (pdev->ProduceEPS ? psw_eps_header : psw_ps_header)); - if (ftell(vdev->file) < 0) { /* File is not seekable. */ - pdev->bbox_position = -1; - pputs(s, "%%BoundingBox: (atend)\n"); - pputs(s, "%%HiResBoundingBox: (atend)\n"); - } else { /* File is seekable, leave room to rewrite bbox. */ - pdev->bbox_position = stell(s); - pputs(s, "%...............................................................\n"); - pputs(s, "%...............................................................\n"); - } - pprints1(s, "%%%%Creator: %s ", gs_product); - pprintld1(s, "%ld ", (long)gs_revision); - pprints1(s, "(%s)\n", vdev->dname); - { - struct tm tms; - time_t t; - char date_str[25]; - - time(&t); - tms = *localtime(&t); - sprintf(date_str, "%d/%02d/%02d %02d:%02d:%02d", - tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, - tms.tm_hour, tms.tm_min, tms.tm_sec); - pprints1(s, "%%%%CreationDate: %s\n", date_str); - } - if (pdev->params.ASCII85EncodePages) - pputs(s, "%%DocumentData: Clean7Bit\n"); - if (pdev->LanguageLevel == 2.0) - pputs(s, "%%LanguageLevel: 2\n"); - else if (pdev->LanguageLevel == 1.5) - pputs(s, "%%Extensions: CMYK\n"); - psw_put_lines(s, psw_header); - psw_put_lines(s, psw_prolog); - if (pdev->LanguageLevel < 1.5) - psw_put_lines(s, psw_1_prolog); - else { - psw_put_lines(s, psw_1_5_prolog); - if (pdev->LanguageLevel > 1.5) - psw_put_lines(s, psw_2_prolog); - } - psw_put_lines(s, psw_end_prolog); - } - pprintld2(s, "%%%%Page: %ld %ld\n%%%%BeginPageSetup\n", page, page); - pputs(s, "/pagesave save def GS_pswrite_ProcSet begin\n"); - if (!pdev->ProduceEPS) { - int width = (int)(vdev->width * 72.0 / vdev->HWResolution[0] + 0.5); - int height = (int)(vdev->height * 72.0 / vdev->HWResolution[1] + 0.5); - - if (pdev->LanguageLevel > 1.5) - pprintd2(s, "<< /PageSize [%d %d] >> setpagedevice\n", - width, height); - else { - typedef struct ps_ { - const char *size_name; - int width, height; - } page_size; - static const page_size sizes[] = { - {"/11x17", 792, 1224}, - {"/a3", 842, 1190}, - {"/a4", 595, 842}, - {"/b5", 501, 709}, - {"/ledger", 1224, 792}, - {"/legal", 612, 1008}, - {"/letter", 612, 792}, - {"null", 0, 0} - }; - const page_size *p = sizes; - - while (p->size_name[0] == '/' && - (p->width != width || p->height != height)) - ++p; - pprintd2(s, "%d %d ", width, height); - pprints1(s, "%s PS\n", p->size_name); - } - } - pprintg2(s, "%g %g scale\n%%%%EndPageSetup\n", - 72.0 / vdev->HWResolution[0], 72.0 / vdev->HWResolution[1]); - return 0; -} - -private int -psw_setlinewidth(gx_device_vector * vdev, floatp width) -{ /* - * The vector scale is 1, but we have to rescale the line width - * (which is given in device pixels) to account for the actual - * page scaling in effect. - */ - return psdf_setlinewidth(vdev, width * 72.0 / vdev->HWResolution[1]); -} - -private int -psw_setcolors(gx_device_vector * vdev, const gx_drawing_color * pdc) -{ - if (!gx_dc_is_pure(pdc)) - return_error(gs_error_rangecheck); - /* PostScript only keeps track of a single color. */ - vdev->fill_color = *pdc; - vdev->stroke_color = *pdc; - { - stream *s = gdev_vector_stream(vdev); - gx_color_index color = gx_dc_pure_color(pdc); - int r = color >> 16; - int g = (color >> 8) & 0xff; - int b = color & 0xff; - - if (r == g && g == b) { - if (r == 0) - pputs(s, "K\n"); - else - pprintd1(s, "%d G\n", r); - } else if (r == g) - pprintd2(s, "%d %d r6\n", b, r); - else if (g == b) - pprintd2(s, "%d %d r3\n", r, g); - else if (r == b) - pprintd2(s, "%d %d r5\n", g, b); - else - pprintd3(s, "%d %d %d rG\n", r, g, b); - } - return 0; -} - -/* Redefine dorect to recognize rectangle fills. */ -private int -psw_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, fixed y1, - gx_path_type_t type) -{ - if ((type & ~gx_path_type_rule) != gx_path_type_fill) - return psdf_dorect(vdev, x0, y0, x1, y1, type); - pprintg4(gdev_vector_stream(vdev), "%g %g %g %g rf\n", - fixed2float(x0), fixed2float(y0), - fixed2float(x1 - x0), fixed2float(y1 - y0)); - return 0; -} - -/* - * We redefine path tracing to use a compact form for polygons; also, - * we only need to write coordinates with 2 decimals of precision, - * since this is 10 times more precise than any existing output device. - */ -#define round_coord(v) (floor((v) * 100 + 0.5) / 100.0) -private void -print_coord2(stream * s, floatp x, floatp y, const char *str) -{ - pprintg2(s, "%g %g ", round_coord(x), round_coord(y)); - if (str != 0) - pputs(s, str); -} -#undef round_coord - -private int -psw_beginpath(gx_device_vector * vdev, gx_path_type_t type) -{ - pdev->path_state.num_points = 0; - pdev->path_state.move = false; - return 0; -} - -private int -psw_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, floatp y, - gx_path_type_t type) -{ - stream *s = gdev_vector_stream(vdev); - - if (pdev->path_state.num_points > pdev->path_state.move) - pputs(s, (pdev->path_state.move ? "P\n" : "p\n")); - print_coord2(s, x, y, NULL); - pdev->path_state.num_points = 1; - pdev->path_state.move = true; - return 0; -} - -private int -psw_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, floatp y, - gx_path_type_t type) -{ - double dx = x - x0, dy = y - y0; - - /* - * Omit null lines when filling. - ****** MAYBE WRONG IF PATH CONSISTS ONLY OF NULL LINES. ****** - */ - if (dx != 0 || dy != 0) { - stream *s = gdev_vector_stream(vdev); - - if (pdev->path_state.num_points - pdev->path_state.move >= 2 && - dx == -pdev->path_state.dprev[1].x && - dy == -pdev->path_state.dprev[1].y - ) - pputs(s, "^ "); - else - print_coord2(s, dx, dy, NULL); - pdev->path_state.num_points++; - pdev->path_state.dprev[1] = pdev->path_state.dprev[0]; - pdev->path_state.dprev[0].x = dx; - pdev->path_state.dprev[0].y = dy; - } - return 0; -} - -private int -psw_curveto(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x1, floatp y1, floatp x2, floatp y2, floatp x3, floatp y3, - gx_path_type_t type) -{ - stream *s = gdev_vector_stream(vdev); - double dx1 = x1 - x0, dy1 = y1 - y0; - double dx2 = x2 - x0, dy2 = y2 - y0; - double dx3 = x3 - x0, dy3 = y3 - y0; - - if (pdev->path_state.num_points > 0) - pputs(s, (pdev->path_state.move ? - (pdev->path_state.num_points == 1 ? "m\n" : "P\n") : - "p\n")); - if (dx1 == 0 && dy1 == 0) { - print_coord2(s, dx2, dy2, NULL); - print_coord2(s, dx3, dy3, "v\n"); - } else if (x3 == x2 && y3 == y2) { - print_coord2(s, dx1, dy1, NULL); - print_coord2(s, dx2, dy2, "y\n"); - } else { - print_coord2(s, dx1, dy1, NULL); - print_coord2(s, dx2, dy2, NULL); - print_coord2(s, dx3, dy3, "c\n"); - } - pdev->path_state.num_points = 0; - pdev->path_state.move = false; - return 0; -} - -private int -psw_closepath(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x_start, floatp y_start, gx_path_type_t type) -{ - pputs(gdev_vector_stream(vdev), - (pdev->path_state.num_points > 0 && pdev->path_state.move ? - "H\n" : "h\n")); - pdev->path_state.num_points = 0; - pdev->path_state.move = false; - return 0; -} - -private int -psw_endpath(gx_device_vector * vdev, gx_path_type_t type) -{ - stream *s = vdev->strm; - const char *star = (type & gx_path_type_even_odd ? "*" : ""); - - if (pdev->path_state.num_points > 0 && !pdev->path_state.move) - pputs(s, "p "); - if (type & gx_path_type_fill) { - if (type & (gx_path_type_stroke | gx_path_type_clip)) - pprints1(s, "q f%s Q ", star); - else - pprints1(s, "f%s\n", star); - } - if (type & gx_path_type_stroke) { - if (type & gx_path_type_clip) - pputs(s, "q S Q "); - else - pputs(s, "S\n"); - } - if (type & gx_path_type_clip) - pprints1(s, "Y%s\n", star); - return 0; -} - -#undef pdev - -/* ---------------- Driver procedures ---------------- */ - -#define vdev ((gx_device_vector *)dev) -#define pdev ((gx_device_pswrite *)dev) - -/* ------ Open/close/page ------ */ - -/* Open the device. */ -private int -psw_open(gx_device * dev) -{ - vdev->v_memory = dev->memory; -/****** WRONG ******/ - vdev->vec_procs = &psw_vector_procs; - { - int code = gdev_vector_open_file_bbox(vdev, 512, true); - - if (code < 0) - return code; - } - gdev_vector_init(vdev); - pdev->first_page = true; - pdev->binary_ok = !pdev->params.ASCII85EncodePages; - image_cache_reset(pdev); - return 0; -} - -/* Wrap up ("output") a page. */ -private int -psw_output_page(gx_device * dev, int num_copies, int flush) -{ - stream *s = gdev_vector_stream(vdev); - - if (num_copies != 1) - pprintd1(s, "userdict /#copies %d put\n", num_copies); - pprints1(s, "end %s pagesave restore\n%%%%PageTrailer\n", - (flush ? "showpage" : "copypage")); - sflush(s); - vdev->in_page = false; - pdev->first_page = false; - gdev_vector_reset(vdev); - image_cache_reset(pdev); - return 0; -} - -/* Close the device. */ -/* Note that if this is being called as a result of finalization, */ -/* the stream may no longer exist; but the file will still be open. */ -private int -psw_close(gx_device * dev) -{ - FILE *f = vdev->file; - - fprintf(f, "%%%%Trailer\n%%%%Pages: %ld\n", dev->PageCount); - { - gs_rect bbox; - long save_pos; - - gx_device_bbox_bbox(vdev->bbox_device, &bbox); - if (pdev->bbox_position >= 0) { - save_pos = ftell(f); - fseek(f, pdev->bbox_position, SEEK_SET); - } - fprintf(f, "%%%%BoundingBox: %d %d %d %d\n", - (int)floor(bbox.p.x), (int)floor(bbox.p.y), - (int)ceil(bbox.q.x), (int)ceil(bbox.q.y)); - fprintf(f, "%%%%HiResBoundingBox: %f %f %f %f\n", - bbox.p.x, bbox.p.y, bbox.q.x, bbox.q.y); - if (pdev->bbox_position >= 0) { - fputc('%', f); - fseek(f, save_pos, SEEK_SET); - } - } - if (!pdev->ProduceEPS) - fputs("%%EOF\n", f); - gdev_vector_close_file(vdev); - return 0; -} - -/* ---------------- Get/put parameters ---------------- */ - -/* Get parameters. */ -private int -psw_get_params(gx_device * dev, gs_param_list * plist) -{ - int code = gdev_psdf_get_params(dev, plist); - int ecode; - - if (code < 0) - return code; - if ((ecode = param_write_float(plist, "LanguageLevel", &pdev->LanguageLevel)) < 0) - return ecode; - return code; -} - -/* Put parameters. */ -private int -psw_put_params(gx_device * dev, gs_param_list * plist) -{ - int ecode = 0; - int code; - gs_param_name param_name; - float ll = pdev->LanguageLevel; - psdf_version save_version = pdev->version; - - switch (code = param_read_float(plist, (param_name = "LanguageLevel"), &ll)) { - case 0: - if (ll == 1.0 || ll == 1.5 || ll == 2.0) - break; - code = gs_error_rangecheck; - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 1: - ; - } - - if (ecode < 0) - return ecode; - /* - * We have to set version to the new value, because the set of - * legal parameter values for psdf_put_params varies according to - * the version. - */ - { - static const psdf_version vv[3] = - { - psdf_version_level1, psdf_version_level1_color, - psdf_version_level2 - }; - - pdev->version = vv[(int)(ll * 2) - 2]; - } - code = gdev_psdf_put_params(dev, plist); - if (code < 0) { - pdev->version = save_version; - return code; - } - pdev->LanguageLevel = ll; - return code; -} - -/* ---------------- Images ---------------- */ - -/* Copy a monochrome bitmap. */ -private int -psw_copy_mono(gx_device * dev, const byte * data, - int data_x, int raster, gx_bitmap_id id, int x, int y, int w, int h, - gx_color_index zero, gx_color_index one) -{ - gx_drawing_color color; - const char *op; - int code = 0; - - if (w <= 0 || h <= 0) - return 0; - (*dev_proc(vdev->bbox_device, copy_mono)) - ((gx_device *) vdev->bbox_device, data, data_x, raster, id, - x, y, w, h, zero, one); - if (one == gx_no_color_index) { - color_set_pure(&color, zero); - code = gdev_vector_update_fill_color((gx_device_vector *) pdev, - &color); - op = "If"; - } else if (zero == vdev->black && one == vdev->white) - op = "1 I"; - else { - if (zero != gx_no_color_index) { - code = (*dev_proc(dev, fill_rectangle)) (dev, x, y, w, h, zero); - if (code < 0) - return code; - } - color_set_pure(&color, one); - code = gdev_vector_update_fill_color((gx_device_vector *) pdev, - &color); - op = ","; - } - if (code < 0) - return 0; - return psw_image_write(pdev, op, data, data_x, raster, id, - x, y, w, h, 1); -} - -/* Copy a color bitmap. */ -private int -psw_copy_color(gx_device * dev, - const byte * data, int data_x, int raster, gx_bitmap_id id, - int x, int y, int w, int h) -{ - int depth = dev->color_info.depth; - const byte *bits = data + data_x * 3; - char op[6]; - - if (w <= 0 || h <= 0) - return 0; - (*dev_proc(vdev->bbox_device, copy_color)) - ((gx_device *) vdev->bbox_device, data, data_x, raster, id, - x, y, w, h); - /* - * If this is a 1-pixel-high image, check for it being all the - * same color, and if so, fill it as a rectangle. - */ - if (h == 1 && !memcmp(bits, bits + 3, (w - 1) * 3)) { - return (*dev_proc(dev, fill_rectangle)) - (dev, x, y, w, h, (bits[0] << 16) + (bits[1] << 8) + bits[2]); - } - sprintf(op, "%d Ic", depth / 3); /* RGB */ - return psw_image_write(pdev, op, data, data_x, raster, id, - x, y, w, h, depth); -} - -/* Fill or stroke a path. */ -/* We redefine these to skip empty paths. */ -private int -psw_fill_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_fill_params * params, - const gx_device_color * pdevc, const gx_clip_path * pcpath) -{ - if (gx_path_is_void(ppath)) - return 0; - return gdev_vector_fill_path(dev, pis, ppath, params, pdevc, pcpath); -} -private int -psw_stroke_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_stroke_params * params, - const gx_device_color * pdevc, const gx_clip_path * pcpath) -{ - if (gx_path_is_void(ppath) && - (gx_path_is_null(ppath) || - gs_currentlinecap((const gs_state *)pis) != gs_cap_round) - ) - return 0; - return gdev_vector_stroke_path(dev, pis, ppath, params, pdevc, pcpath); -} - -/* Fill a mask. */ -private int -psw_fill_mask(gx_device * dev, - const byte * data, int data_x, int raster, gx_bitmap_id id, - int x, int y, int w, int h, - const gx_drawing_color * pdcolor, int depth, - gs_logical_operation_t lop, const gx_clip_path * pcpath) -{ - if (w <= 0 || h <= 0) - return 0; - if (depth > 1 || - gdev_vector_update_fill_color(vdev, pdcolor) < 0 || - gdev_vector_update_clip_path(vdev, pcpath) < 0 || - gdev_vector_update_log_op(vdev, lop) < 0 - ) - return gx_default_fill_mask(dev, data, data_x, raster, id, - x, y, w, h, pdcolor, depth, lop, pcpath); - (*dev_proc(vdev->bbox_device, fill_mask)) - ((gx_device *) vdev->bbox_device, data, data_x, raster, id, - x, y, w, h, pdcolor, depth, lop, pcpath); - return psw_image_write(pdev, ",", data, data_x, raster, id, - x, y, w, h, 1); -} - -/* ---------------- High-level images ---------------- */ - -private image_enum_proc_plane_data(psw_image_plane_data); -private image_enum_proc_end_image(psw_image_end_image); -private const gx_image_enum_procs_t psw_image_enum_procs = -{ - psw_image_plane_data, psw_image_end_image -}; - -/* Start processing an image. */ -private int -psw_begin_image(gx_device * dev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * mem, gx_image_enum_common_t ** pinfo) -{ - gdev_vector_image_enum_t *pie = - gs_alloc_struct(mem, gdev_vector_image_enum_t, - &st_vector_image_enum, "psw_begin_image"); - const gs_color_space *pcs = pim->ColorSpace; - gs_color_space_index index; - int num_components; - bool can_do = prect == 0; - int code; - - if (pie == 0) - return_error(gs_error_VMerror); - pie->memory = mem; - *pinfo = (gx_image_enum_common_t *) pie; - if (!pim->ImageMask) { - index = gs_color_space_get_index(pcs); - num_components = gs_color_space_num_components(pcs); - } - if (pdev->LanguageLevel < 2 && !pim->ImageMask) { /* - * Restrict ourselves to Level 1 images: device color spaces, [0 - * 1] decode, bits per component <= 8, no CombineWithColor. - */ - if (pim->BitsPerComponent > 8 || pim->CombineWithColor) - can_do = false; - else { - int i; - - switch (index) { - case gs_color_space_index_DeviceGray: - case gs_color_space_index_DeviceRGB: - case gs_color_space_index_DeviceCMYK: - for (i = 0; i < num_components * 2; ++i) - if (pim->Decode[i] != (i & 1)) - can_do = false; - break; - default: - can_do = false; - } - } - } - if (!can_do || - gdev_vector_begin_image(vdev, pis, pim, format, prect, pdcolor, - pcpath, mem, &psw_image_enum_procs, pie) < 0 || - (code = psw_image_stream_setup(pdev)) < 0 - ) - return gx_default_begin_image(dev, pis, pim, format, prect, - pdcolor, pcpath, mem, - &pie->default_info); - /* Write the image/colorimage/imagemask preamble. */ - { - stream *s = gdev_vector_stream((gx_device_vector *) pdev); - const char *source = (code ? "@X" : "@"); - gs_matrix imat; - - pputs(s, "q"); - (*dev_proc(dev, get_initial_matrix)) (dev, &imat); - gs_matrix_scale(&imat, 72.0 / dev->HWResolution[0], - 72.0 / dev->HWResolution[1], &imat); - gs_matrix_invert(&imat, &imat); - gs_matrix_multiply(&ctm_only(pis), &imat, &imat); - psw_put_matrix(s, &imat); - pprintd2(s, "concat\n%d %d ", pie->width, pie->height); - if (pim->ImageMask) { - pputs(s, (pim->Decode[0] == 0 ? "false" : "true")); - psw_put_matrix(s, &pim->ImageMatrix); - pprints1(s, "%s imagemask\n", source); - } else { - pprintd1(s, "%d", pim->BitsPerComponent); - psw_put_matrix(s, &pim->ImageMatrix); - if (index == gs_color_space_index_DeviceGray) - pprints1(s, "%s image\n", source); - else { - if (format == gs_image_format_chunky) - pprints1(s, "%s false", source); - else - pprints2(s, "%s %strue", source, - "dup dup dup " + (16 - num_components * 4)); - pprintd1(s, " %d colorimage\n", num_components); - } - } - } - return 0; -} - -/* Process the next piece of an image. */ -private int -psw_image_plane_data(gx_device * dev, - gx_image_enum_common_t * info, const gx_image_plane_t * planes, int height) -{ - gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info; - - if (pie->default_info) - return gx_image_plane_data(pie->default_info, planes, height); - gx_image_plane_data(pie->bbox_info, planes, height); - { - int pi; - - for (pi = 0; pi < pie->num_planes; ++pi) - psw_put_bits(pdev->image_stream, planes[pi].data, - planes[pi].data_x * info->plane_depths[pi], - planes[pi].raster, - pie->width * info->plane_depths[pi], - height); - } - return (pie->y += height) >= pie->height; -} - -/* Clean up by releasing the buffers. */ -private int -psw_image_end_image(gx_device * dev, gx_image_enum_common_t * info, - bool draw_last) -{ - gdev_vector_image_enum_t *pie = (gdev_vector_image_enum_t *) info; - int code; - - code = gdev_vector_end_image(vdev, pie, draw_last, pdev->white); - if (code > 0) { - psw_image_cleanup(pdev); - pputs(pdev->strm, "\nQ\n"); - } - return code; -} diff --git a/pstoraster/gdevpsde.c b/pstoraster/gdevpsde.c deleted file mode 100644 index 493c99d797..0000000000 --- a/pstoraster/gdevpsde.c +++ /dev/null @@ -1,282 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsde.c,v 1.1 2000/03/08 23:14:25 mike Exp $ */ -/* Embedded font writing */ -#include "memory_.h" -#include "gx.h" -#include "gserrors.h" -#include "gsccode.h" -#include "gsmatrix.h" -#include "gxfixed.h" -#include "gxfont.h" -#include "gxfont1.h" -#include "stream.h" -#include "gdevpstr.h" -#include "gdevpsdf.h" - -private int -embed_table(gs_param_list * plist, const char *key, const float *values, - int count) -{ - if (count != 0) { - gs_param_float_array fa; - - fa.size = count; - fa.data = values; - return param_write_float_array(plist, key, &fa); - } - return 0; -} - -private void -embed_uid(stream * s, const gs_uid * puid) -{ - if (uid_is_UniqueID(puid)) - pprintld1(s, "/UniqueID %ld def\n", puid->id); - else if (uid_is_XUID(puid)) { - uint i, n = uid_XUID_size(puid); - - pputs(s, "/XUID ["); - for (i = 0; i < n; ++i) - pprintld1(s, "%ld ", uid_XUID_values(puid)[i]); - pputs(s, "] def\n"); - } -} - -/* Write an embedded Type 1 font. */ -int -psdf_embed_type1_font(stream * s, gs_font_type1 * pfont) -{ - const gs_type1_data *const pdata = &pfont->data; - gs_param_list *plist; - param_printer_params_t ppp; - int code; - - ppp = param_printer_params_default; - ppp.item_suffix = " def\n"; - code = psdf_alloc_param_printer(&plist, &ppp, s, - print_binary_ok, s->memory); - if (code < 0) - return 0; - - /* Write the font header. */ - - pputs(s, "%!PS-AdobeFont-1.0: "); - pwrite(s, pfont->font_name.chars, pfont->font_name.size); - pputs(s, "\n11 dict begin\n"); - - /* Write FontInfo. Currently we don't write anything there. */ - - pputs(s, "/FontInfo 1 dict dup begin\n"); - pputs(s, "end readonly def\n"); - - /* Write the main font dictionary. */ - - pputs(s, "/FontName /"); - pwrite(s, pfont->font_name.chars, pfont->font_name.size); - pputs(s, " def\n"); - pputs(s, "/Encoding "); - switch (pfont->encoding_index) { - case 0: - pputs(s, "StandardEncoding"); - break; - case 1: - pputs(s, "ISOLatin1Encoding"); - break; - default:{ - gs_char i; - - pputs(s, "256 array\n"); - pputs(s, "0 1 255 {1 index exch /.notdef put} for\n"); - for (i = 0; i < 256; ++i) { - gs_glyph glyph = - (*pfont->procs.encode_char) (NULL, (gs_font *) pfont, &i); - const char *namestr; - uint namelen; - - if (glyph != gs_no_glyph && - (namestr = (*pfont->procs.callbacks.glyph_name) (glyph, &namelen)) != 0 && - !(namelen == 7 && !memcmp(namestr, ".notdef", 7)) - ) { - pprintd1(s, "dup %d /", (int)i); - pwrite(s, namestr, namelen); - pputs(s, " put\n"); - } - } - pputs(s, "readonly"); - } - } - pputs(s, " def\n"); - pprintg6(s, "/FontMatrix [%g %g %g %g %g %g] readonly def\n", - pfont->FontMatrix.xx, pfont->FontMatrix.xy, - pfont->FontMatrix.yx, pfont->FontMatrix.yy, - pfont->FontMatrix.tx, pfont->FontMatrix.ty); - embed_uid(s, &pfont->UID); - pprintg4(s, "/FontBBox {%g %g %g %g} readonly def\n", - pfont->FontBBox.p.x, pfont->FontBBox.p.y, - pfont->FontBBox.q.x, pfont->FontBBox.q.y); - { - private const gs_param_item_t font_items[] = - { - {"FontType", gs_param_type_int, - offset_of(gs_font_type1, FontType)}, - {"PaintType", gs_param_type_int, - offset_of(gs_font_type1, PaintType)}, - {"StrokeWidth", gs_param_type_float, - offset_of(gs_font_type1, StrokeWidth)}, - gs_param_item_end - }; - - code = gs_param_write_items(plist, pfont, NULL, font_items); - if (code < 0) - return code; - } - pputs(s, "currentdict end\n"); - - /* Write the Private dictionary. */ - - pputs(s, "dup /Private 17 dict dup begin\n"); - pputs(s, "/-|{string currentfile exch readstring pop}executeonly def\n"); - pputs(s, "/|-{noaccess def}executeonly def\n"); - pputs(s, "/|{noaccess put}executeonly def\n"); - { - private const gs_param_item_t private_items[] = - { - {"lenIV", gs_param_type_int, - offset_of(gs_type1_data, lenIV)}, - {"BlueFuzz", gs_param_type_int, - offset_of(gs_type1_data, BlueFuzz)}, - {"BlueScale", gs_param_type_float, - offset_of(gs_type1_data, BlueScale)}, - {"BlueShift", gs_param_type_float, - offset_of(gs_type1_data, BlueShift)}, - {"ExpansionFactor", gs_param_type_float, - offset_of(gs_type1_data, ExpansionFactor)}, - {"ForceBold", gs_param_type_bool, - offset_of(gs_type1_data, ForceBold)}, - {"LanguageGroup", gs_param_type_int, - offset_of(gs_type1_data, LanguageGroup)}, - {"RndStemUp", gs_param_type_bool, - offset_of(gs_type1_data, RndStemUp)}, - gs_param_item_end - }; - gs_type1_data defaults; - - defaults.lenIV = 4; - defaults.BlueFuzz = 1; - defaults.BlueScale = 0.039625; - defaults.BlueShift = 7.0; - defaults.ExpansionFactor = 0.06; - defaults.ForceBold = false; - defaults.LanguageGroup = 0; - defaults.RndStemUp = true; - code = gs_param_write_items(plist, pdata, &defaults, private_items); - if (code < 0) - return code; - embed_table(plist, "BlueValues", pdata->BlueValues.values, - pdata->BlueValues.count); - embed_table(plist, "OtherBlues", pdata->OtherBlues.values, - pdata->OtherBlues.count); - embed_table(plist, "FamilyBlues", pdata->FamilyBlues.values, - pdata->FamilyBlues.count); - embed_table(plist, "FamilyOtherBlues", pdata->FamilyOtherBlues.values, - pdata->FamilyOtherBlues.count); - embed_table(plist, "StdHW", pdata->StdHW.values, - pdata->StdHW.count); - embed_table(plist, "StemSnapH", pdata->StemSnapH.values, - pdata->StemSnapH.count); - embed_table(plist, "StemSnapV", pdata->StemSnapV.values, - pdata->StemSnapV.count); - } - embed_uid(s, &pfont->UID); - pputs(s, "/MinFeature{16 16} |-\n"); - pputs(s, "/password 5839 def\n"); - - /* Write the Subrs. */ - - { - int n, i; - gs_const_string str; - - for (n = 0; - (*pdata->procs->subr_data) (pfont, n, false, &str) != - gs_error_rangecheck; - ) - ++n; - pprintd1(s, "/Subrs %d array\n", n); - for (i = 0; i < n; ++i) - if ((*pdata->procs->subr_data) (pfont, i, false, &str) >= 0) { - char buf[50]; - - sprintf(buf, "dup %d %u -| ", i, str.size); - pputs(s, buf); - pwrite(s, str.data, str.size); - pputs(s, " |\n"); - } - pputs(s, "|-\n"); - } - - /* We don't write OtherSubrs -- there had better not be any! */ - - /* Write the CharStrings. */ - - { - int num_chars = 0; - gs_glyph glyph; - int index = 0; - gs_const_string gdata; - int code; - - for (glyph = gs_no_glyph, index = 0; - code = (*pdata->procs->next_glyph) (pfont, &index, &glyph), - index != 0; - ) - if (code == 0 && (*pdata->procs->glyph_data) (pfont, glyph, &gdata) >= 0) - ++num_chars; - pprintd1(s, "2 index /CharStrings %d dict dup begin\n", num_chars); - for (glyph = gs_no_glyph, index = 0; - code = (*pdata->procs->next_glyph) (pfont, &index, &glyph), - index != 0; - ) - if (code == 0 && (*pdata->procs->glyph_data) (pfont, glyph, &gdata) >= 0) { - uint gssize; - const char *gstr = - (*pfont->procs.callbacks.glyph_name) (glyph, &gssize); - - pputs(s, "/"); - pwrite(s, gstr, gssize); - pprintd1(s, " %d -| ", gdata.size); - pwrite(s, gdata.data, gdata.size); - pputs(s, " |-\n"); - } - } - - /* Wrap up. */ - - pputs(s, "end\nend\nreadonly put\nnoaccess put\n"); - pputs(s, "dup/FontName get exch definefont pop\n"); - psdf_free_param_printer(plist); - return 0; -} diff --git a/pstoraster/gdevpsdf.c b/pstoraster/gdevpsdf.c deleted file mode 100644 index 19603b5950..0000000000 --- a/pstoraster/gdevpsdf.c +++ /dev/null @@ -1,514 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsdf.c,v 1.1 2000/03/08 23:14:25 mike Exp $ */ -/* Common utilities for PostScript and PDF writers */ -#include "string_.h" -#include "gx.h" -#include "gserrors.h" -#include "gdevpsdf.h" -#include "gdevpstr.h" -#include "scanchar.h" -#include "strimpl.h" -#include "sa85x.h" -#include "scfx.h" -#include "sstring.h" - -/* Structure descriptor */ -public_st_device_psdf(); - -/* ---------------- Vector implementation procedures ---------------- */ - -int -psdf_setlinewidth(gx_device_vector * vdev, floatp width) -{ - pprintg1(gdev_vector_stream(vdev), "%g w\n", width); - return 0; -} - -int -psdf_setlinecap(gx_device_vector * vdev, gs_line_cap cap) -{ - pprintd1(gdev_vector_stream(vdev), "%d J\n", cap); - return 0; -} - -int -psdf_setlinejoin(gx_device_vector * vdev, gs_line_join join) -{ - pprintd1(gdev_vector_stream(vdev), "%d j\n", join); - return 0; -} - -int -psdf_setmiterlimit(gx_device_vector * vdev, floatp limit) -{ - pprintg1(gdev_vector_stream(vdev), "%g M\n", limit); - return 0; -} - -int -psdf_setdash(gx_device_vector * vdev, const float *pattern, uint count, - floatp offset) -{ - stream *s = gdev_vector_stream(vdev); - int i; - - pputs(s, "[ "); - for (i = 0; i < count; ++i) - pprintg1(s, "%g ", pattern[i]); - pprintg1(s, "] %g d\n", offset); - return 0; -} - -int -psdf_setflat(gx_device_vector * vdev, floatp flatness) -{ - pprintg1(gdev_vector_stream(vdev), "%g i\n", flatness); - return 0; -} - -int -psdf_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop, - gs_logical_operation_t diff) -{ -/****** SHOULD AT LEAST DETECT SET-0 & SET-1 ******/ - return 0; -} - -int -psdf_setfillcolor(gx_device_vector * vdev, const gx_drawing_color * pdc) -{ - return psdf_set_color(vdev, pdc, "rg"); -} - -int -psdf_setstrokecolor(gx_device_vector * vdev, const gx_drawing_color * pdc) -{ - return psdf_set_color(vdev, pdc, "RG"); -} - -int -psdf_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, fixed y1, - gx_path_type_t type) -{ - int code = (*vdev_proc(vdev, beginpath)) (vdev, type); - - if (code < 0) - return code; - pprintg4(gdev_vector_stream(vdev), "%g %g %g %g re\n", - fixed2float(x0), fixed2float(y0), - fixed2float(x1 - x0), fixed2float(y1 - y0)); - return (*vdev_proc(vdev, endpath)) (vdev, type); -} - -int -psdf_beginpath(gx_device_vector * vdev, gx_path_type_t type) -{ - return 0; -} - -int -psdf_moveto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, floatp y, - bool first, gx_path_type_t type) -{ - pprintg2(gdev_vector_stream(vdev), "%g %g m\n", x, y); - return 0; -} - -int -psdf_lineto(gx_device_vector * vdev, floatp x0, floatp y0, floatp x, floatp y, - gx_path_type_t type) -{ - pprintg2(gdev_vector_stream(vdev), "%g %g l\n", x, y); - return 0; -} - -int -psdf_curveto(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x1, floatp y1, floatp x2, floatp y2, floatp x3, floatp y3, - gx_path_type_t type) -{ - if (x1 == x0 && y1 == y0) - pprintg4(gdev_vector_stream(vdev), "%g %g %g %g v\n", - x2, y2, x3, y3); - else if (x3 == x2 && y3 == y2) - pprintg4(gdev_vector_stream(vdev), "%g %g %g %g y\n", - x1, y1, x2, y2); - else - pprintg6(gdev_vector_stream(vdev), "%g %g %g %g %g %g c\n", - x1, y1, x2, y2, x3, y3); - return 0; -} - -int -psdf_closepath(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x_start, floatp y_start, gx_path_type_t type) -{ - pputs(gdev_vector_stream(vdev), "h\n"); - return 0; -} - -/* endpath is deliberately omitted. */ - -/* ---------------- Utilities ---------------- */ - -int -psdf_set_color(gx_device_vector * vdev, const gx_drawing_color * pdc, - const char *rgs) -{ - if (!gx_dc_is_pure(pdc)) - return_error(gs_error_rangecheck); - { - stream *s = gdev_vector_stream(vdev); - gx_color_index color = gx_dc_pure_color(pdc); - float r = (color >> 16) / 255.0; - float g = ((color >> 8) & 0xff) / 255.0; - float b = (color & 0xff) / 255.0; - - if (r == g && g == b) - pprintg1(s, "%g", r), pprints1(s, " %s\n", rgs + 1); - else - pprintg3(s, "%g %g %g", r, g, b), pprints1(s, " %s\n", rgs); - } - return 0; -} - -/* ---------------- Binary data writing ---------------- */ - -/* Begin writing binary data. */ -int -psdf_begin_binary(gx_device_psdf * pdev, psdf_binary_writer * pbw) -{ - pbw->strm = pdev->strm; - pbw->dev = pdev; - /* If not binary, set up the encoding stream. */ - if (!pdev->binary_ok) - psdf_encode_binary(pbw, &s_A85E_template, NULL); - return 0; -} - -/* Add an encoding filter. The client must have allocated the stream state, */ -/* if any, using pdev->v_memory. */ -int -psdf_encode_binary(psdf_binary_writer * pbw, const stream_template * template, - stream_state * ss) -{ - gx_device_psdf *pdev = pbw->dev; - gs_memory_t *mem = pdev->v_memory; - stream *es = s_alloc(mem, "psdf_encode_binary(stream)"); - stream_state *ess = (ss == 0 ? (stream_state *) es : ss); - uint bsize = max(template->min_out_size, 256); /* arbitrary */ - byte *buf = gs_alloc_bytes(mem, bsize, "psdf_encode_binary(buf)"); - - if (es == 0 || buf == 0) { - gs_free_object(mem, buf, "psdf_encode_binary(buf)"); - gs_free_object(mem, es, "psdf_encode_binary(stream)"); - return_error(gs_error_VMerror); - } - if (ess == 0) - ess = (stream_state *) es; - s_std_init(es, buf, bsize, &s_filter_write_procs, s_mode_write); - ess->template = template; - ess->memory = mem; - es->procs.process = template->process; - es->memory = mem; - es->state = ess; - if (template->init) - (*template->init) (ess); - es->strm = pbw->strm; - pbw->strm = es; - return 0; -} - -/* Add a 2-D CCITTFax encoding filter. */ -int -psdf_CFE_binary(psdf_binary_writer * pbw, int w, int h, bool invert) -{ - gx_device_psdf *pdev = pbw->dev; - gs_memory_t *mem = pdev->v_memory; - const stream_template *template = &s_CFE_template; - stream_CFE_state *st = - gs_alloc_struct(mem, stream_CFE_state, template->stype, - "psdf_CFE_binary"); - int code; - - if (st == 0) - return_error(gs_error_VMerror); - (*template->set_defaults) ((stream_state *) st); - st->K = -1; - st->Columns = w; - st->Rows = h; - st->BlackIs1 = !invert; - code = psdf_encode_binary(pbw, template, (stream_state *) st); - if (code < 0) - gs_free_object(mem, st, "psdf_CFE_binary"); - return code; -} - -/* Finish writing binary data. */ -int -psdf_end_binary(psdf_binary_writer * pbw) -{ - gx_device_psdf *pdev = pbw->dev; - - /* Close the filters in reverse order. */ - /* Stop before we try to close the file stream. */ - while (pbw->strm != pdev->strm) { - stream *next = pbw->strm->strm; - - sclose(pbw->strm); - pbw->strm = next; - } - return 0; -} - -/* - * Write a string in its shortest form ( () or <> ). Note that - * this form is different depending on whether binary data are allowed. - * Currently we don't support ASCII85 strings ( <~ ~> ). - */ -void -psdf_write_string(stream * s, const byte * str, uint size, int print_ok) -{ - uint added = 0; - uint i; - const stream_template *template; - stream_AXE_state state; - stream_state *st = NULL; - - if (print_ok & print_binary_ok) { /* Only need to escape (, ), \, CR, EOL. */ - pputc(s, '('); - for (i = 0; i < size; ++i) { - byte ch = str[i]; - - switch (ch) { - case char_CR: - pputs(s, "\\r"); - continue; - case char_EOL: - pputs(s, "\\n"); - continue; - case '(': - case ')': - case '\\': - pputc(s, '\\'); - } - pputc(s, ch); - } - pputc(s, ')'); - return; - } - for (i = 0; i < size; ++i) { - byte ch = str[i]; - - if (ch == 0 || ch >= 127) - added += 3; - else if (strchr("()\\\n\r\t\b\f", ch) != 0) - ++added; - else if (ch < 32) - added += 3; - } - - if (added < size) { /* More efficient to represent as PostScript string. */ - template = &s_PSSE_template; - pputc(s, '('); - } else { /* More efficient to represent as hex string. */ - template = &s_AXE_template; - st = (stream_state *) & state; - s_AXE_init_inline(&state); - pputc(s, '<'); - } - - { - byte buf[100]; /* size is arbitrary */ - stream_cursor_read r; - stream_cursor_write w; - int status; - - r.ptr = str - 1; - r.limit = r.ptr + size; - w.limit = buf + sizeof(buf) - 1; - do { - w.ptr = buf - 1; - status = (*template->process) (st, &r, &w, true); - pwrite(s, buf, (uint) (w.ptr + 1 - buf)); - } - while (status == 1); - } -} - -/* Set up a write stream that just keeps track of the position. */ -int -psdf_alloc_position_stream(stream ** ps, gs_memory_t * mem) -{ - stream *s = *ps = s_alloc(mem, "psdf_alloc_position_stream"); - - if (s == 0) - return_error(gs_error_VMerror); - swrite_position_only(s); - return 0; -} - -/* ---------------- Parameter printing ---------------- */ - -typedef struct printer_param_list_s { - gs_param_list_common; - stream *strm; - param_printer_params_t params; - int print_ok; - bool any; -} printer_param_list_t; - -gs_private_st_ptrs1(st_printer_param_list, printer_param_list_t, - "printer_param_list_t", printer_plist_enum_ptrs, printer_plist_reloc_ptrs, - strm); -const param_printer_params_t param_printer_params_default = -{ - param_printer_params_default_values -}; - -/* We'll implement the other printers later if we have to. */ -private param_proc_xmit_typed(param_print_typed); -/*private param_proc_begin_xmit_collection(param_print_begin_collection); */ -/*private param_proc_end_xmit_collection(param_print_end_collection); */ -private const gs_param_list_procs printer_param_list_procs = { - param_print_typed, - NULL /* begin_collection */ , - NULL /* end_collection */ , - NULL /* get_next_key */ , - gs_param_request_default, - gs_param_requested_default -}; - -int -psdf_alloc_param_printer(gs_param_list ** pplist, - const param_printer_params_t * ppp, stream * s, - int print_ok, gs_memory_t * mem) -{ - printer_param_list_t *prlist = - gs_alloc_struct(mem, printer_param_list_t, &st_printer_param_list, - "psdf_alloc_param_printer"); - - *pplist = (gs_param_list *) prlist; - if (prlist == 0) - return_error(gs_error_VMerror); - prlist->procs = &printer_param_list_procs; - prlist->memory = mem; - prlist->strm = s; - prlist->params = *ppp; - prlist->print_ok = print_ok; - prlist->any = false; - return 0; -} - -void -psdf_free_param_printer(gs_param_list * plist) -{ - if (plist) { - printer_param_list_t *prlist = (printer_param_list_t *) plist; - - if (prlist->any && prlist->params.suffix) - pputs(prlist->strm, prlist->params.suffix); - gs_free_object(prlist->memory, plist, "psdf_free_param_printer"); - } -} - -#define prlist ((printer_param_list_t *)plist) -private int -param_print_typed(gs_param_list * plist, gs_param_name pkey, - gs_param_typed_value * pvalue) -{ - stream *s = prlist->strm; - - if (!prlist->any) { - if (prlist->params.prefix) - pputs(s, prlist->params.prefix); - prlist->any = true; - } - if (prlist->params.item_prefix) - pputs(s, prlist->params.item_prefix); - pprints1(s, "/%s", pkey); - switch (pvalue->type) { - case gs_param_type_null: - pputs(s, " null"); - break; - case gs_param_type_bool: - pputs(s, (pvalue->value.b ? " true" : " false")); - break; - case gs_param_type_int: - pprintd1(s, " %d", pvalue->value.i); - break; - case gs_param_type_long: - pprintld1(s, " %l", pvalue->value.l); - break; - case gs_param_type_float: - pprintg1(s, " %g", pvalue->value.f); - break; - case gs_param_type_string: - psdf_write_string(s, pvalue->value.s.data, pvalue->value.s.size, - prlist->print_ok); - break; - case gs_param_type_name: -/****** SHOULD USE #-ESCAPES FOR PDF ******/ - pputc(s, '/'); - pwrite(s, pvalue->value.n.data, pvalue->value.n.size); - break; - case gs_param_type_int_array: - { - uint i; - char sepr = (pvalue->value.ia.size <= 10 ? ' ' : '\n'); - - pputc(s, '['); - for (i = 0; i < pvalue->value.ia.size; ++i) { - pprintd1(s, "%d", pvalue->value.ia.data[i]); - pputc(s, sepr); - } - pputc(s, ']'); - } - break; - case gs_param_type_float_array: - { - uint i; - char sepr = (pvalue->value.fa.size <= 10 ? ' ' : '\n'); - - pputc(s, '['); - for (i = 0; i < pvalue->value.fa.size; ++i) { - pprintg1(s, "%g", pvalue->value.fa.data[i]); - pputc(s, sepr); - } - pputc(s, ']'); - } - break; - /*case gs_param_type_string_array: */ - /*case gs_param_type_name_array: */ - default: - return_error(gs_error_typecheck); - } - if (prlist->params.item_suffix) - pputs(s, prlist->params.item_suffix); - return 0; -} - -#undef prlist diff --git a/pstoraster/gdevpsdf.h b/pstoraster/gdevpsdf.h deleted file mode 100644 index b8ef1c03d4..0000000000 --- a/pstoraster/gdevpsdf.h +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsdf.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Common output syntax and parameters for PostScript and PDF writers */ - -#ifndef gdevpsdf_INCLUDED -# define gdevpsdf_INCLUDED - -#include "gdevvec.h" -#include "gsparam.h" -#include "strimpl.h" -#include "scfx.h" - -/* ---------------- Distiller parameters ---------------- */ - -/* Parameters for controlling distillation of images. */ -typedef struct psdf_image_params_s { - stream_state *ACSDict; /* JPEG */ - bool AntiAlias; - bool AutoFilter; - int Depth; - stream_state *Dict; /* JPEG or CCITTFax */ - bool Downsample; - enum psdf_downsample_type { - ds_Average, - ds_Subsample - } DownsampleType; - bool Encode; - const char *Filter; - int Resolution; - const stream_template *filter_template; -} psdf_image_params; - -#define psdf_image_param_defaults(af, res, f, ft)\ - NULL/*ACSDict*/, 0/*false*/, af, -1, NULL/*Dict*/, 0/*false*/,\ - ds_Subsample, 1/*true*/, f, res, ft - -/* Declare templates for default image compression filters. */ -extern const stream_template s_CFE_template; - -/* Complete distiller parameters. */ -typedef struct psdf_distiller_params_s { - - /* General parameters */ - - bool ASCII85EncodePages; - enum psdf_auto_rotate_pages { - arp_None, - arp_All, - arp_PageByPage - } AutoRotatePages; - bool CompressPages; - long ImageMemory; - bool LZWEncodePages; - bool PreserveHalftoneInfo; - bool PreserveOPIComments; - bool PreserveOverprintSettings; - enum psdf_transfer_function_info { - tfi_Preserve, - tfi_Apply, - tfi_Remove - } TransferFunctionInfo; - enum psdf_ucr_and_bg_info { - ucrbg_Preserve, - ucrbg_Remove - } UCRandBGInfo; - bool UseFlateCompression; -#define psdf_general_param_defaults(ascii)\ - ascii, arp_None, 1/*true*/, 250000, 0/*false*/,\ - 0/*false*/, 0/*false*/, 0/*false*/, tfi_Apply, ucrbg_Remove, 1 /*true */ - - /* Color sampled image parameters */ - - psdf_image_params ColorImage; - enum psdf_color_conversion_strategy { - ccs_LeaveColorUnchanged, - ccs_UseDeviceDependentColor, - ccs_UseDeviceIndependentColor - } ColorConversionStrategy; - bool ConvertCMYKImagesToRGB; - bool ConvertImagesToIndexed; -#define psdf_color_image_param_defaults\ - { psdf_image_param_defaults(1/*true*/, 72, 0, 0) },\ - ccs_LeaveColorUnchanged, 1/*true*/, 0 /*false */ - - /* Grayscale sampled image parameters */ - - psdf_image_params GrayImage; -#define psdf_gray_image_param_defaults\ - { psdf_image_param_defaults(1/*true*/, 72, 0, 0) } - - /* Monochrome sampled image parameters */ - - psdf_image_params MonoImage; -#define psdf_mono_image_param_defaults\ - { psdf_image_param_defaults(0/*false*/, 300, "CCITTFaxEncode", &s_CFE_template) } - - /* Font embedding parameters */ - - gs_param_string_array AlwaysEmbed; - gs_param_string_array NeverEmbed; - bool EmbedAllFonts; - bool SubsetFonts; - int MaxSubsetPct; -#define psdf_font_param_defaults\ - { 0, 0, 1/*true*/ }, { 0, 0, 1/*true*/ },\ - 1/*true*/, 1/*true*/, 20 - -} psdf_distiller_params; - -/* Define PostScript/PDF versions, corresponding roughly to Adobe versions. */ -typedef enum { - psdf_version_level1 = 1000, /* Red Book Level 1 */ - psdf_version_level1_color = 1100, /* Level 1 + colorimage + CMYK color */ - psdf_version_level2 = 2000, /* Red Book Level 2 */ - psdf_version_level2_plus = 2017, /* Adobe release 2017 */ - psdf_version_ll3 = 3010 /* LanguageLevel 3, release 3010 */ -} psdf_version; - -/* Define the extended device structure. */ -#define gx_device_psdf_common\ - gx_device_vector_common;\ - psdf_version version;\ - bool binary_ok; /* derived from ASCII85EncodePages */\ - psdf_distiller_params params -typedef struct gx_device_psdf_s { - gx_device_psdf_common; -} gx_device_psdf; - -#define psdf_initial_values(version, ascii)\ - vector_initial_values,\ - version,\ - !(ascii),\ - { psdf_general_param_defaults(ascii),\ - psdf_color_image_param_defaults,\ - psdf_gray_image_param_defaults,\ - psdf_mono_image_param_defaults,\ - psdf_font_param_defaults\ - } - -/* st_device_psdf is never instantiated per se, but we still need to */ -/* extern its descriptor for the sake of subclasses. */ -extern_st(st_device_psdf); -#define public_st_device_psdf() /* in gdevpsdf.c */\ - gs_public_st_suffix_add0_final(st_device_psdf, gx_device_psdf,\ - "gx_device_psdf", device_psdf_enum_ptrs,\ - device_psdf_reloc_ptrs, gx_device_finalize, st_device_vector) -#define st_device_psdf_max_ptrs (st_device_vector_max_ptrs) - -/* Get/put parameters. */ -dev_proc_get_params(gdev_psdf_get_params); -dev_proc_put_params(gdev_psdf_put_params); - -/* Put a Boolean or integer parameter. */ -int psdf_put_bool_param(P4(gs_param_list * plist, gs_param_name param_name, - bool * pval, int ecode)); -int psdf_put_int_param(P4(gs_param_list * plist, gs_param_name param_name, - int *pval, int ecode)); - -/* ---------------- Vector implementation procedures ---------------- */ - - /* Imager state */ -int psdf_setlinewidth(P2(gx_device_vector * vdev, floatp width)); -int psdf_setlinecap(P2(gx_device_vector * vdev, gs_line_cap cap)); -int psdf_setlinejoin(P2(gx_device_vector * vdev, gs_line_join join)); -int psdf_setmiterlimit(P2(gx_device_vector * vdev, floatp limit)); -int psdf_setdash(P4(gx_device_vector * vdev, const float *pattern, - uint count, floatp offset)); -int psdf_setflat(P2(gx_device_vector * vdev, floatp flatness)); -int psdf_setlogop(P3(gx_device_vector * vdev, gs_logical_operation_t lop, - gs_logical_operation_t diff)); - - /* Other state */ -int psdf_setfillcolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc)); -int psdf_setstrokecolor(P2(gx_device_vector * vdev, const gx_drawing_color * pdc)); - - /* Paths */ -#define psdf_dopath gdev_vector_dopath -int psdf_dorect(P6(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, - fixed y1, gx_path_type_t type)); -int psdf_beginpath(P2(gx_device_vector * vdev, gx_path_type_t type)); -int psdf_moveto(P7(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, bool first, gx_path_type_t type)); -int psdf_lineto(P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, gx_path_type_t type)); -int psdf_curveto(P10(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x1, floatp y1, floatp x2, - floatp y2, floatp x3, floatp y3, gx_path_type_t type)); -int psdf_closepath(P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x_start, floatp y_start, gx_path_type_t type)); - -/* ---------------- Binary (image) data procedures ---------------- */ - -/* Define the structure for writing binary data. */ -typedef struct psdf_binary_writer_s { - stream *strm; - gx_device_psdf *dev; -} psdf_binary_writer; - -/* Begin writing binary data. */ -int psdf_begin_binary(P2(gx_device_psdf * pdev, psdf_binary_writer * pbw)); - -/* Add an encoding filter. The client must have allocated the stream state, */ -/* if any, using pdev->v_memory. */ -int psdf_encode_binary(P3(psdf_binary_writer * pbw, - const stream_template * template, stream_state * ss)); - -/* Add a 2-D CCITTFax encoding filter. */ -int psdf_CFE_binary(P4(psdf_binary_writer * pbw, int w, int h, bool invert)); - -/* Set up compression and downsampling filters for an image. */ -/* Note that this may modify the image parameters. */ -/* If pctm is NULL, downsampling is not used. */ -/* pis only provides UCR and BG information for CMYK => RGB conversion. */ -int psdf_setup_image_filters(P5(gx_device_psdf * pdev, psdf_binary_writer * pbw, - gs_image_t * pim, const gs_matrix * pctm, - const gs_imager_state * pis)); - -/* Finish writing binary data. */ -int psdf_end_binary(P1(psdf_binary_writer * pbw)); - -/* ------ Symbolic data printing ------ */ - -/* Print a PostScript string in the most efficient form. */ -#define print_binary_ok 1 -#define print_ASCII85_ok 2 -void psdf_write_string(P4(stream * s, const byte * str, uint size, - int print_ok)); - -/* - * Create a stream that just keeps track of how much has been written - * to it. We use this for measuring data that will be stored rather - * than written to an actual stream. This too should probably migrate - * to stream.c.... - */ -int psdf_alloc_position_stream(P2(stream ** ps, gs_memory_t * mem)); - -/* - * Create/release a parameter list for printing (non-default) filter - * parameters. This should probably migrate to a lower level.... - */ -typedef struct param_printer_params_s { - const char *prefix; /* before entire object, if any params */ - const char *suffix; /* after entire object, if any params */ - const char *item_prefix; /* before each param */ - const char *item_suffix; /* after each param */ -} param_printer_params_t; - -#define param_printer_params_default_values 0, 0, 0, "\n" -extern const param_printer_params_t param_printer_params_default; -int psdf_alloc_param_printer(P5(gs_param_list ** pplist, - const param_printer_params_t * ppp, stream * s, - int print_ok, gs_memory_t * mem)); -void psdf_free_param_printer(P1(gs_param_list * plist)); - -/* Write out a Type 1 font definition. */ -#ifndef gs_font_type1_DEFINED -# define gs_font_type1_DEFINED -typedef struct gs_font_type1_s gs_font_type1; - -#endif -int psdf_embed_type1_font(P2(stream * s, gs_font_type1 * pfont)); - -/* ---------------- Other procedures ---------------- */ - -/* Set the fill or stroke color. rgs is "rg" or "RG". */ -int psdf_set_color(P3(gx_device_vector * vdev, const gx_drawing_color * pdc, - const char *rgs)); - -#endif /* gdevpsdf_INCLUDED */ diff --git a/pstoraster/gdevpsdi.c b/pstoraster/gdevpsdi.c deleted file mode 100644 index 3fb662c6a5..0000000000 --- a/pstoraster/gdevpsdi.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - Copyright 1993-2001 by Easy Software Products. - Copyright 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsdi.c,v 1.4 2001/01/22 15:03:55 mike Exp $ */ -/* Image compression for PostScript and PDF writers */ -#include "math_.h" -#include "gx.h" -#include "gserrors.h" -#include "gscspace.h" -#include "gdevpsdf.h" -#include "gdevpsds.h" -#include "strimpl.h" -#include "scfx.h" -#include -#ifdef HAVE_LIBJPEG -#include "jpeglib.h" /* for sdct.h */ -#include "sdct.h" -#endif /* HAVE_LIBJPEG */ -#include "slzwx.h" -#include "spngpx.h" -#include "srlx.h" -#ifdef HAVE_LIBZ -#include "szlibx.h" -#endif /* HAVE_LIBZ */ - -/* ---------------- Image compression ---------------- */ - -/* Add a filter to expand or reduce the pixel width if needed. */ -/* At least one of bpc_in and bpc_out is 8; the other is 1, 2, 4, or 8. */ -private int -pixel_resize(psdf_binary_writer * pbw, int width, int num_components, - int bpc_in, int bpc_out) -{ - gs_memory_t *mem = pbw->dev->v_memory; - const stream_template *template; - stream_1248_state *st; - int code; - - if (bpc_out == bpc_in) - return 0; - if (bpc_in < 8) { - static const stream_template *const exts[5] = - { - 0, &s_1_8_template, &s_2_8_template, 0, &s_4_8_template - }; - - template = exts[bpc_in]; - } else { - static const stream_template *const rets[5] = - { - 0, &s_8_1_template, &s_8_2_template, 0, &s_8_4_template - }; - - template = rets[bpc_out]; - } - st = (stream_1248_state *) - s_alloc_state(mem, template->stype, "pixel_resize state"); - if (st == 0) - return_error(gs_error_VMerror); - code = psdf_encode_binary(pbw, template, (stream_state *) st); - if (code < 0) { - gs_free_object(mem, st, "pixel_resize state"); - return code; - } - s_1248_init(st, width, num_components); - return 0; -} - -/* Add the appropriate image compression filter, if any. */ -private int -setup_image_compression(psdf_binary_writer * pbw, const psdf_image_params * pdip, - const gs_image_t * pim) -{ - gx_device_psdf *pdev = pbw->dev; - const stream_template *template = pdip->filter_template; - stream_state *st; - - if (pdip->AutoFilter) { - /****** AutoFilter IS NYI ******/ - /* - * Even though this isn't obvious from the Adobe Tech Note, - * it appears that if UseFlateCompression is true, the default - * compressor for AutoFilter is FlateEncode, not LZWEncode. - */ -#ifdef HAVE_LIBZ - template = - (pdev->params.UseFlateCompression && - pdev->version >= psdf_version_ll3 ? - &s_zlibE_template : &s_LZWE_template); -#else - template = &s_LZWE_template; -#endif /* HAVE_LIBZ */ - } - if (!pdip->Encode || template == 0) /* no compression */ - return 0; -#ifdef HAVE_LIBJPEG - /* Only use DCTE for 8-bit data. */ - if (template == &s_DCTE_template && - !(pdip->Downsample ? - pdip->Depth == 8 || - (pdip->Depth == -1 && pim->BitsPerComponent == 8) : - pim->BitsPerComponent == 8) - ) { - /* Use LZW instead. */ - template = &s_LZWE_template; - } -#endif /* HAVE_LIBJPEG */ - st = s_alloc_state(pdev->v_memory, template->stype, - "setup_image_compression"); - if (st == 0) - return_error(gs_error_VMerror); - if (template->set_defaults) - (*template->set_defaults) (st); - if (template == &s_CFE_template) { - stream_CFE_state *const ss = (stream_CFE_state *) st; - - if (pdip->Dict != 0 && pdip->Dict->template == &s_CFE_template) { - stream_state common; - - common = *st; /* save generic info */ - *ss = *(const stream_CFE_state *)pdip->Dict; - *st = common; - } else { - ss->K = -1; - ss->BlackIs1 = true; - } - ss->Columns = pim->Width; - ss->Rows = (ss->EndOfBlock ? 0 : pim->Height); -#ifdef HAVE_LIBZ - } else if (template == &s_LZWE_template || - template == &s_zlibE_template) { -#else - } else if (template == &s_LZWE_template) { -#endif /* HAVE_LIBZ */ - /* Add a PNGPredictor filter. */ - int code = psdf_encode_binary(pbw, template, st); - - if (code < 0) { - gs_free_object(pdev->v_memory, st, "setup_image_compression"); - return code; - } - template = &s_PNGPE_template; - st = s_alloc_state(pdev->v_memory, template->stype, - "setup_image_compression"); - if (st == 0) - return_error(gs_error_VMerror); - if (template->set_defaults) - (*template->set_defaults) (st); - { - stream_PNGP_state *const ss = (stream_PNGP_state *) st; - - ss->Colors = gs_color_space_num_components(pim->ColorSpace); - ss->Columns = pim->Width; - } -#ifdef HAVE_LIBJPEG - } else if (template == &s_DCTE_template) { - /****** ADD PARAMETERS FROM pdip->Dict ******/ -#endif /* HAVE_LIBJPEG */ - } { - int code = psdf_encode_binary(pbw, template, st); - - if (code < 0) { - gs_free_object(pdev->v_memory, st, "setup_image_compression"); - return code; - } - } - return 0; -} - -/* Add downsampling, antialiasing, and compression filters. */ -/* Uses AntiAlias, Depth, DownsampleType, Resolution. */ -private int -setup_downsampling(psdf_binary_writer * pbw, const psdf_image_params * pdip, - gs_image_t * pim, floatp resolution) -{ - gx_device_psdf *pdev = pbw->dev; - const stream_template *template = - (pdip->DownsampleType == ds_Average ? - &s_Average_template : &s_Subsample_template); - int factor = (int)(resolution / pdip->Resolution); - int orig_bpc = pim->BitsPerComponent; - int orig_width = pim->Width; - int orig_height = pim->Height; - stream_state *st; - int code; - - if (factor <= 1 || pim->Width < factor || pim->Height < factor) - return setup_image_compression(pbw, pdip, pim); /* no downsampling */ - st = s_alloc_state(pdev->v_memory, template->stype, - "setup_downsampling"); - if (st == 0) - return_error(gs_error_VMerror); - if (template->set_defaults) - (*template->set_defaults) (st); - { - stream_Downsample_state *const ss = (stream_Downsample_state *) st; - - ss->Colors = gs_color_space_num_components(pim->ColorSpace); - ss->Columns = pim->Width; - ss->XFactor = ss->YFactor = factor; - ss->AntiAlias = pdip->AntiAlias; - if (template->init) - (*template->init) (st); - pim->Width /= factor; - pim->Height /= factor; - pim->BitsPerComponent = pdip->Depth; - gs_matrix_scale(&pim->ImageMatrix, (double)pim->Width / orig_width, - (double)pim->Height / orig_height, - &pim->ImageMatrix); - /****** NO ANTI-ALIASING YET ******/ - if ((code = setup_image_compression(pbw, pdip, pim)) < 0 || - (code = pixel_resize(pbw, pim->Width, ss->Colors, - 8, pdip->Depth)) < 0 || - (code = psdf_encode_binary(pbw, template, st)) < 0 || - (code = pixel_resize(pbw, orig_width, ss->Colors, - orig_bpc, 8)) < 0 - ) { - gs_free_object(pdev->v_memory, st, "setup_image_compression"); - return code; - } - } - return 0; -} - -/* Set up compression and downsampling filters for an image. */ -/* Note that this may modify the image parameters. */ -int -psdf_setup_image_filters(gx_device_psdf * pdev, psdf_binary_writer * pbw, - gs_image_t * pim, const gs_matrix * pctm, - const gs_imager_state * pis) -{ /* - * The following algorithms are per Adobe Tech Note # 5151, - * "Acrobat Distiller Parameters", revised 16 September 1996 - * for Acrobat(TM) Distiller(TM) 3.0. - * - * The control structure is a little tricky, because filter - * pipelines must be constructed back-to-front. - */ - int code = 0; - psdf_image_params params; - - if (pim->ImageMask) { - params = pdev->params.MonoImage; - params.Depth = 1; - } else { - int ncomp = gs_color_space_num_components(pim->ColorSpace); - int bpc = pim->BitsPerComponent; - - /* - * We can compute the image resolution by: - * W / (W * ImageMatrix^-1 * CTM / HWResolution). - * We can replace W by 1 to simplify the computation. - */ - double resolution; - - if (pctm == 0) - resolution = -1; - else { - gs_point pt; - - /* We could do both X and Y, but why bother? */ - gs_distance_transform_inverse(1.0, 0.0, &pim->ImageMatrix, &pt); - gs_distance_transform(pt.x, pt.y, pctm, &pt); - resolution = 1.0 / hypot(pt.x / pdev->HWResolution[0], - pt.y / pdev->HWResolution[1]); - } - if (ncomp == 1) { - /* Monochrome or gray */ - if (bpc == 1) - params = pdev->params.MonoImage; - else - params = pdev->params.GrayImage; - if (params.Depth == -1) - params.Depth = bpc; - /* Check for downsampling. */ - if (params.Downsample && params.Resolution <= resolution / 2) { - /* Use the downsampled depth, not the original data depth. */ - if (params.Depth == 1) { - params.Filter = pdev->params.MonoImage.Filter; - params.filter_template = pdev->params.MonoImage.filter_template; - params.Dict = pdev->params.MonoImage.Dict; - } else { - params.Filter = pdev->params.GrayImage.Filter; - params.filter_template = pdev->params.GrayImage.filter_template; - params.Dict = pdev->params.GrayImage.Dict; - } - code = setup_downsampling(pbw, ¶ms, pim, resolution); - } else { - code = setup_image_compression(pbw, ¶ms, pim); - } - } else { - /* Color */ - bool cmyk_to_rgb = - pdev->params.ConvertCMYKImagesToRGB && - pis != 0 && - gs_color_space_get_index(pim->ColorSpace) == - gs_color_space_index_DeviceCMYK; - - if (cmyk_to_rgb) - pim->ColorSpace = gs_cspace_DeviceRGB(pis); - params = pdev->params.ColorImage; - if (params.Depth == -1) - params.Depth = (cmyk_to_rgb ? 8 : bpc); - if (params.Downsample && params.Resolution <= resolution / 2) { - code = setup_downsampling(pbw, ¶ms, pim, resolution); - } else { - code = setup_image_compression(pbw, ¶ms, pim); - } - if (cmyk_to_rgb) { - gs_memory_t *mem = pdev->v_memory; - stream_C2R_state *ss = (stream_C2R_state *) - s_alloc_state(mem, s_C2R_template.stype, "C2R state"); - int code = pixel_resize(pbw, pim->Width, 3, 8, bpc); - - if (code < 0 || - (code = psdf_encode_binary(pbw, &s_C2R_template, - (stream_state *) ss)) < 0 || - (code = pixel_resize(pbw, pim->Width, 4, bpc, 8)) < 0 - ) - return code; - s_C2R_init(ss, pis); - } - } - } - return code; -} diff --git a/pstoraster/gdevpsdp.c b/pstoraster/gdevpsdp.c deleted file mode 100644 index 5c8573d9ef..0000000000 --- a/pstoraster/gdevpsdp.c +++ /dev/null @@ -1,705 +0,0 @@ -/* - Copyright 1993-2001 by Easy Software Products. - Copyright 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsdp.c,v 1.4 2001/01/22 15:03:55 mike Exp $ */ -/* (Distiller) parameter handling for PostScript and PDF writers */ -#include "string_.h" -#include "gx.h" -#include "gserrors.h" -#include "gxdevice.h" -#include "gdevpsdf.h" -#include "gdevpstr.h" -#include "strimpl.h" /* for short-sighted compilers */ -#include "scfx.h" -#include -#ifdef HAVE_LIBJPEG -#include "jpeglib.h" /* for sdct.h */ -#include "sdct.h" -#endif /* HAVE_LIBJPEG */ -#include "slzwx.h" -#include "srlx.h" -#ifdef HAVE_LIBZ -#include "szlibx.h" -#endif /* HAVE_LIBZ */ - -/* ---------------- Get/put Distiller parameters ---------------- */ - -/* - * This code handles all the Distiller parameters except the *ACSDict and - * *ImageDict parameter dictionaries. (It doesn't cause any of the - * parameters actually to have any effect.) - */ - -typedef struct psdf_image_filter_name_s { - const char *pname; - const stream_template *template; - psdf_version min_version; -} psdf_image_filter_name; -typedef struct psdf_image_param_names_s { - const char *ACSDict; /* not used for mono */ - const char *AntiAlias; - const char *AutoFilter; /* not used for mono */ - const char *Depth; - const char *Dict; - const char *Downsample; - const char *DownsampleType; - const char *Encode; - const char *Filter; - const char *Resolution; -} psdf_image_param_names; -private const psdf_image_param_names Color_names = -{ - "ColorACSImageDict", "AntiAliasColorImages", "AutoFilterColorImages", - "ColorImageDepth", "ColorImageDict", - "DownsampleColorImages", "ColorImageDownsampleType", "EncodeColorImages", - "ColorImageFilter", "ColorImageResolution" -}; -private const psdf_image_filter_name Poly_filters[] = -{ -#ifdef HAVE_LIBJPEG - {"DCTEncode", &s_DCTE_template}, -#endif /* HAVE_LIBJPEG */ -#ifdef HAVE_LIBZ - {"FlateEncode", &s_zlibE_template, psdf_version_ll3}, -#endif /* HAVE_LIBZ */ - {"LZWEncode", &s_LZWE_template}, - {0, 0} -}; -private const psdf_image_param_names Gray_names = -{ - "GrayACSImageDict", "AntiAliasGrayImages", "AutoFilterGrayImages", - "GrayImageDepth", "GrayImageDict", - "DownsampleGrayImages", "GrayImageDownsampleType", "EncodeGrayImages", - "GrayImageFilter", "GrayImageResolution" -}; -private const psdf_image_param_names Mono_names = -{ - 0, "AntiAliasMonoImages", 0, - "MonoImageDepth", "MonoImageDict", - "DownsampleMonoImages", "MonoImageDownsampleType", "EncodeMonoImages", - "MonoImageFilter", "MonoImageResolution" -}; -private const psdf_image_filter_name Mono_filters[] = -{ - {"CCITTFaxEncode", &s_CFE_template}, -#ifdef HAVE_LIBZ - {"FlateEncode", &s_zlibE_template, psdf_version_ll3}, -#endif /* HAVE_LIBZ */ - {"LZWEncode", &s_LZWE_template}, - {"RunLengthEncode", &s_RLE_template}, - {0, 0} -}; -private const char *const AutoRotatePages_names[] = -{ - "None", "All", "PageByPage", 0 -}; -private const char *const ColorConversionStrategy_names[] = -{ - "LeaveColorUnchanged", "UseDeviceDependentColor", - "UseDeviceIndependentColor", 0 -}; -private const char *const DownsampleType_names[] = -{ - "Average", "Subsample", 0 -}; -private const char *const TransferFunctionInfo_names[] = -{ - "Preserve", "Apply", "Remove", 0 -}; -private const char *const UCRandBGInfo_names[] = -{ - "Preserve", "Remove", 0 -}; - -/* -------- Get parameters -------- */ - -#ifdef HAVE_LIBJPEG -extern stream_state_proc_get_params(s_DCTE_get_params, stream_DCT_state); -#endif /* HAVE_LIBJPEG */ -extern stream_state_proc_get_params(s_CF_get_params, stream_CF_state); -typedef stream_state_proc_get_params((*ss_get_params_t), stream_state); - -private int -psdf_CF_get_params(gs_param_list * plist, const stream_state * ss, bool all) -{ - return (ss == 0 ? 0 : - s_CF_get_params(plist, (const stream_CF_state *)ss, all)); -} -#ifdef HAVE_LIBJPEG -private int -psdf_DCT_get_params(gs_param_list * plist, const stream_state * ss, bool all) -{ - int code = (ss == 0 ? 0 : - s_DCTE_get_params(plist, (const stream_DCT_state *)ss, all)); - /* - * Add dummy Columns, Rows, and Colors parameters so that put_params - * won't complain. - */ - int dummy_size = 8, dummy_colors = 3; - - if (code < 0 || - (code = param_write_int(plist, "Columns", &dummy_size)) < 0 || - (code = param_write_int(plist, "Rows", &dummy_size)) < 0 || - (code = param_write_int(plist, "Colors", &dummy_colors)) < 0 - ) - return code; - return 0; -} -#endif /* HAVE_LIBJPEG */ - -/* - * Get an image Dict parameter. Note that we return a default (usually - * empty) dictionary if the parameter has never been set. - */ -private int -psdf_get_image_dict_param(gs_param_list * plist, const gs_param_name pname, - stream_state * ss, ss_get_params_t get_params) -{ - gs_param_dict dict; - int code; - - if (pname == 0) - return 0; - dict.size = 12; /* enough for all param dicts we know about */ - if ((code = param_begin_write_dict(plist, pname, &dict, false)) < 0) - return code; - code = (*get_params)(dict.list, ss, false); - param_end_write_dict(plist, pname, &dict); - return code; -} - -/* Get a set of image-related parameters. */ -private int -psdf_get_image_params(gs_param_list * plist, - const psdf_image_param_names * pnames, psdf_image_params * params) -{ - int code; - gs_param_string dsts, fs; - - param_string_from_string(dsts, - DownsampleType_names[params->DownsampleType]); - if ( -#ifdef HAVE_LIBJPEG - (code = psdf_get_image_dict_param(plist, pnames->ACSDict, - params->ACSDict, - psdf_DCT_get_params)) < 0 || -#endif /* HAVE_LIBJPEG */ - (code = param_write_bool(plist, pnames->AntiAlias, - ¶ms->AntiAlias)) < 0 || - (pnames->AutoFilter != 0 && - (code = param_write_bool(plist, pnames->AutoFilter, - ¶ms->AutoFilter)) < 0) || - (code = param_write_int(plist, pnames->Depth, - ¶ms->Depth)) < 0 || - (code = psdf_get_image_dict_param(plist, pnames->Dict, - params->Dict, -#ifdef HAVE_LIBJPEG - (params->Dict == 0 || - params->Dict->template == - &s_CFE_template ? - psdf_CF_get_params : - psdf_DCT_get_params))) < 0 || -#else - psdf_CF_get_params)) < 0 || -#endif /* HAVE_LIBJPEG */ - (code = param_write_bool(plist, pnames->Downsample, - ¶ms->Downsample)) < 0 || - (code = param_write_name(plist, pnames->DownsampleType, - &dsts)) < 0 || - (code = param_write_bool(plist, pnames->Encode, - ¶ms->Encode)) < 0 || - (code = (params->Filter == 0 ? 0 : - (param_string_from_string(fs, params->Filter), - param_write_name(plist, pnames->Filter, &fs)))) < 0 || - (code = param_write_int(plist, pnames->Resolution, - ¶ms->Resolution)) < 0 - ) - DO_NOTHING; - return code; -} - -/* Get parameters. */ -int -gdev_psdf_get_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_psdf *pdev = (gx_device_psdf *) dev; - int code = gdev_vector_get_params(dev, plist); - gs_param_string arps, ccss, tfis, ucrbgis; - - if (code < 0) - return code; - param_string_from_string(arps, - AutoRotatePages_names[(int)pdev->params.AutoRotatePages]); - param_string_from_string(ccss, - ColorConversionStrategy_names[(int)pdev->params.ColorConversionStrategy]); - param_string_from_string(tfis, - TransferFunctionInfo_names[(int)pdev->params.TransferFunctionInfo]); - param_string_from_string(ucrbgis, - UCRandBGInfo_names[(int)pdev->params.UCRandBGInfo]); - if ( - /* General parameters */ - - (code = param_write_bool(plist, "ASCII85EncodePages", - &pdev->params.ASCII85EncodePages)) < 0 || - (code = param_write_name(plist, "AutoRotatePages", - &arps)) < 0 || - (code = param_write_bool(plist, "CompressPages", - &pdev->params.CompressPages)) < 0 || - (code = param_write_long(plist, "ImageMemory", - &pdev->params.ImageMemory)) < 0 || - (code = param_write_bool(plist, "LZWEncodePages", - &pdev->params.LZWEncodePages)) < 0 || - (code = param_write_bool(plist, "PreserveHalftoneInfo", - &pdev->params.PreserveHalftoneInfo)) < 0 || - (code = param_write_bool(plist, "PreserveOPIComments", - &pdev->params.PreserveOPIComments)) < 0 || - (code = param_write_bool(plist, "PreserveOverprintSettings", - &pdev->params.PreserveOverprintSettings)) < 0 || - (code = param_write_name(plist, "TransferFunctionInfo", &tfis)) < 0 || - (code = param_write_name(plist, "UCRandBGInfo", &ucrbgis)) < 0 || - (code = param_write_bool(plist, "UseFlateCompression", - &pdev->params.UseFlateCompression)) < 0 || - - /* Color sampled image parameters */ - - (code = psdf_get_image_params(plist, &Color_names, &pdev->params.ColorImage)) < 0 || - (code = param_write_name(plist, "ColorConversionStrategy", - &ccss)) < 0 || - (code = param_write_bool(plist, "ConvertCMYKImagesToRGB", - &pdev->params.ConvertCMYKImagesToRGB)) < 0 || - (code = param_write_bool(plist, "ConvertImagesToIndexed", - &pdev->params.ConvertImagesToIndexed)) < 0 || - - /* Gray sampled image parameters */ - - (code = psdf_get_image_params(plist, &Gray_names, &pdev->params.GrayImage)) < 0 || - - /* Mono sampled image parameters */ - - (code = psdf_get_image_params(plist, &Mono_names, &pdev->params.MonoImage)) < 0 || - - /* Font embedding parameters */ - - (code = param_write_name_array(plist, "AlwaysEmbed", &pdev->params.AlwaysEmbed)) < 0 || - (code = param_write_name_array(plist, "NeverEmbed", &pdev->params.NeverEmbed)) < 0 || - (code = param_write_bool(plist, "EmbedAllFonts", &pdev->params.EmbedAllFonts)) < 0 || - (code = param_write_bool(plist, "SubsetFonts", &pdev->params.SubsetFonts)) < 0 || - (code = param_write_int(plist, "MaxSubsetPct", &pdev->params.MaxSubsetPct)) < 0 - ); - return code; -} - -/* -------- Put parameters -------- */ - -#ifdef HAVE_LIBJPEG -extern stream_state_proc_put_params(s_DCTE_put_params, stream_DCT_state); -#endif /* HAVE_LIBJPEG */ -extern stream_state_proc_put_params(s_CF_put_params, stream_CF_state); -typedef stream_state_proc_put_params((*ss_put_params_t), stream_state); - -private int -psdf_CF_put_params(gs_param_list * plist, stream_state * st) -{ - stream_CFE_state *const ss = (stream_CFE_state *) st; - - (*s_CFE_template.set_defaults) (st); - ss->K = -1; - ss->BlackIs1 = true; - return s_CF_put_params(plist, (stream_CF_state *) ss); -} -#ifdef HAVE_LIBJPEG -private int -psdf_DCT_put_params(gs_param_list * plist, stream_state * ss) -{ - return s_DCTE_put_params(plist, (stream_DCT_state *) ss); -} -#endif /* HAVE_LIBJPEG */ - -/* Compare a C string and a gs_param_string. */ -bool -psdf_key_eq(const gs_param_string * pcs, const char *str) -{ - return (strlen(str) == pcs->size && - !strncmp(str, (const char *)pcs->data, pcs->size)); -} - -/* Put an enumerated value. */ -private int -psdf_put_enum_param(gs_param_list * plist, gs_param_name param_name, - int *pvalue, const char *const pnames[], int ecode) -{ - gs_param_string ens; - int code = param_read_name(plist, param_name, &ens); - - switch (code) { - case 1: - return ecode; - case 0: - { - int i; - - for (i = 0; pnames[i] != 0; ++i) - if (psdf_key_eq(&ens, pnames[i])) { - *pvalue = i; - return 0; - } - } - code = gs_error_rangecheck; - default: - ecode = code; - param_signal_error(plist, param_name, code); - } - return code; -} - -/* Put a Boolean or integer parameter. */ -int -psdf_put_bool_param(gs_param_list * plist, gs_param_name param_name, - bool * pval, int ecode) -{ - int code; - - switch (code = param_read_bool(plist, param_name, pval)) { - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 0: - case 1: - break; - } - return ecode; -} -int -psdf_put_int_param(gs_param_list * plist, gs_param_name param_name, - int *pval, int ecode) -{ - int code; - - switch (code = param_read_int(plist, param_name, pval)) { - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 0: - case 1: - break; - } - return ecode; -} - -/* Put [~](Always|Never)Embed parameters. */ -private int -psdf_put_embed_param(gs_param_list * plist, gs_param_name notpname, - gs_param_string_array * psa, int ecode) -{ - gs_param_name pname = notpname + 1; - int code; - gs_param_string_array nsa; - -/***** Storage management is incomplete ******/ -/***** Doesn't do incremental add/delete ******/ - switch (code = param_read_name_array(plist, pname, psa)) { - default: - ecode = code; - param_signal_error(plist, pname, ecode); - case 0: - case 1: - break; - } - switch (code = param_read_name_array(plist, notpname, &nsa)) { - default: - ecode = code; - param_signal_error(plist, notpname, ecode); - case 0: - case 1: - break; - } - return ecode; -} - -/* Put an image Dict parameter. */ -private int -psdf_put_image_dict_param(gs_param_list * plist, const gs_param_name pname, - stream_state ** pss, const stream_template * template, - ss_put_params_t put_params, gs_memory_t * mem) -{ - gs_param_dict dict; - stream_state *ss = *pss; - int code; - - switch (code = param_begin_read_dict(plist, pname, &dict, false)) { - default: - param_signal_error(plist, pname, code); - return code; - case 1: - ss = 0; - break; - case 0:{ - /****** - ****** THIS CAUSES A SEGV FOR DCT FILTERS, BECAUSE - ****** THEY DON'T INTIALIZE PROPERLY. - ******/ -#ifdef HAVE_LIBJPEG - if (template != &s_DCTE_template) -#endif /* HAVE_LIBJPEG */ - { - stream_state *ss_new = - s_alloc_state(mem, template->stype, pname); - - if (ss_new == 0) - return_error(gs_error_VMerror); - ss_new->template = template; - if (template->set_defaults) - (*template->set_defaults)(ss_new); - code = (*put_params)(dict.list, ss_new); - if (code < 0) { - param_signal_error(plist, pname, code); - /* Make sure we free the new state. */ - *pss = ss_new; - } else - ss = ss_new; - } - } - param_end_read_dict(plist, pname, &dict); - } - if (*pss != ss) { - if (ss) { - /****** FREE SUBSIDIARY OBJECTS -- HOW? ******/ - gs_free_object(mem, *pss, pname); - } - *pss = ss; - } - return code; -} - -/* Put a set of image-related parameters. */ -private int -psdf_put_image_params(const gx_device_psdf * pdev, gs_param_list * plist, - const psdf_image_param_names * pnames, const psdf_image_filter_name * pifn, - psdf_image_params * params, int ecode) -{ - gs_param_string fs; - - /* - * Since this procedure can be called before the device is open, - * we must use pdev->memory rather than pdev->v_memory. - */ - gs_memory_t *mem = pdev->memory; - gs_param_name pname; - int dsti = params->DownsampleType; - int code; - -#ifdef HAVE_LIBJPEG - if ((pname = pnames->ACSDict) != 0) { - code = psdf_put_image_dict_param(plist, pname, ¶ms->ACSDict, - &s_DCTE_template, - psdf_DCT_put_params, mem); - if (code < 0) - ecode = code; - } -#endif /* HAVE_LIBJPEG */ - ecode = psdf_put_bool_param(plist, pnames->AntiAlias, - ¶ms->AntiAlias, ecode); - if (pnames->AutoFilter) - ecode = psdf_put_bool_param(plist, pnames->AutoFilter, - ¶ms->AutoFilter, ecode); - ecode = psdf_put_int_param(plist, pnames->Depth, - ¶ms->Depth, ecode); - if ((pname = pnames->Dict) != 0) { - const stream_template *template; - ss_put_params_t put_params; - - /* Hack to determine what kind of a Dict we want: */ - if (pnames->Dict[0] == 'M') - template = &s_CFE_template, - put_params = psdf_CF_put_params; -#ifdef HAVE_LIBJPEG - else - template = &s_DCTE_template, - put_params = psdf_DCT_put_params; -#endif /* HAVE_LIBJPEG */ - code = psdf_put_image_dict_param(plist, pname, ¶ms->Dict, - template, put_params, mem); - if (code < 0) - ecode = code; - } - ecode = psdf_put_bool_param(plist, pnames->Downsample, - ¶ms->Downsample, ecode); - if ((ecode = psdf_put_enum_param(plist, pnames->DownsampleType, - &dsti, DownsampleType_names, - ecode)) >= 0 - ) - params->DownsampleType = (enum psdf_downsample_type)dsti; - ecode = psdf_put_bool_param(plist, pnames->Encode, - ¶ms->Encode, ecode); - switch (code = param_read_string(plist, pnames->Filter, &fs)) { - case 0: - { - const psdf_image_filter_name *pn = pifn; - - while (pn->pname != 0 && !psdf_key_eq(&fs, pn->pname)) - pn++; - if (pn->pname == 0 || pn->min_version > pdev->version) { - ecode = gs_error_rangecheck; - goto ipe; - } - params->Filter = pn->pname; - params->filter_template = pn->template; - break; - } - default: - ecode = code; - ipe:param_signal_error(plist, pnames->Filter, ecode); - case 1: - break; - } - ecode = psdf_put_int_param(plist, pnames->Resolution, - ¶ms->Resolution, ecode); - if (ecode >= 0) { /* Force parameters to acceptable values. */ - if (params->Resolution < 1) - params->Resolution = 1; - switch (params->Depth) { - default: - params->Depth = -1; - case 1: - case 2: - case 4: - case 8: - case -1: - break; - } - } - return ecode; -} - -/* Put parameters. */ -int -gdev_psdf_put_params(gx_device * dev, gs_param_list * plist) -{ - gx_device_psdf *pdev = (gx_device_psdf *) dev; - int ecode = 0; - int code; - gs_param_name param_name; - psdf_distiller_params params; - - /* General parameters. */ - - params = pdev->params; - - ecode = psdf_put_bool_param(plist, "ASCII85EncodePages", - ¶ms.ASCII85EncodePages, ecode); - { - int arpi = params.AutoRotatePages; - - ecode = psdf_put_enum_param(plist, "AutoRotatePages", &arpi, - AutoRotatePages_names, ecode); - params.AutoRotatePages = (enum psdf_auto_rotate_pages)arpi; - } - ecode = psdf_put_bool_param(plist, "CompressPages", - ¶ms.CompressPages, ecode); - switch (code = param_read_long(plist, (param_name = "ImageMemory"), ¶ms.ImageMemory)) { - default: - ecode = code; - param_signal_error(plist, param_name, ecode); - case 0: - case 1: - break; - } - ecode = psdf_put_bool_param(plist, "LZWEncodePages", - ¶ms.LZWEncodePages, ecode); - ecode = psdf_put_bool_param(plist, "PreserveHalftoneInfo", - ¶ms.PreserveHalftoneInfo, ecode); - ecode = psdf_put_bool_param(plist, "PreserveOPIComments", - ¶ms.PreserveOPIComments, ecode); - ecode = psdf_put_bool_param(plist, "PreserveOverprintSettings", - ¶ms.PreserveOverprintSettings, ecode); - { - int tfii = params.TransferFunctionInfo; - - ecode = psdf_put_enum_param(plist, "TransferFunctionInfo", &tfii, - TransferFunctionInfo_names, ecode); - params.TransferFunctionInfo = (enum psdf_transfer_function_info)tfii; - } - { - int ucrbgi = params.UCRandBGInfo; - - ecode = psdf_put_enum_param(plist, "UCRandBGInfo", &ucrbgi, - UCRandBGInfo_names, ecode); - params.UCRandBGInfo = (enum psdf_ucr_and_bg_info)ucrbgi; - } -#ifdef HAVE_LIBZ - ecode = psdf_put_bool_param(plist, "UseFlateCompression", - ¶ms.UseFlateCompression, ecode); -#endif /* HAVE_LIBZ */ - - /* Color sampled image parameters */ - - ecode = psdf_put_image_params(pdev, plist, &Color_names, Poly_filters, - ¶ms.ColorImage, ecode); - { - int ccsi = params.ColorConversionStrategy; - - ecode = psdf_put_enum_param(plist, "ColorConversionStrategy", &ccsi, - ColorConversionStrategy_names, ecode); - params.ColorConversionStrategy = - (enum psdf_color_conversion_strategy)ccsi; - } - ecode = psdf_put_bool_param(plist, "ConvertCMYKImagesToRGB", - ¶ms.ConvertCMYKImagesToRGB, ecode); - ecode = psdf_put_bool_param(plist, "ConvertImagesToIndexed", - ¶ms.ConvertImagesToIndexed, ecode); - - /* Gray sampled image parameters */ - - ecode = psdf_put_image_params(pdev, plist, &Gray_names, Poly_filters, - ¶ms.GrayImage, ecode); - - /* Mono sampled image parameters */ - - ecode = psdf_put_image_params(pdev, plist, &Mono_names, Mono_filters, - ¶ms.MonoImage, ecode); - - /* Font embedding parameters */ - - ecode = psdf_put_embed_param(plist, "~AlwaysEmbed", - ¶ms.AlwaysEmbed, ecode); - ecode = psdf_put_embed_param(plist, "~NeverEmbed", - ¶ms.NeverEmbed, ecode); - ecode = psdf_put_bool_param(plist, "EmbedAllFonts", - ¶ms.EmbedAllFonts, ecode); - ecode = psdf_put_bool_param(plist, "SubsetFonts", - ¶ms.SubsetFonts, ecode); - ecode = psdf_put_int_param(plist, "MaxSubsetPct", - ¶ms.MaxSubsetPct, ecode); - - if (ecode < 0) - return ecode; - code = gdev_vector_put_params(dev, plist); - if (code < 0) - return code; - - pdev->params = params; /* OK to update now */ - return 0; -} diff --git a/pstoraster/gdevpsds.c b/pstoraster/gdevpsds.c deleted file mode 100644 index 33f9ba392f..0000000000 --- a/pstoraster/gdevpsds.c +++ /dev/null @@ -1,470 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsds.c,v 1.1 2000/03/08 23:14:25 mike Exp $ */ -/* Image processing streams for PostScript and PDF writers */ -#include "gx.h" -#include "memory_.h" -#include "gserrors.h" -#include "gxdcconv.h" -#include "gdevpsds.h" - -/* ---------------- Convert between 1/2/4 and 8 bits ---------------- */ -gs_private_st_simple(st_1248_state, stream_1248_state, "stream_1248_state"); - -/* Initialize the state. */ -private int -s_1_init(stream_state * st) -{ - stream_1248_state *const ss = (stream_1248_state *) st; - - ss->left = ss->samples_per_row; - ss->bits_per_sample = 1; - return 0; -} -private int -s_2_init(stream_state * st) -{ - stream_1248_state *const ss = (stream_1248_state *) st; - - ss->left = ss->samples_per_row; - ss->bits_per_sample = 2; - return 0; -} -private int -s_4_init(stream_state * st) -{ - stream_1248_state *const ss = (stream_1248_state *) st; - - ss->left = ss->samples_per_row; - ss->bits_per_sample = 4; - return 0; -} - -/* Process one buffer. */ -#define BEGIN_1248\ - stream_1248_state * const ss = (stream_1248_state *)st;\ - const byte *p = pr->ptr;\ - const byte *rlimit = pr->limit;\ - byte *q = pw->ptr;\ - byte *wlimit = pw->limit;\ - uint left = ss->left;\ - int status;\ - int n -#define END_1248\ - pr->ptr = p;\ - pw->ptr = q;\ - ss->left = left;\ - return status - -/* N-to-8 expansion */ -#define FOREACH_N_8(in, nout)\ - status = 0;\ - for ( ; p < rlimit; left -= n, q += n, ++p ) {\ - byte in = p[1];\ - n = min(left, nout);\ - if ( wlimit - q < n ) {\ - status = 1;\ - break;\ - }\ - switch ( n ) {\ - case 0: left = ss->samples_per_row; --p; continue; -#define END_FOREACH_N_8\ - }\ - } -private int -s_N_8_process(stream_state * st, stream_cursor_read * pr, - stream_cursor_write * pw, bool last) -{ - BEGIN_1248; - - switch (ss->bits_per_sample) { - - case 1:{ - FOREACH_N_8(in, 8) - case 8: - q[8] = (byte) - (in & 1); - case 7: - q[7] = (byte) - ((in >> 1) & 1); - case 6: - q[6] = (byte) - ((in >> 2) & 1); - case 5: - q[5] = (byte) - ((in >> 3) & 1); - case 4: - q[4] = (byte) - ((in >> 4) & 1); - case 3: - q[3] = (byte) - ((in >> 5) & 1); - case 2: - q[2] = (byte) - ((in >> 6) & 1); - case 1: - q[1] = (byte) - (in >> 7); - END_FOREACH_N_8; - } - break; - - case 2:{ - static const byte b2[4] = - {0x00, 0x55, 0xaa, 0xff}; - - FOREACH_N_8(in, 4) - case 4: - q[4] = b2[in & 3]; - case 3: - q[3] = b2[(in >> 2) & 3]; - case 2: - q[2] = b2[(in >> 4) & 3]; - case 1: - q[1] = b2[in >> 6]; - END_FOREACH_N_8; - } - break; - - case 4:{ - static const byte b4[16] = - { - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff - }; - - FOREACH_N_8(in, 2) - case 2: - q[2] = b4[in & 0xf]; - case 1: - q[1] = b4[in >> 4]; - END_FOREACH_N_8; - } - break; - - default: - return ERRC; - } - - END_1248; -} - -/* 8-to-N reduction */ -#define FOREACH_8_N(out, nin)\ - byte out;\ - status = 1;\ - for ( ; q < wlimit; left -= n, p += n, ++q ) {\ - n = min(left, nin);\ - if ( rlimit - p < n ) {\ - status = 0;\ - break;\ - }\ - out = 0;\ - switch ( n ) {\ - case 0: left = ss->samples_per_row; --q; continue; -#define END_FOREACH_8_N\ - q[1] = out;\ - }\ - } -private int -s_8_N_process(stream_state * st, stream_cursor_read * pr, - stream_cursor_write * pw, bool last) -{ - BEGIN_1248; - - switch (ss->bits_per_sample) { - - case 1:{ - FOREACH_8_N(out, 8) - case 8: - out = p[8] >> 7; - case 7: - out |= (p[7] >> 7) << 1; - case 6: - out |= (p[6] >> 7) << 2; - case 5: - out |= (p[5] >> 7) << 3; - case 4: - out |= (p[4] >> 7) << 4; - case 3: - out |= (p[3] >> 7) << 5; - case 2: - out |= (p[2] >> 7) << 6; - case 1: - out |= p[1] & 0x80; - END_FOREACH_8_N; - } - break; - - case 2:{ - FOREACH_8_N(out, 4) - case 4: - out |= p[4] >> 6; - case 3: - out |= (p[3] >> 6) << 2; - case 2: - out |= (p[2] >> 6) << 4; - case 1: - out |= p[1] & 0xc0; - END_FOREACH_8_N; - } - break; - - case 4:{ - FOREACH_8_N(out, 2) - case 2: - out |= p[2] >> 4; - case 1: - out |= p[1] & 0xf0; - END_FOREACH_8_N; - } - break; - - default: - return ERRC; - } - - END_1248; -} - -const stream_template s_1_8_template = -{ - &st_1248_state, s_1_init, s_N_8_process, 1, 8 -}; -const stream_template s_2_8_template = -{ - &st_1248_state, s_2_init, s_N_8_process, 1, 4 -}; -const stream_template s_4_8_template = -{ - &st_1248_state, s_4_init, s_N_8_process, 1, 2 -}; - -const stream_template s_8_1_template = -{ - &st_1248_state, s_1_init, s_8_N_process, 8, 1 -}; -const stream_template s_8_2_template = -{ - &st_1248_state, s_2_init, s_8_N_process, 4, 1 -}; -const stream_template s_8_4_template = -{ - &st_1248_state, s_4_init, s_8_N_process, 2, 1 -}; - -/* ---------------- CMYK => RGB conversion ---------------- */ - -private_st_C2R_state(); - -/* Process one buffer. */ -private int -s_C2R_process(stream_state * st, stream_cursor_read * pr, - stream_cursor_write * pw, bool last) -{ - stream_C2R_state *const ss = (stream_C2R_state *) st; - const byte *p = pr->ptr; - const byte *rlimit = pr->limit; - byte *q = pw->ptr; - byte *wlimit = pw->limit; - - for (; rlimit - p >= 4 && wlimit - q >= 3; p += 4, q += 3) { - byte bc = p[1], bm = p[2], by = p[3], bk = p[4]; - frac rgb[3]; - - color_cmyk_to_rgb(byte2frac(bc), byte2frac(bm), byte2frac(by), - byte2frac(bk), ss->pis, rgb); - q[1] = frac2byte(rgb[0]); - q[2] = frac2byte(rgb[1]); - q[3] = frac2byte(rgb[2]); - } - pr->ptr = p; - pw->ptr = q; - return (rlimit - p < 4 ? 0 : 1); -} - -const stream_template s_C2R_template = -{ - &st_C2R_state, 0 /*NULL */ , s_C2R_process, 4, 3 -}; - -/* ---------------- Downsampling ---------------- */ - -private void -s_Downsample_set_defaults(register stream_state * st) -{ - stream_Downsample_state *const ss = - (stream_Downsample_state *) st; - - s_Downsample_set_defaults_inline(ss); -} - -/* Subsample */ -/****** DOESN'T IMPLEMENT padY YET ******/ - -gs_private_st_simple(st_Subsample_state, stream_Subsample_state, - "stream_Subsample_state"); - -/* Initialize the state. */ -private int -s_Subsample_init(stream_state * st) -{ - stream_Subsample_state *const ss = (stream_Subsample_state *) st; - - ss->x = ss->y = 0; - return 0; -} - -/* Process one buffer. */ -private int -s_Subsample_process(stream_state * st, stream_cursor_read * pr, - stream_cursor_write * pw, bool last) -{ - stream_Subsample_state *const ss = (stream_Subsample_state *) st; - const byte *p = pr->ptr; - const byte *rlimit = pr->limit; - byte *q = pw->ptr; - byte *wlimit = pw->limit; - int spp = ss->Colors; - int width = ss->Columns; - int xf = ss->XFactor, yf = ss->YFactor; - int xf2 = xf / 2, yf2 = yf / 2; - int xlimit = (width / xf) * xf; - int xlast = (ss->padX && xlimit < width ? xlimit + (width % xf) / 2 : -1); - int x = ss->x, y = ss->y; - int status = 0; - - for (; rlimit - p >= spp; p += spp) { - if (y == yf2 && ((x % xf == xf2 && x < xlimit) || x == xlast)) { - if (wlimit - q < spp) { - status = 1; - break; - } - memcpy(q + 1, p + 1, spp); - q += spp; - } - if (++x == width) { - x = 0; - if (++y == yf) { - y = 0; - } - } - } - pr->ptr = p; - pw->ptr = q; - ss->x = x, ss->y = y; - return status; -} - -const stream_template s_Subsample_template = -{ - &st_Subsample_state, s_Subsample_init, s_Subsample_process, 4, 4, - 0 /* NULL */, s_Downsample_set_defaults -}; - -/* Average */ - -private_st_Average_state(); - -/* Initialize the state. */ -private int -s_Average_init(stream_state * st) -{ - stream_Average_state *const ss = (stream_Average_state *) st; - - ss->sum_size = - ss->Colors * ((ss->Columns + ss->XFactor - 1) / ss->XFactor); - ss->copy_size = ss->sum_size - - (ss->padX || (ss->Columns % ss->XFactor == 0) ? 0 : ss->Colors); - ss->sums = - (uint *)gs_alloc_byte_array(st->memory, ss->sum_size, - sizeof(uint), "Average sums"); - if (ss->sums == 0) - return ERRC; /****** WRONG ******/ - memset(ss->sums, 0, ss->sum_size * sizeof(uint)); - return s_Subsample_init(st); -} - -/* Release the state. */ -private void -s_Average_release(stream_state * st) -{ - stream_Average_state *const ss = (stream_Average_state *) st; - - gs_free_object(st->memory, ss->sums, "Average sums"); -} - -/* Process one buffer. */ -private int -s_Average_process(stream_state * st, stream_cursor_read * pr, - stream_cursor_write * pw, bool last) -{ - stream_Average_state *const ss = (stream_Average_state *) st; - const byte *p = pr->ptr; - const byte *rlimit = pr->limit; - byte *q = pw->ptr; - byte *wlimit = pw->limit; - int spp = ss->Colors; - int width = ss->Columns; - int xf = ss->XFactor, yf = ss->YFactor; - int x = ss->x, y = ss->y; - uint *sums = ss->sums; - int status = 0; - -top: - if (y == yf || (last && p >= rlimit && ss->padY && y != 0)) { - /* We're copying averaged values to the output. */ - int ncopy = min(ss->copy_size - x, wlimit - q); - - if (ncopy) { - int scale = xf * y; - - while (--ncopy >= 0) - *++q = (byte) (sums[x++] / scale); - } - if (x < ss->copy_size) { - status = 1; - goto out; - } - /* Done copying. */ - x = y = 0; - memset(sums, 0, ss->sum_size * sizeof(uint)); - } - while (rlimit - p >= spp) { - uint *bp = sums + x / xf * spp; - int i; - - for (i = spp; --i >= 0;) - *bp++ += *++p; - if (++x == width) { - x = 0; - ++y; - goto top; - } - } -out: - pr->ptr = p; - pw->ptr = q; - ss->x = x, ss->y = y; - return status; -} - -const stream_template s_Average_template = -{ - &st_Average_state, s_Average_init, s_Average_process, 4, 4, - s_Average_release, s_Downsample_set_defaults -}; diff --git a/pstoraster/gdevpsds.h b/pstoraster/gdevpsds.h deleted file mode 100644 index 853aeab8ef..0000000000 --- a/pstoraster/gdevpsds.h +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpsds.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Image processing stream interface for PostScript and PDF writers */ - -#ifndef gdevpsds_INCLUDED -# define gdevpsds_INCLUDED - -#include "strimpl.h" - -/* Convert between 1/2/4 bits and 8 bits. */ -typedef struct stream_1248_state_s { - stream_state_common; - /* The following are set at initialization time. */ - uint samples_per_row; /* >0 */ - int bits_per_sample; /* 1, 2, 4 */ - /* The following are updated dynamically. */ - uint left; /* # of samples left in current row */ -} stream_1248_state; - -/* Expand N (1, 2, 4) bits to 8. */ -extern const stream_template s_1_8_template; -extern const stream_template s_2_8_template; -extern const stream_template s_4_8_template; - -/* Reduce 8 bits to N (1, 2, 4) */ -extern const stream_template s_8_1_template; -extern const stream_template s_8_2_template; -extern const stream_template s_8_4_template; - -/* Initialize an expansion or reduction stream. */ -#define s_1248_init(ss, Columns, samples_per_pixel)\ - ((ss)->samples_per_row = (Columns) * (samples_per_pixel),\ - (*(ss)->template->init)((stream_state *)(ss))) - -/* Convert (8-bit) CMYK to RGB. */ -typedef struct stream_C2R_state_s { - stream_state_common; - /* The following are set at initialization time. */ - const gs_imager_state *pis; /* for UCR & BG */ -} stream_C2R_state; - -#define private_st_C2R_state() /* in gdevpsds.c */\ - gs_private_st_ptrs1(st_C2R_state, stream_C2R_state, "stream_C2R_state",\ - c2r_enum_ptrs, c2r_reloc_ptrs, pis) -extern const stream_template s_C2R_template; - -#define s_C2R_init(ss, pisv)\ - ((ss)->pis = (pisv), 0) - -/* Downsample, possibly with anti-aliasing. */ -#define stream_Downsample_state_common\ - stream_state_common;\ - /* The client sets the following before initialization. */\ - int Colors;\ - int Columns; /* # of input columns */\ - int XFactor, YFactor;\ - bool AntiAlias;\ - bool padX, padY; /* keep excess samples */\ - /* The following are updated dynamically. */\ - int x, y /* position within input image */ -#define s_Downsample_set_defaults_inline(ss)\ - ((ss)->AntiAlias = (ss)->padX = (ss)->padY = false) -typedef struct stream_Downsample_state_s { - stream_Downsample_state_common; -} stream_Downsample_state; - -/* Subsample */ -/****** Subsample DOESN'T IMPLEMENT padY YET ******/ -typedef struct stream_Subsample_state_s { - stream_Downsample_state_common; -} stream_Subsample_state; -extern const stream_template s_Subsample_template; - -/* Average */ -typedef struct stream_Average_state_s { - stream_Downsample_state_common; - uint sum_size; - uint copy_size; - uint *sums; /* accumulated sums for average */ -} stream_Average_state; - -#define private_st_Average_state() /* in gdevpsds.c */\ - gs_private_st_ptrs1(st_Average_state, stream_Average_state,\ - "stream_Average_state", avg_enum_ptrs, avg_reloc_ptrs, sums) -extern const stream_template s_Average_template; - -#endif /* gdevpsds_INCLUDED */ diff --git a/pstoraster/gdevpstr.h b/pstoraster/gdevpstr.h deleted file mode 100644 index 23be23e19d..0000000000 --- a/pstoraster/gdevpstr.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpstr.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Stream output for PostScript- and PDF-writing drivers. */ - -#ifndef gdevpstr_INCLUDED -# define gdevpstr_INCLUDED - -/* Define an opaque type for streams. */ -#ifndef stream_DEFINED -# define stream_DEFINED -typedef struct stream_s stream; - -#endif - -/* Put a character on a stream. */ -#define pputc(s, c) spputc(s, c) - -/* Put a byte array on a stream. */ -int pwrite(P3(stream * s, const void *ptr, uint count)); - -/* Put a string on a stream. */ -int pputs(P2(stream * s, const char *str)); - -/* - * Print (a) floating point number(s) using a format. This is needed - * because %f format always prints a fixed number of digits after the - * decimal point, and %g format may use %e format, which PDF disallows. - * These functions return a pointer to the next %-element of the format, or - * to the terminating 0. - */ -const char *pprintg1(P3(stream * s, const char *format, floatp v)); -const char *pprintg2(P4(stream * s, const char *format, floatp v1, floatp v2)); -const char *pprintg3(P5(stream * s, const char *format, - floatp v1, floatp v2, floatp v3)); -const char *pprintg4(P6(stream * s, const char *format, - floatp v1, floatp v2, floatp v3, floatp v4)); -const char *pprintg6(P8(stream * s, const char *format, - floatp v1, floatp v2, floatp v3, floatp v4, - floatp v5, floatp v6)); - -/* - * The rest of these printing functions exist solely because the ANSI C - * "standard" for functions with a variable number of arguments is not - * implemented properly or consistently across compilers. - */ -/* Print (an) int value(s) using a format. */ -const char *pprintd1(P3(stream * s, const char *format, int v)); -const char *pprintd2(P4(stream * s, const char *format, int v1, int v2)); -const char *pprintd3(P5(stream * s, const char *format, - int v1, int v2, int v3)); -const char *pprintd4(P6(stream * s, const char *format, - int v1, int v2, int v3, int v4)); - -/* Print a long value using a format. */ -const char *pprintld1(P3(stream * s, const char *format, long v)); -const char *pprintld2(P4(stream * s, const char *format, long v1, long v2)); -const char *pprintld3(P5(stream * s, const char *format, - long v1, long v2, long v3)); - -/* Print (a) string(s) using a format. */ -const char *pprints1(P3(stream * s, const char *format, const char *str)); -const char *pprints2(P4(stream * s, const char *format, - const char *str1, const char *str2)); -const char *pprints3(P5(stream * s, const char *format, - const char *str1, const char *str2, const char *str3)); - -#endif /* gdevpstr_INCLUDED */ diff --git a/pstoraster/gdevpxop.h b/pstoraster/gdevpxop.h deleted file mode 100644 index 6caaa5808f..0000000000 --- a/pstoraster/gdevpxop.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevpxop.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Operator and other tag definitions for PCL XL */ - -#ifndef gdevpxop_INCLUDED -# define gdevpxop_INCLUDED - -typedef enum { -/*0x */ - pxtNull = 0x00, pxt01, pxt02, pxt03, - pxt04, pxt05, pxt06, pxt07, - pxt08, pxtHT, pxtLF, pxtVT, - pxtFF, pxtCR, pxt0e, pxt0f, -/*1x */ - pxt10, pxt11, pxt12, pxt13, - pxt14, pxt15, pxt16, pxt17, - pxt18, pxt19, pxt1a, pxt1b, - pxt1c, pxt1d, pxt1e, pxt1f, -/*2x */ - pxtSpace, pxt21, pxt22, pxt23, - pxt24, pxt25, pxt26, pxt_beginASCII, - pxt_beginBinaryMSB, pxt_beginBinaryLSB, pxt2a, pxt2b, - pxt2c, pxt2d, pxt2e, pxt2f, -/*3x */ - pxt30, pxt31, pxt32, pxt33, - pxt34, pxt35, pxt36, pxt37, - pxt38, pxt39, pxt3a, pxt3b, - pxt3c, pxt3d, pxt3e, pxt3f, -/*4x */ - pxt40, pxtBeginSession, pxtEndSession, pxtBeginPage, - pxtEndPage, pxt45, pxt46, pxtComment, - pxtOpenDataSource, pxtCloseDataSource, pxt4a, pxt4b, - pxt4c, pxt4d, pxt4e, pxtBeginFontHeader, -/*5x */ - pxtReadFontHeader, pxtEndFontHeader, pxtBeginChar, pxtReadChar, - pxtEndChar, pxtRemoveFont, pxtSetCharAttributes /*2.0 */ , pxt57, - pxt58, pxt59, pxt5a, pxtBeginStream, - pxtReadStream, pxtEndStream, pxtExecStream, pxtRemoveStream /*2.0 */ , -/*6x */ - pxtPopGS, pxtPushGS, pxtSetClipReplace, pxtSetBrushSource, - pxtSetCharAngle, pxtSetCharScale, pxtSetCharShear, pxtSetClipIntersect, - pxtSetClipRectangle, pxtSetClipToPage, pxtSetColorSpace, pxtSetCursor, - pxtSetCursorRel, pxtSetHalftoneMethod, pxtSetFillMode, pxtSetFont, -/*7x */ - pxtSetLineDash, pxtSetLineCap, pxtSetLineJoin, pxtSetMiterLimit, - pxtSetPageDefaultCTM, pxtSetPageOrigin, pxtSetPageRotation, pxtSetPageScale, - pxtSetPaintTxMode, pxtSetPenSource, pxtSetPenWidth, pxtSetROP, - pxtSetSourceTxMode, pxtSetCharBoldValue, pxt7e, pxtSetClipMode, -/*8x */ - pxtSetPathToClip, pxtSetCharSubMode, pxt82, pxt83, - pxtCloseSubPath, pxtNewPath, pxtPaintPath, pxt87, - pxt88, pxt89, pxt8a, pxt8b, - pxt8c, pxt8d, pxt8e, pxt8f, -/*9x */ - pxt90, pxtArcPath, pxt92, pxtBezierPath, - pxt94, pxtBezierRelPath, pxtChord, pxtChordPath, - pxtEllipse, pxtEllipsePath, pxt9a, pxtLinePath, - pxt9c, pxtLineRelPath, pxtPie, pxtPiePath, -/*ax */ - pxtRectangle, pxtRectanglePath, pxtRoundRectangle, pxtRoundRectanglePath, - pxta4, pxta5, pxta6, pxta7, - pxtText, pxtTextPath, pxtaa, pxtab, - pxtac, pxtad, pxtae, pxtaf, -/*bx */ - pxtBeginImage, pxtReadImage, pxtEndImage, pxtBeginRastPattern, - pxtReadRastPattern, pxtEndRastPattern, pxtBeginScan, pxtb7, - pxtEndScan, pxtScanLineRel, pxtba, pxtbb, - pxtbc, pxtbd, pxtbe, pxtbf, -/*cx */ - pxt_ubyte, pxt_uint16, pxt_uint32, pxt_sint16, - pxt_sint32, pxt_real32, pxtc6, pxtc7, - pxt_ubyte_array, pxt_uint16_array, pxt_uint32_array, pxt_sint16_array, - pxt_sint32_array, pxt_real32_array, pxtce, pxtcf, -/*dx */ - pxt_ubyte_xy, pxt_uint16_xy, pxt_uint32_xy, pxt_sint16_xy, - pxt_sint32_xy, pxt_real32_xy, pxtd6, pxtd7, - pxtd8, pxtd9, pxtda, pxtdb, - pxtdc, pxtdd, pxtde, pxtdf, -/*ex */ - pxt_ubyte_box, pxt_uint16_box, pxt_uint32_box, pxt_sint16_box, - pxt_sint32_box, pxt_real32_box, pxte6, pxte7, - pxte8, pxte9, pxtea, pxteb, - pxtec, pxted, pxtee, pxtef, -/*fx */ - pxtf0, pxtf1, pxtf2, pxtf3, - pxtf4, pxtf5, pxtf6, pxtf7, - pxt_attr_ubyte, pxt_attr_uint16, pxt_dataLength, pxt_dataLengthByte, - pxtfc, pxtfd, pxtfe, pxtff -} px_tag_t; - -#endif /* gdevpxop_INCLUDED */ diff --git a/pstoraster/gdevvec.c b/pstoraster/gdevvec.c deleted file mode 100644 index 8d92226a96..0000000000 --- a/pstoraster/gdevvec.c +++ /dev/null @@ -1,905 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevvec.c,v 1.1 2000/03/08 23:14:26 mike Exp $ */ -/* Utilities for "vector" devices */ -#include "math_.h" -#include "memory_.h" -#include "string_.h" -#include "gx.h" -#include "gp.h" -#include "gserrors.h" -#include "gsparam.h" -#include "gsutil.h" -#include "gxfixed.h" -#include "gdevvec.h" -#include "gscspace.h" -#include "gxdcolor.h" -#include "gxpaint.h" /* requires gx_path, ... */ -#include "gzpath.h" -#include "gzcpath.h" - -/****** - ****** NOTE: EVERYTHING IN THIS FILE IS SUBJECT TO CHANGE WITHOUT NOTICE. - ****** USE AT YOUR OWN RISK. - ******/ - -/* Structure descriptors */ -public_st_device_vector(); -public_st_vector_image_enum(); - -/* ================ Default implementations of vector procs ================ */ - -int -gdev_vector_setflat(gx_device_vector * vdev, floatp flatness) -{ - return 0; -} - -int -gdev_vector_dopath(gx_device_vector * vdev, const gx_path * ppath, - gx_path_type_t type) -{ - bool do_close = (type & gx_path_type_stroke) != 0; - gs_fixed_rect rect; - gs_point scale; - double x_start = 0, y_start = 0, x_prev, y_prev; - bool first = true; - gs_path_enum cenum; - int code; - - if (gx_path_is_rectangle(ppath, &rect)) - return (*vdev_proc(vdev, dorect)) (vdev, rect.p.x, rect.p.y, rect.q.x, - rect.q.y, type); - scale = vdev->scale; - code = (*vdev_proc(vdev, beginpath)) (vdev, type); - gx_path_enum_init(&cenum, ppath); - for (;;) { - fixed vs[6]; - int pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs); - double x, y; - - sw:switch (pe_op) { - case 0: /* done */ - return (*vdev_proc(vdev, endpath)) (vdev, type); - case gs_pe_moveto: - code = (*vdev_proc(vdev, moveto)) - (vdev, x_prev, y_prev, (x = fixed2float(vs[0]) / scale.x), - (y = fixed2float(vs[1]) / scale.y), type); - if (first) - x_start = x, y_start = y, first = false; - break; - case gs_pe_lineto: - code = (*vdev_proc(vdev, lineto)) - (vdev, x_prev, y_prev, (x = fixed2float(vs[0]) / scale.x), - (y = fixed2float(vs[1]) / scale.y), type); - break; - case gs_pe_curveto: - code = (*vdev_proc(vdev, curveto)) - (vdev, x_prev, y_prev, - fixed2float(vs[0]) / scale.x, - fixed2float(vs[1]) / scale.y, - fixed2float(vs[2]) / scale.x, - fixed2float(vs[3]) / scale.y, - (x = fixed2float(vs[4]) / scale.x), - (y = fixed2float(vs[5]) / scale.y), - type); - break; - case gs_pe_closepath: - x = x_start, y = y_start; - if (do_close) { - code = (*vdev_proc(vdev, closepath)) - (vdev, x_prev, y_prev, x_start, y_start, type); - break; - } - pe_op = gx_path_enum_next(&cenum, (gs_fixed_point *) vs); - if (pe_op != 0) { - code = (*vdev_proc(vdev, closepath)) - (vdev, x_prev, y_prev, x_start, y_start, type); - if (code < 0) - return code; - goto sw; - } - return (*vdev_proc(vdev, endpath)) (vdev, type); - default: /* can't happen */ - return_error(gs_error_unknownerror); - } - if (code < 0) - return code; - x_prev = x, y_prev = y; - } -} - -int -gdev_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, - fixed y1, gx_path_type_t type) -{ - int code = (*vdev_proc(vdev, beginpath)) (vdev, type); - - if (code < 0) - return code; - code = gdev_vector_write_rectangle(vdev, x0, y0, x1, y1, - (type & gx_path_type_stroke) != 0, - gx_rect_x_first); - if (code < 0) - return code; - return (*vdev_proc(vdev, endpath)) (vdev, type); -} - -/* ================ Utility procedures ================ */ - -/* Recompute the cached color values. */ -private void -gdev_vector_load_cache(gx_device_vector * vdev) -{ - vdev->black = gx_device_black((gx_device *)vdev); - vdev->white = gx_device_white((gx_device *)vdev); -} - -/* Initialize the state. */ -void -gdev_vector_init(gx_device_vector * vdev) -{ - gdev_vector_reset(vdev); - vdev->scale.x = vdev->scale.y = 1.0; - vdev->in_page = false; - gdev_vector_load_cache(vdev); -} - -/* Reset the remembered graphics state. */ -void -gdev_vector_reset(gx_device_vector * vdev) -{ - static const gs_imager_state state_initial = - {gs_imager_state_initial(1)}; - - vdev->state = state_initial; - color_unset(&vdev->fill_color); - color_unset(&vdev->stroke_color); - vdev->clip_path_id = - vdev->no_clip_path_id = gs_next_ids(1); -} - -/* Open the output file and stream. */ -int -gdev_vector_open_file_bbox(gx_device_vector * vdev, uint strmbuf_size, - bool bbox) -{ /* Open the file as positionable if possible. */ - int code = gx_device_open_output_file((gx_device *) vdev, vdev->fname, - true, true, &vdev->file); - - if (code < 0) - return code; - if ((vdev->strmbuf = gs_alloc_bytes(vdev->v_memory, strmbuf_size, - "vector_open(strmbuf)")) == 0 || - (vdev->strm = s_alloc(vdev->v_memory, - "vector_open(strm)")) == 0 || - (bbox && - (vdev->bbox_device = - gs_alloc_struct_immovable(vdev->v_memory, - gx_device_bbox, &st_device_bbox, - "vector_open(bbox_device)")) == 0) - ) { - if (vdev->bbox_device) - gs_free_object(vdev->v_memory, vdev->bbox_device, - "vector_open(bbox_device)"); - vdev->bbox_device = 0; - if (vdev->strm) - gs_free_object(vdev->v_memory, vdev->strm, - "vector_open(strm)"); - vdev->strm = 0; - if (vdev->strmbuf) - gs_free_object(vdev->v_memory, vdev->strmbuf, - "vector_open(strmbuf)"); - vdev->strmbuf = 0; - fclose(vdev->file); - vdev->file = 0; - return_error(gs_error_VMerror); - } - vdev->strmbuf_size = strmbuf_size; - swrite_file(vdev->strm, vdev->file, vdev->strmbuf, strmbuf_size); - /* - * We don't want finalization to close the file, but we do want it - * to flush the stream buffer. - */ - vdev->strm->procs.close = vdev->strm->procs.flush; - if (vdev->bbox_device) { - gx_device_bbox_init(vdev->bbox_device, NULL); - gx_device_set_resolution((gx_device *) vdev->bbox_device, - vdev->HWResolution[0], - vdev->HWResolution[1]); - /* Do the right thing about upright vs. inverted. */ - /* (This is dangerous in general, since the procedure */ - /* might reference non-standard elements.) */ - set_dev_proc(vdev->bbox_device, get_initial_matrix, - dev_proc(vdev, get_initial_matrix)); - (*dev_proc(vdev->bbox_device, open_device)) - ((gx_device *) vdev->bbox_device); - } - return 0; -} - -/* Get the current stream, calling beginpage if in_page is false. */ -stream * -gdev_vector_stream(gx_device_vector * vdev) -{ - if (!vdev->in_page) { - (*vdev_proc(vdev, beginpage)) (vdev); - vdev->in_page = true; - } - return vdev->strm; -} - -/* Compare two drawing colors. */ -/* Right now we don't attempt to handle non-pure colors. */ -private bool -drawing_color_eq(const gx_drawing_color * pdc1, const gx_drawing_color * pdc2) -{ - return (gx_dc_is_pure(pdc1) ? - gx_dc_is_pure(pdc2) && - gx_dc_pure_color(pdc1) == gx_dc_pure_color(pdc2) : - gx_dc_is_null(pdc1) ? - gx_dc_is_null(pdc2) : - false); -} - -/* Update the logical operation. */ -int -gdev_vector_update_log_op(gx_device_vector * vdev, gs_logical_operation_t lop) -{ - gs_logical_operation_t diff = lop ^ vdev->state.log_op; - - if (diff != 0) { - int code = (*vdev_proc(vdev, setlogop)) (vdev, lop, diff); - - if (code < 0) - return code; - vdev->state.log_op = lop; - } - return 0; -} - -/* Update the fill color. */ -int -gdev_vector_update_fill_color(gx_device_vector * vdev, - const gx_drawing_color * pdcolor) -{ - if (!drawing_color_eq(pdcolor, &vdev->fill_color)) { - int code = (*vdev_proc(vdev, setfillcolor)) (vdev, pdcolor); - - if (code < 0) - return code; - vdev->fill_color = *pdcolor; - } - return 0; -} - -/* Update the state for filling a region. */ -private int -update_fill(gx_device_vector * vdev, const gx_drawing_color * pdcolor, - gs_logical_operation_t lop) -{ - int code = gdev_vector_update_fill_color(vdev, pdcolor); - - if (code < 0) - return code; - return gdev_vector_update_log_op(vdev, lop); -} - -/* Bring state up to date for filling. */ -int -gdev_vector_prepare_fill(gx_device_vector * vdev, const gs_imager_state * pis, - const gx_fill_params * params, const gx_drawing_color * pdcolor) -{ - if (params->flatness != vdev->state.flatness) { - int code = (*vdev_proc(vdev, setflat)) (vdev, params->flatness); - - if (code < 0) - return code; - vdev->state.flatness = params->flatness; - } - return update_fill(vdev, pdcolor, pis->log_op); -} - -/* Compare two dash patterns. */ -private bool -dash_pattern_eq(const float *stored, const gx_dash_params * set, floatp scale) -{ - int i; - - for (i = 0; i < set->pattern_size; ++i) - if (stored[i] != (float)(set->pattern[i] * scale)) - return false; - return true; -} - -/* Bring state up to date for stroking. */ -int -gdev_vector_prepare_stroke(gx_device_vector * vdev, const gs_imager_state * pis, - const gx_stroke_params * params, const gx_drawing_color * pdcolor, - floatp scale) -{ - int pattern_size = pis->line_params.dash.pattern_size; - float dash_offset = pis->line_params.dash.offset * scale; - float half_width = pis->line_params.half_width * scale; - - if (pattern_size > max_dash) - return_error(gs_error_limitcheck); - if (dash_offset != vdev->state.line_params.dash.offset || - pattern_size != vdev->state.line_params.dash.pattern_size || - (pattern_size != 0 && - !dash_pattern_eq(vdev->dash_pattern, &pis->line_params.dash, - scale)) - ) { - float pattern[max_dash]; - int i, code; - - for (i = 0; i < pattern_size; ++i) - pattern[i] = pis->line_params.dash.pattern[i] * scale; - code = (*vdev_proc(vdev, setdash)) - (vdev, pattern, pattern_size, dash_offset); - if (code < 0) - return code; - memcpy(vdev->dash_pattern, pattern, pattern_size * sizeof(float)); - - vdev->state.line_params.dash.pattern_size = pattern_size; - vdev->state.line_params.dash.offset = dash_offset; - } - if (params->flatness != vdev->state.flatness) { - int code = (*vdev_proc(vdev, setflat)) (vdev, params->flatness); - - if (code < 0) - return code; - vdev->state.flatness = params->flatness; - } - if (half_width != vdev->state.line_params.half_width) { - int code = (*vdev_proc(vdev, setlinewidth)) - (vdev, pis->line_params.half_width * 2); - - if (code < 0) - return code; - vdev->state.line_params.half_width = half_width; - } - if (pis->line_params.miter_limit != vdev->state.line_params.miter_limit) { - int code = (*vdev_proc(vdev, setmiterlimit)) - (vdev, pis->line_params.miter_limit); - - if (code < 0) - return code; - gx_set_miter_limit(&vdev->state.line_params, - pis->line_params.miter_limit); - } - if (pis->line_params.cap != vdev->state.line_params.cap) { - int code = (*vdev_proc(vdev, setlinecap)) - (vdev, pis->line_params.cap); - - if (code < 0) - return code; - vdev->state.line_params.cap = pis->line_params.cap; - } - if (pis->line_params.join != vdev->state.line_params.join) { - int code = (*vdev_proc(vdev, setlinejoin)) - (vdev, pis->line_params.join); - - if (code < 0) - return code; - vdev->state.line_params.join = pis->line_params.join; - } { - int code = gdev_vector_update_log_op(vdev, pis->log_op); - - if (code < 0) - return code; - } - if (!drawing_color_eq(pdcolor, &vdev->stroke_color)) { - int code = (*vdev_proc(vdev, setstrokecolor)) (vdev, pdcolor); - - if (code < 0) - return code; - vdev->stroke_color = *pdcolor; - } - return 0; -} - -/* Write a polygon as part of a path. */ -/* May call beginpath, moveto, lineto, closepath, endpath. */ -int -gdev_vector_write_polygon(gx_device_vector * vdev, const gs_fixed_point * points, - uint count, bool close, gx_path_type_t type) -{ - int code = 0; - - if (type != gx_path_type_none && - (code = (*vdev_proc(vdev, beginpath)) (vdev, type)) < 0 - ) - return code; - if (count > 0) { - double x = fixed2float(points[0].x) / vdev->scale.x, y = fixed2float(points[0].y) / vdev->scale.y; - double x_start = x, y_start = y, x_prev, y_prev; - uint i; - - code = (*vdev_proc(vdev, moveto)) - (vdev, 0.0, 0.0, x, y, type); - if (code >= 0) - for (i = 1; i < count && code >= 0; ++i) { - x_prev = x, y_prev = y; - code = (*vdev_proc(vdev, lineto)) - (vdev, x_prev, y_prev, - (x = fixed2float(points[i].x) / vdev->scale.x), - (y = fixed2float(points[i].y) / vdev->scale.y), - type); - } - if (code >= 0 && close) - code = (*vdev_proc(vdev, closepath)) - (vdev, x, y, x_start, y_start, type); - } - return (code >= 0 && type != gx_path_type_none ? - (*vdev_proc(vdev, endpath)) (vdev, type) : code); -} - -/* Write a rectangle as part of a path. */ -/* May call moveto, lineto, closepath. */ -int -gdev_vector_write_rectangle(gx_device_vector * vdev, fixed x0, fixed y0, - fixed x1, fixed y1, bool close, gx_rect_direction_t direction) -{ - gs_fixed_point points[4]; - - points[0].x = x0, points[0].y = y0; - points[2].x = x1, points[2].y = y1; - if (direction == gx_rect_x_first) - points[1].x = x1, points[1].y = y0, - points[3].x = x0, points[3].y = y1; - else - points[1].x = x0, points[1].y = y1, - points[3].x = x1, points[3].y = y0; - return gdev_vector_write_polygon(vdev, points, 4, close, - gx_path_type_none); -} - -/* Write a clipping path by calling the path procedures. */ -int -gdev_vector_write_clip_path(gx_device_vector * vdev, const gx_clip_path * pcpath) -{ - const gx_clip_rect *prect; - gx_clip_rect page_rect; - int code; - - if (pcpath == 0) { /* There's no special provision for initclip. */ - /* Write a rectangle that covers the entire page. */ - page_rect.xmin = page_rect.ymin = 0; - page_rect.xmax = vdev->width; - page_rect.ymax = vdev->height; - page_rect.next = 0; - prect = &page_rect; - } else if (pcpath->path_valid) - return (*vdev_proc(vdev, dopath)) (vdev, &pcpath->path, - gx_path_type_clip); - else { - const gx_clip_list *list = gx_cpath_list(pcpath); - - prect = list->head; - if (prect == 0) - prect = &list->single; - } - /* Write out the rectangles. */ - code = (*vdev_proc(vdev, beginpath)) (vdev, gx_path_type_clip); - for (; code >= 0 && prect != 0; prect = prect->next) - if (prect->xmax > prect->xmin && prect->ymax > prect->ymin) - code = gdev_vector_write_rectangle - (vdev, int2fixed(prect->xmin), int2fixed(prect->ymin), - int2fixed(prect->xmax), int2fixed(prect->ymax), - false, gx_rect_x_first); - if (code >= 0) - code = (*vdev_proc(vdev, endpath)) (vdev, gx_path_type_clip); - return code; -} - -/* Update the clipping path if needed. */ -int -gdev_vector_update_clip_path(gx_device_vector * vdev, - const gx_clip_path * pcpath) -{ - if (pcpath) { - if (pcpath->id != vdev->clip_path_id) { - int code = gdev_vector_write_clip_path(vdev, pcpath); - - if (code < 0) - return code; - vdev->clip_path_id = pcpath->id; - } - } else { - if (vdev->clip_path_id != vdev->no_clip_path_id) { - int code = gdev_vector_write_clip_path(vdev, NULL); - - if (code < 0) - return code; - vdev->clip_path_id = vdev->no_clip_path_id; - } - } - return 0; -} - -/* Close the output file and stream. */ -void -gdev_vector_close_file(gx_device_vector * vdev) -{ - gs_free_object(vdev->v_memory, vdev->bbox_device, - "vector_close(bbox_device)"); - vdev->bbox_device = 0; - sclose(vdev->strm); - gs_free_object(vdev->v_memory, vdev->strm, "vector_close(strm)"); - vdev->strm = 0; - gs_free_object(vdev->v_memory, vdev->strmbuf, "vector_close(strmbuf)"); - vdev->strmbuf = 0; - fclose(vdev->file); /* we prevented sclose from doing this */ - vdev->file = 0; -} - -/* ---------------- Image enumeration ---------------- */ - -/* Initialize for enumerating an image. */ -int -gdev_vector_begin_image(gx_device_vector * vdev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * mem, const gx_image_enum_procs_t * pprocs, - gdev_vector_image_enum_t * pie) -{ - const gs_color_space *pcs = pim->ColorSpace; - int num_components; - int bits_per_pixel; - int code; - - if (pim->ImageMask) - bits_per_pixel = num_components = 1; - else - num_components = gs_color_space_num_components(pcs), - bits_per_pixel = pim->BitsPerComponent; - code = gx_image_enum_common_init((gx_image_enum_common_t *) pie, - (const gs_image_common_t *)pim, - pprocs, (gx_device *) vdev, - bits_per_pixel, num_components, - format); - if (code < 0) - return code; - pie->bits_per_pixel = bits_per_pixel * num_components / - pie->num_planes; - pie->default_info = 0; - pie->bbox_info = 0; - if ((code = gdev_vector_update_log_op(vdev, pis->log_op)) < 0 || - (code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 || - ((pim->ImageMask || - (pim->CombineWithColor && rop3_uses_T(pis->log_op))) && - (code = gdev_vector_update_fill_color(vdev, pdcolor)) < 0) || - (vdev->bbox_device && - (code = (*dev_proc(vdev->bbox_device, begin_image)) - ((gx_device *) vdev->bbox_device, pis, pim, format, prect, - pdcolor, pcpath, mem, &pie->bbox_info)) < 0) - ) - return code; - pie->memory = mem; - if (prect) - pie->width = prect->q.x - prect->p.x, - pie->height = prect->q.y - prect->p.y; - else - pie->width = pim->Width, pie->height = pim->Height; - pie->bits_per_row = pie->width * pie->bits_per_pixel; - pie->y = 0; - return 0; -} - -/* End an image, optionally supplying any necessary blank padding rows. */ -/* Return 0 if we used the default implementation, 1 if not. */ -int -gdev_vector_end_image(gx_device_vector * vdev, - gdev_vector_image_enum_t * pie, bool draw_last, gx_color_index pad) -{ - int code; - - if (pie->default_info) { - code = gx_default_end_image((gx_device *) vdev, pie->default_info, - draw_last); - if (code >= 0) - code = 0; - } else { /* Fill out to the full image height. */ - if (pie->y < pie->height && pad != gx_no_color_index) { - uint bytes_per_row = (pie->bits_per_row + 7) >> 3; - byte *row = gs_alloc_bytes(pie->memory, bytes_per_row, - "gdev_vector_end_image(fill)"); - - if (row == 0) - return_error(gs_error_VMerror); -/****** FILL VALUE IS WRONG ******/ - memset(row, (byte) pad, bytes_per_row); - for (; pie->y < pie->height; pie->y++) - gx_image_data((gx_image_enum_common_t *) pie, - (const byte **)&row, 0, - bytes_per_row, 1); - gs_free_object(pie->memory, row, - "gdev_vector_end_image(fill)"); - } - code = 1; - } - if (vdev->bbox_device) { - int bcode = gx_image_end(pie->bbox_info, draw_last); - - if (bcode < 0) - code = bcode; - } - gs_free_object(pie->memory, pie, "gdev_vector_end_image"); - return code; -} - -/* ================ Device procedures ================ */ - -#define vdev ((gx_device_vector *)dev) - -/* Get parameters. */ -int -gdev_vector_get_params(gx_device * dev, gs_param_list * plist) -{ - int code = gx_default_get_params(dev, plist); - int ecode; - gs_param_string ofns; - - if (code < 0) - return code; - ofns.data = (const byte *)vdev->fname, - ofns.size = strlen(vdev->fname), - ofns.persistent = false; - if ((ecode = param_write_string(plist, "OutputFile", &ofns)) < 0) - return ecode; - return code; -} - -/* Put parameters. */ -int -gdev_vector_put_params(gx_device * dev, gs_param_list * plist) -{ - int ecode = 0; - int code; - gs_param_name param_name; - gs_param_string ofns; - - switch (code = param_read_string(plist, (param_name = "OutputFile"), &ofns)) { - case 0: - if (ofns.size > fname_size) - ecode = gs_error_limitcheck; - else - break; - goto ofe; - default: - ecode = code; - ofe:param_signal_error(plist, param_name, ecode); - case 1: - ofns.data = 0; - break; - } - - if (ecode < 0) - return ecode; - { - bool open = dev->is_open; - - /* Don't let gx_default_put_params close the device. */ - dev->is_open = false; - code = gx_default_put_params(dev, plist); - dev->is_open = open; - } - if (code < 0) - return code; - - if (ofns.data != 0 && - bytes_compare(ofns.data, ofns.size, - (const byte *)vdev->fname, strlen(vdev->fname)) - ) { - memcpy(vdev->fname, ofns.data, ofns.size); - vdev->fname[ofns.size] = 0; - if (vdev->file != 0) { - gdev_vector_close_file(vdev); - return gdev_vector_open_file(vdev, vdev->strmbuf_size); - } - } - gdev_vector_load_cache(vdev); /* in case color mapping changed */ - return 0; -} - -/* ---------------- Defaults ---------------- */ - -int -gdev_vector_fill_rectangle(gx_device * dev, int x, int y, int w, int h, - gx_color_index color) -{ - gx_drawing_color dcolor; - - /* Ignore the initial fill with white. */ - if (!vdev->in_page && color == vdev->white) - return 0; - color_set_pure(&dcolor, color); - { - int code = update_fill(vdev, &dcolor, rop3_T); - - if (code < 0) - return code; - } - if (vdev->bbox_device) { - int code = (*dev_proc(vdev->bbox_device, fill_rectangle)) - ((gx_device *) vdev->bbox_device, x, y, w, h, color); - - if (code < 0) - return code; - } - return (*vdev_proc(vdev, dorect)) (vdev, int2fixed(x), int2fixed(y), - int2fixed(x + w), int2fixed(y + h), - gx_path_type_fill); -} - -int -gdev_vector_fill_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_fill_params * params, - const gx_device_color * pdevc, const gx_clip_path * pcpath) -{ - int code; - - if ((code = gdev_vector_prepare_fill(vdev, pis, params, pdevc)) < 0 || - (code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 || - (vdev->bbox_device && - (code = (*dev_proc(vdev->bbox_device, fill_path)) - ((gx_device *) vdev->bbox_device, pis, ppath, params, - pdevc, pcpath)) < 0) || - (code = (*vdev_proc(vdev, dopath)) - (vdev, ppath, - (params->rule > 0 ? gx_path_type_even_odd : - gx_path_type_winding_number) | gx_path_type_fill)) < 0 - ) - return gx_default_fill_path(dev, pis, ppath, params, pdevc, pcpath); - return code; -} - -int -gdev_vector_stroke_path(gx_device * dev, const gs_imager_state * pis, - gx_path * ppath, const gx_stroke_params * params, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath) -{ - int code; - -/****** HANDLE SCALE ******/ - if ((code = gdev_vector_prepare_stroke(vdev, pis, params, pdcolor, - dev->HWResolution[0])) < 0 || - (code = gdev_vector_update_clip_path(vdev, pcpath)) < 0 || - (vdev->bbox_device && - (code = (*dev_proc(vdev->bbox_device, stroke_path)) - ((gx_device *) vdev->bbox_device, pis, ppath, params, - pdcolor, pcpath)) < 0) || - (code = (*vdev_proc(vdev, dopath)) - (vdev, ppath, gx_path_type_stroke)) < 0 - ) - return gx_default_stroke_path(dev, pis, ppath, params, pdcolor, pcpath); - return code; -} - -int -gdev_vector_fill_trapezoid(gx_device * dev, const gs_fixed_edge * left, - const gs_fixed_edge * right, fixed ybot, fixed ytop, bool swap_axes, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - fixed xl = left->start.x; - fixed wl = left->end.x - xl; - fixed yl = left->start.y; - fixed hl = left->end.y - yl; - fixed xr = right->start.x; - fixed wr = right->end.x - xr; - fixed yr = right->start.y; - fixed hr = right->end.y - yr; - fixed x0l = xl + fixed_mult_quo(wl, ybot - yl, hl); - fixed x1l = xl + fixed_mult_quo(wl, ytop - yl, hl); - fixed x0r = xr + fixed_mult_quo(wr, ybot - yr, hr); - fixed x1r = xr + fixed_mult_quo(wr, ytop - yr, hr); - -#define y0 ybot -#define y1 ytop - int code = update_fill(vdev, pdevc, lop); - gs_fixed_point points[4]; - - if (code < 0) - return gx_default_fill_trapezoid(dev, left, right, ybot, ytop, - swap_axes, pdevc, lop); - if (swap_axes) - points[0].y = x0l, points[1].y = x0r, - points[0].x = points[1].x = y0, - points[2].y = x1r, points[3].y = x1l, - points[2].x = points[3].x = y1; - else - points[0].x = x0l, points[1].x = x0r, - points[0].y = points[1].y = y0, - points[2].x = x1r, points[3].x = x1l, - points[2].y = points[3].y = y1; -#undef y0 -#undef y1 - if (vdev->bbox_device) { - int code = (*dev_proc(vdev->bbox_device, fill_trapezoid)) - ((gx_device *) vdev->bbox_device, left, right, ybot, ytop, - swap_axes, pdevc, lop); - - if (code < 0) - return code; - } - return gdev_vector_write_polygon(vdev, points, 4, true, - gx_path_type_fill); -} - -int -gdev_vector_fill_parallelogram(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - fixed pax = px + ax, pay = py + ay; - int code = update_fill(vdev, pdevc, lop); - gs_fixed_point points[4]; - - if (code < 0) - return gx_default_fill_parallelogram(dev, px, py, ax, ay, bx, by, - pdevc, lop); - if (vdev->bbox_device) { - code = (*dev_proc(vdev->bbox_device, fill_parallelogram)) - ((gx_device *) vdev->bbox_device, px, py, ax, ay, bx, by, - pdevc, lop); - if (code < 0) - return code; - } - points[0].x = px, points[0].y = py; - points[1].x = pax, points[0].y = pay; - points[2].x = pax + bx, points[2].y = pay + by; - points[3].x = px + bx, points[3].y = py + by; - return gdev_vector_write_polygon(vdev, points, 4, true, - gx_path_type_fill); -} - -int -gdev_vector_fill_triangle(gx_device * dev, - fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, - const gx_device_color * pdevc, gs_logical_operation_t lop) -{ - int code = update_fill(vdev, pdevc, lop); - gs_fixed_point points[3]; - - if (code < 0) - return gx_default_fill_triangle(dev, px, py, ax, ay, bx, by, - pdevc, lop); - if (vdev->bbox_device) { - code = (*dev_proc(vdev->bbox_device, fill_triangle)) - ((gx_device *) vdev->bbox_device, px, py, ax, ay, bx, by, - pdevc, lop); - if (code < 0) - return code; - } - points[0].x = px, points[0].y = py; - points[1].x = px + ax, points[1].y = py + ay; - points[2].x = px + bx, points[2].y = py + by; - return gdev_vector_write_polygon(vdev, points, 3, true, - gx_path_type_fill); -} - -#undef vdev diff --git a/pstoraster/gdevvec.h b/pstoraster/gdevvec.h deleted file mode 100644 index a8cfe3399a..0000000000 --- a/pstoraster/gdevvec.h +++ /dev/null @@ -1,349 +0,0 @@ -/* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gdevvec.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Common definitions for "vector" devices */ - -#ifndef gdevvec_INCLUDED -# define gdevvec_INCLUDED - -#include "gp.h" /* for gp_file_name_sizeof */ -#include "gsropt.h" -#include "gxdevice.h" -#include "gdevbbox.h" -#include "gxiparam.h" -#include "gxistate.h" -#include "stream.h" - -/****** - ****** NOTE: EVERYTHING IN THIS FILE IS SUBJECT TO CHANGE WITHOUT NOTICE. - ****** USE AT YOUR OWN RISK. - ******/ - -/* - * "Vector" devices produce a stream of higher-level drawing commands rather - * than a raster image. (We don't like the term "vector", since the command - * vocabulary typically includes text and raster images as well as actual - * vectors, but it's widely used in the industry, and we weren't able to - * find one that read better.) Some examples of "vector" formats are PDF, - * PostScript, PCL XL, HP-GL/2 + RTL, CGM, Windows Metafile, and Macintosh - * PICT. - * - * This file extends the basic driver structure with elements likely to be - * useful to vector devices. These include: - * - * - Tracking whether any marks have been made on the page; - * - * - Keeping track of the page bounding box; - * - * - A copy of the most recently written current graphics state - * parameters; - * - * - An output stream (for drivers that compress or otherwise filter - * their output); - * - * - A vector of procedures for writing changes to the graphics state. - * - * - The ability to work with scaled output coordinate systems. - * - * We expect to add more elements and procedures as we gain more experience - * with this kind of driver. - */ - -/* ================ Types and structures ================ */ - -/* Define the abstract type for a vector device. */ -typedef struct gx_device_vector_s gx_device_vector; - -/* Define the maximum size of the output file name. */ -#define fname_size (gp_file_name_sizeof - 1) - -/* Define the longest dash pattern we can remember. */ -#define max_dash 11 - -/* - * Define procedures for writing common output elements. Not all devices - * will support all of these elements. Note that these procedures normally - * only write out commands, and don't update the driver state itself. All - * of them are optional, called only as indicated under the utility - * procedures below. - */ -typedef enum { - gx_path_type_none = 0, - /* - * All combinations of flags are legal. Multiple commands are - * executed in the order fill, stroke, clip. - */ - gx_path_type_fill = 1, - gx_path_type_stroke = 2, - gx_path_type_clip = 4, - gx_path_type_winding_number = 0, - gx_path_type_even_odd = 8, - gx_path_type_rule = gx_path_type_winding_number | gx_path_type_even_odd -} gx_path_type_t; -typedef enum { - gx_rect_x_first, - gx_rect_y_first -} gx_rect_direction_t; -typedef struct gx_device_vector_procs_s { - /* Page management */ - int (*beginpage) (P1(gx_device_vector * vdev)); - /* Imager state */ - int (*setlinewidth) (P2(gx_device_vector * vdev, floatp width)); - int (*setlinecap) (P2(gx_device_vector * vdev, gs_line_cap cap)); - int (*setlinejoin) (P2(gx_device_vector * vdev, gs_line_join join)); - int (*setmiterlimit) (P2(gx_device_vector * vdev, floatp limit)); - int (*setdash) (P4(gx_device_vector * vdev, const float *pattern, - uint count, floatp offset)); - int (*setflat) (P2(gx_device_vector * vdev, floatp flatness)); - int (*setlogop) (P3(gx_device_vector * vdev, gs_logical_operation_t lop, - gs_logical_operation_t diff)); - /* Other state */ - int (*setfillcolor) (P2(gx_device_vector * vdev, const gx_drawing_color * pdc)); - int (*setstrokecolor) (P2(gx_device_vector * vdev, const gx_drawing_color * pdc)); - /* Paths */ - /* dopath and dorect are normally defaulted */ - int (*dopath) (P3(gx_device_vector * vdev, const gx_path * ppath, - gx_path_type_t type)); - int (*dorect) (P6(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1, - fixed y1, gx_path_type_t type)); - int (*beginpath) (P2(gx_device_vector * vdev, gx_path_type_t type)); - int (*moveto) (P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, gx_path_type_t type)); - int (*lineto) (P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x, floatp y, gx_path_type_t type)); - int (*curveto) (P10(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x1, floatp y1, floatp x2, floatp y2, - floatp x3, floatp y3, gx_path_type_t type)); - int (*closepath) (P6(gx_device_vector * vdev, floatp x0, floatp y0, - floatp x_start, floatp y_start, gx_path_type_t type)); - int (*endpath) (P2(gx_device_vector * vdev, gx_path_type_t type)); -} gx_device_vector_procs; - -/* Default implementations of procedures */ -/* setflat does nothing */ -int gdev_vector_setflat(P2(gx_device_vector * vdev, floatp flatness)); - -/* dopath may call dorect, beginpath, moveto/lineto/curveto/closepath, */ -/* endpath */ -int gdev_vector_dopath(P3(gx_device_vector * vdev, const gx_path * ppath, - gx_path_type_t type)); - -/* dorect may call beginpath, moveto, lineto, closepath */ -int gdev_vector_dorect(P6(gx_device_vector * vdev, fixed x0, fixed y0, - fixed x1, fixed y1, gx_path_type_t type)); - -/* Finally, define the extended device structure. */ -#define gx_device_vector_common\ - gx_device_common;\ - gs_memory_t *v_memory;\ - /* Output element writing procedures */\ - const gx_device_vector_procs *vec_procs;\ - /* Output file */\ - char fname[fname_size + 1];\ - FILE *file;\ - stream *strm;\ - byte *strmbuf;\ - uint strmbuf_size;\ - /* Graphics state */\ - gs_imager_state state;\ - float dash_pattern[max_dash];\ - gx_drawing_color fill_color, stroke_color;\ - gs_id no_clip_path_id; /* indicates no clipping */\ - gs_id clip_path_id;\ - /* Other state */\ - gs_point scale; /* device coords / scale => output coords */\ - bool in_page; /* true if any marks on this page */\ - gx_device_bbox *bbox_device; /* for tracking bounding box */\ - /* Cached values */\ - gx_color_index black, white -#define vdev_proc(vdev, p) ((vdev)->vec_procs->p) - -#define vector_initial_values\ - 0, /* v_memory */\ - 0, /* vec_procs */\ - { 0 }, /* fname */\ - 0, /* file */\ - 0, /* strm */\ - 0, /* strmbuf */\ - 0, /* strmbuf_size */\ - { 0 }, /* state */\ - { 0 }, /* dash_pattern */\ - { 0 }, /* fill_color ****** WRONG ****** */\ - { 0 }, /* stroke_color ****** WRONG ****** */\ - gs_no_id, /* clip_path_id */\ - gs_no_id, /* no_clip_path_id */\ - { X_DPI/72.0, Y_DPI/72.0 }, /* scale */\ - 0/*false*/, /* in_page */\ - 0, /* bbox_device */\ - gx_no_color_index, /* black */\ - gx_no_color_index /* white */ - -struct gx_device_vector_s { - gx_device_vector_common; -}; - -/* st_device_vector is never instantiated per se, but we still need to */ -/* extern its descriptor for the sake of subclasses. */ -extern_st(st_device_vector); -#define public_st_device_vector() /* in gdevvec.c */\ - gs_public_st_suffix_add3_final(st_device_vector, gx_device_vector,\ - "gx_device_vector", device_vector_enum_ptrs,\ - device_vector_reloc_ptrs, gx_device_finalize, st_device, strm, strmbuf,\ - bbox_device) -#define st_device_vector_max_ptrs (st_device_max_ptrs + 3) - -/* ================ Utility procedures ================ */ - -/* Initialize the state. */ -void gdev_vector_init(P1(gx_device_vector * vdev)); - -/* Reset the remembered graphics state. */ -void gdev_vector_reset(P1(gx_device_vector * vdev)); - -/* Open the output file and stream, with optional bbox tracking. */ -int gdev_vector_open_file_bbox(P3(gx_device_vector * vdev, uint strmbuf_size, - bool bbox)); - -#define gdev_vector_open_file(vdev, strmbuf_size)\ - gdev_vector_open_file_bbox(vdev, strmbuf_size, false) - -/* Get the current stream, calling beginpage if in_page is false. */ -stream *gdev_vector_stream(P1(gx_device_vector * vdev)); - -/* Bring the logical operation up to date. */ -/* May call setlogop. */ -int gdev_vector_update_log_op(P2(gx_device_vector * vdev, - gs_logical_operation_t lop)); - -/* Bring the fill color up to date. */ -/* May call setfillcolor. */ -int gdev_vector_update_fill_color(P2(gx_device_vector * vdev, - const gx_drawing_color * pdcolor)); - -/* Bring state up to date for filling. */ -/* May call setflat, setfillcolor, setlogop. */ -int gdev_vector_prepare_fill(P4(gx_device_vector * vdev, - const gs_imager_state * pis, - const gx_fill_params * params, - const gx_drawing_color * pdcolor)); - -/* Bring state up to date for stroking. Note that we pass the scale */ -/* for the line width and dash offset explicitly. */ -/* May call setlinewidth, setlinecap, setlinejoin, setmiterlimit, */ -/* setdash, setflat, setstrokecolor, setlogop. */ -int gdev_vector_prepare_stroke(P5(gx_device_vector * vdev, - const gs_imager_state * pis, - const gx_stroke_params * params, - const gx_drawing_color * pdcolor, - floatp scale)); - -/* Write a polygon as part of a path (type = gx_path_type_none) */ -/* or as a path. */ -/* May call moveto, lineto, closepath (if close); */ -/* may call beginpath & endpath if type != none. */ -int gdev_vector_write_polygon(P5(gx_device_vector * vdev, - const gs_fixed_point * points, uint count, - bool close, gx_path_type_t type)); - -/* Write a rectangle. This is just a special case of write_polygon. */ -int gdev_vector_write_rectangle(P7(gx_device_vector * vdev, - fixed x0, fixed y0, fixed x1, fixed y1, - bool close, gx_rect_direction_t dir)); - -/* Write a clipping path by calling the path procedures. */ -/* May call the same procedures as writepath. */ -int gdev_vector_write_clip_path(P2(gx_device_vector * vdev, - const gx_clip_path * pcpath)); - -/* Bring the clipping state up to date. */ -/* May call write_rectangle (q.v.), write_clip_path (q.v.). */ -int gdev_vector_update_clip_path(P2(gx_device_vector * vdev, - const gx_clip_path * pcpath)); - -/* Close the output file and stream. */ -void gdev_vector_close_file(P1(gx_device_vector * vdev)); - -/* ---------------- Image enumeration ---------------- */ - -/* Define a common set of state parameters for enumerating images. */ -#define gdev_vector_image_enum_common\ - gx_image_enum_common;\ - /* Set by begin_image */\ - gs_memory_t *memory; /* from begin_image */\ - gx_image_enum_common_t *default_info; /* non-0 iff using default implementation */\ - gx_image_enum_common_t *bbox_info; /* non-0 iff passing image data to bbox dev */\ - int width, height;\ - int bits_per_pixel; /* (per plane) */\ - uint bits_per_row; /* (per plane) */\ - /* Updated dynamically by image_data */\ - int y /* 0 <= y < height */ -typedef struct gdev_vector_image_enum_s { - gdev_vector_image_enum_common; -} gdev_vector_image_enum_t; - -extern_st(st_vector_image_enum); -#define public_st_vector_image_enum() /* in gdevvec.c */\ - gs_public_st_ptrs2(st_vector_image_enum, gdev_vector_image_enum_t,\ - "gdev_vector_image_enum_t", vector_image_enum_enum_ptrs,\ - vector_image_enum_reloc_ptrs, default_info, bbox_info) - -/* - * Initialize for enumerating an image. Note that the last argument is an - * already-allocated enumerator, not a pointer to the place to store the - * enumerator. - */ -int gdev_vector_begin_image(P10(gx_device_vector * vdev, - const gs_imager_state * pis, const gs_image_t * pim, - gs_image_format_t format, const gs_int_rect * prect, - const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, - gs_memory_t * mem, const gx_image_enum_procs_t * pprocs, - gdev_vector_image_enum_t * pie)); - -/* End an image, optionally supplying any necessary blank padding rows. */ -/* Return 0 if we used the default implementation, 1 if not. */ -int gdev_vector_end_image(P4(gx_device_vector * vdev, - gdev_vector_image_enum_t * pie, bool draw_last, gx_color_index pad)); - -/* ================ Device procedures ================ */ - -/* Redefine get/put_params to handle OutputFile. */ -dev_proc_put_params(gdev_vector_put_params); -dev_proc_get_params(gdev_vector_get_params); - -/* ---------------- Defaults ---------------- */ - -/* fill_rectangle may call setfillcolor, dorect. */ -dev_proc_fill_rectangle(gdev_vector_fill_rectangle); -/* fill_path may call prepare_fill, writepath, write_clip_path. */ -dev_proc_fill_path(gdev_vector_fill_path); -/* stroke_path may call prepare_stroke, write_path, write_clip_path. */ -dev_proc_stroke_path(gdev_vector_stroke_path); -/* fill_trapezoid, fill_parallelogram, and fill_triangle may call */ -/* setfillcolor, setlogop, beginpath, moveto, lineto, endpath. */ -dev_proc_fill_trapezoid(gdev_vector_fill_trapezoid); -dev_proc_fill_parallelogram(gdev_vector_fill_parallelogram); -dev_proc_fill_triangle(gdev_vector_fill_triangle); - -#endif /* gdevvec_INCLUDED */ diff --git a/pstoraster/genarch.c b/pstoraster/genarch.c deleted file mode 100644 index 7391082abc..0000000000 --- a/pstoraster/genarch.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: genarch.c,v 1.2 2000/03/08 23:14:26 mike Exp $ */ -/* Generate a header file (arch.h) with parameters */ -/* reflecting the machine architecture and compiler characteristics. */ - -#include "stdpre.h" -#include - -/* We should write the result on stdout, but the original Turbo C 'make' */ -/* can't handle output redirection (sigh). */ - -private void -section(FILE * f, char *str) -{ - fprintf(f, "\n\t /* ---------------- %s ---------------- */\n\n", str); -} - -int -main(int argc, char *argv[]) -{ - char *fname = argv[1]; - long one = 1; - char *ffs = "ffffffffffffffff"; /* 8 bytes */ - int ffs_strlen = strlen(ffs); - struct { - char c; - short s; - } ss; - struct { - char c; - int i; - } si; - struct { - char c; - long l; - } sl; - struct { - char c; - char *p; - } sp; - struct { - char c; - float f; - } sf; - struct { - char c; - double d; - } sd; - static int log2s[17] = - {0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4}; - long lm1 = -1; - long lr1 = lm1 >> 1, lr2 = lm1 >> 2; - unsigned long um1 = ~(unsigned long)0; - int im1 = -1; - int ir1 = im1 >> 1, ir2 = im1 >> 2; - union { - long l; - char *p; - } pl0, pl1; - int ars; - int lwidth = size_of(long) * 8; - union { - float f; - int i; - long l; - } f0 , f1, fm1; - FILE *f = fopen(fname, "w"); - - if (f == NULL) { - fprintf(stderr, "genarch.c: can't open %s for writing\n", fname); - return exit_FAILED; - } - fprintf(f, "/* Parameters derived from machine and compiler architecture */\n"); - - section(f, "Scalar alignments"); - -#define OFFSET_IN(s, e) (int)((char *)&s.e - (char *)&s) - fprintf(f, "#define arch_align_short_mod %d\n", OFFSET_IN(ss, s)); - fprintf(f, "#define arch_align_int_mod %d\n", OFFSET_IN(si, i)); - fprintf(f, "#define arch_align_long_mod %d\n", OFFSET_IN(sl, l)); - fprintf(f, "#define arch_align_ptr_mod %d\n", OFFSET_IN(sp, p)); - fprintf(f, "#define arch_align_float_mod %d\n", OFFSET_IN(sf, f)); - fprintf(f, "#define arch_align_double_mod %d\n", OFFSET_IN(sd, d)); -#undef OFFSET_IN - - section(f, "Scalar sizes"); - - fprintf(f, "#define arch_log2_sizeof_short %d\n", log2s[size_of(short)]); - fprintf(f, "#define arch_log2_sizeof_int %d\n", log2s[size_of(int)]); - fprintf(f, "#define arch_log2_sizeof_long %d\n", log2s[size_of(long)]); - fprintf(f, "#define arch_sizeof_ptr %d\n", size_of(char *)); - fprintf(f, "#define arch_sizeof_float %d\n", size_of(float)); - fprintf(f, "#define arch_sizeof_double %d\n", size_of(double)); - - section(f, "Unsigned max values"); - -#define PRINT_MAX(str, typ, tstr, l)\ - fprintf(f, "#define arch_max_%s ((%s)0x%s%s + (%s)0)\n",\ - str, tstr, ffs + ffs_strlen - size_of(typ) * 2, l, tstr) - PRINT_MAX("uchar", unsigned char, "unsigned char", ""); - PRINT_MAX("ushort", unsigned short, "unsigned short", ""); - PRINT_MAX("uint", unsigned int, "unsigned int", ""); - PRINT_MAX("ulong", unsigned long, "unsigned long", "L"); - -#undef PRINT_MAX - - section(f, "Miscellaneous"); - - fprintf(f, "#define arch_is_big_endian %d\n", 1 - *(char *)&one); - pl0.l = 0; - pl1.l = -1; - fprintf(f, "#define arch_ptrs_are_signed %d\n", - (pl1.p < pl0.p)); - f0.f = 0.0, f1.f = 1.0, fm1.f = -1.0; - /* We have to test the size dynamically here, */ - /* because the preprocessor can't evaluate sizeof. */ - fprintf(f, "#define arch_floats_are_IEEE %d\n", - ((size_of(float) == size_of(int) ? - f0.i == 0 && f1.i == (int)0x3f800000 && fm1.i == (int)0xbf800000 : - f0.l == 0 && f1.l == 0x3f800000L && fm1.l == 0xbf800000L) - ? 1 : 0)); - - /* There are three cases for arithmetic right shift: */ - /* always correct, correct except for right-shifting a long by 1 */ - /* (a bug in some versions of the Turbo C compiler), and */ - /* never correct. */ - ars = (lr2 != -1 || ir1 != -1 || ir2 != -1 ? 0 : - lr1 != -1 ? 1 : /* Turbo C problem */ - 2); - fprintf(f, "#define arch_arith_rshift %d\n", ars); - /* Some machines can't handle a variable shift by */ - /* the full width of a long. */ - fprintf(f, "#define arch_can_shift_full_long %d\n", - um1 >> lwidth == 0); - -/* ---------------- Done. ---------------- */ - - fclose(f); - return exit_OK; -} diff --git a/pstoraster/ghost.h b/pstoraster/ghost.h deleted file mode 100644 index dc520b003d..0000000000 --- a/pstoraster/ghost.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 1989, 1992 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: ghost.h,v 1.2 2000/03/08 23:14:26 mike Exp $ */ -/* Common definitions for interpreter */ - -#ifndef ghost_INCLUDED -# define ghost_INCLUDED - -#include "gx.h" -#include "iref.h" - -#endif /* ghost_INCLUDED */ diff --git a/pstoraster/gp.h b/pstoraster/gp.h deleted file mode 100644 index 848b789d69..0000000000 --- a/pstoraster/gp.h +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (C) 1991, 1995, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp.h,v 1.2 2000/03/08 23:14:26 mike Exp $ */ -/* Interface to platform-specific routines */ -/* Requires gsmemory.h, gstypes.h */ - -#ifndef gp_INCLUDED -# define gp_INCLUDED - -/* - * This file defines the interface to ***ALL*** platform-specific routines, - * with the exception of the thread/synchronization interface (gpsync.h). - * The routines are implemented in a gp_*.c file specific to each platform. - * We try very hard to keep this list short! - */ -/* - * gp_getenv is declared in a separate file, because a few places need it - * and don't want to include any of the other gs definitions. - */ -#include "gpgetenv.h" - -/* ------ Initialization/termination ------ */ - -/* - * This routine is called early in the initialization. - * It should do as little as possible. In particular, it should not - * do things like open display connections: that is the responsibility - * of the display device driver. - */ -void gp_init(P0()); - -/* - * This routine is called just before the program exits (normally or - * abnormally). It too should do as little as possible. - */ -void gp_exit(P2(int exit_status, int code)); - -/* - * Exit the program. Normally this just calls the `exit' library procedure, - * but it does something different on a few platforms. - */ -void gp_do_exit(P1(int exit_status)); - -/* ------ Miscellaneous ------ */ - -/* - * Get the string corresponding to an OS error number. - * If no string is available, return NULL. The caller may assume - * the string is allocated statically and permanently. - */ -const char *gp_strerror(P1(int)); - -/* ------ Date and time ------ */ - -/* - * Read the current time (in seconds since an implementation-defined epoch) - * into ptm[0], and fraction (in nanoseconds) into ptm[1]. - */ -void gp_get_realtime(P1(long ptm[2])); - -/* - * Read the current user CPU time (in seconds) into ptm[0], - * and fraction (in nanoseconds) into ptm[1]. - */ -void gp_get_usertime(P1(long ptm[2])); - -/* ------ Screen management ------ */ - -/* - * The following routines are only relevant in a single-window environment - * such as a PC; on platforms with window systems, the 'make current' - * routines do nothing. - */ - -#ifndef gx_device_DEFINED -# define gx_device_DEFINED -typedef struct gx_device_s gx_device; - -#endif - -/* Initialize the console. */ -void gp_init_console(P0()); - -/* Write a string to the console. */ -void gp_console_puts(P2(const char *, uint)); - -/* Make the console current on the screen. */ -int gp_make_console_current(P1(gx_device *)); - -/* Make the graphics current on the screen. */ -int gp_make_graphics_current(P1(gx_device *)); - -/* - * The following are only relevant for X Windows. - */ - -/* Get the environment variable that specifies the display to use. */ -const char *gp_getenv_display(P0()); - -/* ------ File naming and accessing ------ */ - -/* - * Define the maximum size of a file name returned by gp_open_scratch_file - * or gp_open_printer. (This should really be passed as an additional - * parameter, but it would break too many clients to make this change now.) - * Note that this is the size of the buffer, not the maximum number of - * characters: the latter is one less, because of the terminating \0. - */ -#define gp_file_name_sizeof 128 - -/* Define the character used for separating file names in a list. */ -extern const char gp_file_name_list_separator; - -/* Define the default scratch file name prefix. */ -extern const char gp_scratch_file_name_prefix[]; - -/* Define the name of the null output file. */ -extern const char gp_null_file_name[]; - -/* Define the name that designates the current directory. */ -extern const char gp_current_directory_name[]; - -/* Define the string to be concatenated with the file mode */ -/* for opening files without end-of-line conversion. */ -/* This is always either "" or "b". */ -extern const char gp_fmode_binary_suffix[]; - -/* Define the file modes for binary reading or writing. */ -/* (This is just a convenience: they are "r" or "w" + the suffix.) */ -extern const char gp_fmode_rb[]; -extern const char gp_fmode_wb[]; - -/* Create and open a scratch file with a given name prefix. */ -/* Write the actual file name at fname. */ -FILE *gp_open_scratch_file(P3(const char *prefix, - char fname[gp_file_name_sizeof], - const char *mode)); - -/* Open a file with the given name, as a stream of uninterpreted bytes. */ -FILE *gp_fopen(P2(const char *fname, const char *mode)); - -/* Force given file into binary mode (no eol translations, etc) */ -/* if 2nd param true, text mode if 2nd param false */ -bool gp_setmode_binary(P2(FILE * pfile, bool mode)); - -/* Answer whether a file name contains a directory/device specification, */ -/* i.e. is absolute (not directory- or device-relative). */ -bool gp_file_name_is_absolute(P2(const char *fname, uint len)); - -/* Answer the string to be used for combining a directory/device prefix */ -/* with a base file name. The file name is known to not be absolute. */ -const char *gp_file_name_concat_string(P4(const char *prefix, uint plen, - const char *fname, uint len)); - -/* ------ Printer accessing ------ */ - -/* - * Open a connection to a printer. A null file name means use the - * standard printer connected to the machine, if any. - * If possible, support "|command" for opening an output pipe. - * Return NULL if the connection could not be opened. - * - * Note that if the file name is null (0-length), it may be replaced with - * the name of a scratch file. - */ -FILE *gp_open_printer(P2(char fname[gp_file_name_sizeof], int binary_mode)); - -/* Close the connection to the printer. */ -void gp_close_printer(P2(FILE * pfile, const char *fname)); - -/* ------ File enumeration ------ */ - -#ifndef file_enum_DEFINED /* also defined in iodev.h */ -# define file_enum_DEFINED -struct file_enum_s; /* opaque to client, defined by implementor */ -typedef struct file_enum_s file_enum; - -#endif - -/* - * Begin an enumeration. pat is a C string that may contain *s or ?s. - * The implementor should copy the string to a safe place. - * If the operating system doesn't support correct, arbitrarily placed - * *s and ?s, the implementation should modify the string so that it - * will return a conservative superset of the request, and then use - * the string_match procedure to select the desired subset. E.g., if the - * OS doesn't implement ? (single-character wild card), any consecutive - * string of ?s should be interpreted as *. Note that \ can appear in - * the pattern also, as a quoting character. - */ -file_enum *gp_enumerate_files_init(P3(const char *pat, uint patlen, - gs_memory_t * memory)); - -/* - * Return the next file name in the enumeration. The client passes in - * a scratch string and a max length. If the name of the next file fits, - * the procedure returns the length. If it doesn't fit, the procedure - * returns max length +1. If there are no more files, the procedure - * returns -1. - */ -uint gp_enumerate_files_next(P3(file_enum * pfen, char *ptr, uint maxlen)); - -/* - * Clean up a file enumeration. This is only called to abandon - * an enumeration partway through: ...next should do it if there are - * no more files to enumerate. This should deallocate the file_enum - * structure and any subsidiary structures, strings, buffers, etc. - */ -void gp_enumerate_files_close(P1(file_enum * pfen)); - -#endif /* gp_INCLUDED */ diff --git a/pstoraster/gp_getnv.c b/pstoraster/gp_getnv.c deleted file mode 100644 index 154c266668..0000000000 --- a/pstoraster/gp_getnv.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 1997 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_getnv.c,v 1.1 2000/03/08 23:14:26 mike Exp $ */ -/* Standard implementation of gp_getenv */ -#include "stdio_.h" -#include "string_.h" -#include "gsmemory.h" -#include "gstypes.h" -#include "gp.h" - -/* Import the C getenv function. */ -extern char *getenv(P1(const char *)); - -/* Get the value of an environment variable. See gp.h for details. */ -int -gp_getenv(const char *key, char *ptr, int *plen) -{ - const char *str = getenv(key); - - if (str) { - int len = strlen(str); - - if (len < *plen) { - /* string fits */ - strcpy(ptr, str); - *plen = len + 1; - return 0; - } - /* string doesn't fit */ - *plen = len + 1; - return -1; - } - /* missing key */ - if (*plen > 0) - *ptr = 0; - *plen = 1; - return 1; -} diff --git a/pstoraster/gp_nofb.c b/pstoraster/gp_nofb.c deleted file mode 100644 index 0d9cd416a8..0000000000 --- a/pstoraster/gp_nofb.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 1993 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_nofb.c,v 1.2 2000/03/08 23:14:26 mike Exp $ */ -/* Dummy routines for Ghostscript platforms with no frame buffer management */ -#include "gx.h" -#include "gp.h" -#include "gxdevice.h" - -/* ------ Screen management ------ */ - -/* Initialize the console. */ -void -gp_init_console(void) -{ -} - -/* Write a string to the console. */ -void -gp_console_puts(const char *str, uint size) -{ - fwrite(str, 1, size, stdout); -} - -/* Make the console current on the screen. */ -int -gp_make_console_current(gx_device * dev) -{ - return 0; -} - -/* Make the graphics current on the screen. */ -int -gp_make_graphics_current(gx_device * dev) -{ - return 0; -} diff --git a/pstoraster/gp_nsync.c b/pstoraster/gp_nsync.c deleted file mode 100644 index e5e5ca1114..0000000000 --- a/pstoraster/gp_nsync.c +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_nsync.c,v 1.1 2000/03/08 23:14:26 mike Exp $ */ -/* Dummy thread / semaphore / monitor implementation */ -#include "std.h" -#include "gserror.h" -#include "gserrors.h" -#include "gpsync.h" - -/* ------- Synchronization primitives -------- */ - -/* Semaphores */ - -uint -gp_semaphore_sizeof(void) -{ - return sizeof(gp_semaphore); -} - -int -gp_semaphore_open(gp_semaphore * sema) -{ - if (sema) - *(int *)sema = 0; - return 0; -} - -int -gp_semaphore_close(gp_semaphore * sema) -{ - return 0; -} - -int -gp_semaphore_wait(gp_semaphore * sema) -{ - if (*(int *)sema == 0) - return_error(gs_error_unknownerror); - --(*(int *)sema); - return 0; -} - -int -gp_semaphore_signal(gp_semaphore * sema) -{ - ++(*(int *)sema); - return 0; -} - -/* Monitors */ - -uint -gp_monitor_sizeof(void) -{ - return sizeof(gp_monitor); -} - -int -gp_monitor_open(gp_monitor * mon) -{ - if (mon) - mon->dummy_ = 0; - return 0; -} - -int -gp_monitor_close(gp_monitor * mon) -{ - return 0; -} - -int -gp_monitor_enter(gp_monitor * mon) -{ - if (mon->dummy_ != 0) - return_error(gs_error_unknownerror); - mon->dummy_ = &mon; - return 0; -} - -int -gp_monitor_leave(gp_monitor * mon) -{ - if (mon->dummy_ != &mon) - return_error(gs_error_unknownerror); - mon->dummy_ = 0; - return 0; -} - -/* Thread creation */ - -int -gp_create_thread(gp_thread_creation_callback_t proc, void *proc_data) -{ - /* Just call the procedure now. */ - (*proc)(proc_data); - return 0; -} diff --git a/pstoraster/gp_unifn.c b/pstoraster/gp_unifn.c deleted file mode 100644 index 9b75cd5b99..0000000000 --- a/pstoraster/gp_unifn.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 1994, 1996 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_unifn.c,v 1.2 2000/03/08 23:14:27 mike Exp $ */ -/* Unix-like file name syntax platform routines for Ghostscript */ -#include "gx.h" -#include "gp.h" - -/* Define the character used for separating file names in a list. */ -const char gp_file_name_list_separator = ':'; - -/* Define the string to be concatenated with the file mode */ -/* for opening files without end-of-line conversion. */ -const char gp_fmode_binary_suffix[] = ""; - -/* Define the file modes for binary reading or writing. */ -const char gp_fmode_rb[] = "r"; -const char gp_fmode_wb[] = "w"; - -/* Answer whether a file name contains a directory/device specification, */ -/* i.e. is absolute (not directory- or device-relative). */ -bool -gp_file_name_is_absolute(const char *fname, unsigned len) -{ /* A file name is absolute if it starts with a 0 or more .s */ - /* followed by a /. */ - while (len && *fname == '.') - ++fname, --len; - return (len && *fname == '/'); -} - -/* Answer the string to be used for combining a directory/device prefix */ -/* with a base file name. The file name is known to not be absolute. */ -const char * -gp_file_name_concat_string(const char *prefix, unsigned plen, - const char *fname, unsigned len) -{ - if (plen > 0 && prefix[plen - 1] == '/') - return ""; - return "/"; -} diff --git a/pstoraster/gp_unifs.c b/pstoraster/gp_unifs.c deleted file mode 100644 index 54045e6e31..0000000000 --- a/pstoraster/gp_unifs.c +++ /dev/null @@ -1,424 +0,0 @@ -/*Copyright 1993-2001 by Easy Software Products. - Copyright 1993, 1995, 1996, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_unifs.c,v 1.6 2001/03/02 17:35:03 mike Exp $ */ -/* "Unix-like" file system platform routines for Ghostscript */ -#include "memory_.h" -#include "string_.h" -#include "gx.h" -#include "gp.h" -#include "gsstruct.h" -#include "gsutil.h" /* for string_match */ -#include "stat_.h" -#include "dirent_.h" -#include /* for MAXPATHLEN */ -#include - -/* Some systems (Interactive for example) don't define MAXPATHLEN, - * so we define it here. (This probably should be done via a Config-Script.) - */ - -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 -#endif - -/* ------ File naming and accessing ------ */ - -/* Define the default scratch file name prefix. */ -const char gp_scratch_file_name_prefix[] = "gs_"; - -/* Define the name of the null output file. */ -const char gp_null_file_name[] = "/dev/null"; - -/* Define the name that designates the current directory. */ -const char gp_current_directory_name[] = "."; - -/* Create and open a scratch file with a given name prefix. */ -/* Write the actual file name at fname. */ -FILE * -gp_open_scratch_file(const char *prefix, char fname[gp_file_name_sizeof], - const char *mode) -{ - int fd; /* File descriptor for temp file */ - - - if ((fd = cupsTempFd(fname, gp_file_name_sizeof)) < 0) - return (NULL); - else - return (fdopen(fd, mode)); -} - -/* Open a file with the given name, as a stream of uninterpreted bytes. */ -FILE * -gp_fopen(const char *fname, const char *mode) -{ - return fopen(fname, mode); -} - -/* Set a file into binary or text mode. */ -int -gp_setmode_binary(FILE * pfile, bool mode) -{ - return 0; /* Noop under Unix */ -} - -/* ------ File enumeration ------ */ - -/* Thanks to Fritz Elfert (Fritz_Elfert@wue.maus.de) for */ -/* the original version of the following code, and Richard Mlynarik */ -/* (mly@adoc.xerox.com) for an improved version. */ - -typedef struct dirstack_s dirstack; -struct dirstack_s { - dirstack *next; - DIR *entry; -}; - -gs_private_st_ptrs1(st_dirstack, dirstack, "dirstack", - dirstack_enum_ptrs, dirstack_reloc_ptrs, next); - -struct file_enum_s { - DIR *dirp; /* pointer to current open directory */ - char *pattern; /* original pattern */ - char *work; /* current path */ - int worklen; /* strlen (work) */ - dirstack *dstack; /* directory stack */ - int patlen; - int pathead; /* how much of pattern to consider - * when listing files in current directory */ - bool first_time; - gs_memory_t *memory; -}; -gs_private_st_ptrs3(st_file_enum, struct file_enum_s, "file_enum", - file_enum_enum_ptrs, file_enum_reloc_ptrs, pattern, work, dstack); - -/* Private procedures */ - -/* Do a wild-card match. */ -#ifdef DEBUG -private bool -wmatch(const byte * str, uint len, const byte * pstr, uint plen, - const string_match_params * psmp) -{ - bool match = string_match(str, len, pstr, plen, psmp); - - if (gs_debug_c('e')) { - dlputs("[e]string_match(\""); - fwrite(str, 1, len, dstderr); - dputs("\", \""); - fwrite(pstr, 1, plen, dstderr); - dprintf1("\") = %s\n", (match ? "TRUE" : "false")); - } - return match; -} -#define string_match wmatch -#endif - -/* Search a string backward for a character. */ -/* (This substitutes for strrchr, which some systems don't provide.) */ -private char * -rchr(char *str, char ch, int len) -{ - register char *p = str + len; - - while (p > str) - if (*--p == ch) - return p; - return 0; -} - -/* Pop a directory from the enumeration stack. */ -private bool -popdir(file_enum * pfen) -{ - dirstack *d = pfen->dstack; - - if (d == 0) - return false; - pfen->dirp = d->entry; - pfen->dstack = d->next; - gs_free_object(pfen->memory, d, "gp_enumerate_files(popdir)"); - return true; -} - -/* Initialize an enumeration. */ -file_enum * -gp_enumerate_files_init(const char *pat, uint patlen, gs_memory_t * mem) -{ - file_enum *pfen; - char *p; - char *work; - - /* Reject attempts to enumerate paths longer than the */ - /* system-dependent limit. */ - if (patlen > MAXPATHLEN) - return 0; - - /* Reject attempts to enumerate with a pattern containing zeroes. */ - { - const char *p1; - - for (p1 = pat; p1 < pat + patlen; p1++) - if (*p1 == 0) - return 0; - } - /* >>> Should crunch strings of repeated "/"'s in pat to a single "/" - * >>> to match stupid unix filesystem "conventions" */ - - pfen = gs_alloc_struct(mem, file_enum, &st_file_enum, - "gp_enumerate_files"); - if (pfen == 0) - return 0; - - /* pattern and work could be allocated as strings, */ - /* but it's simpler for GC and freeing to allocate them as bytes. */ - - pfen->pattern = - (char *)gs_alloc_bytes(mem, patlen + 1, - "gp_enumerate_files(pattern)"); - if (pfen->pattern == 0) - return 0; - memcpy(pfen->pattern, pat, patlen); - pfen->pattern[patlen] = 0; - - work = (char *)gs_alloc_bytes(mem, MAXPATHLEN + 1, - "gp_enumerate_files(work)"); - if (work == 0) - return 0; - pfen->work = work; - - p = work; - memcpy(p, pat, patlen); - p += patlen; - *p = 0; - - /* Remove directory specifications beyond the first wild card. */ - /* Some systems don't have strpbrk, so we code it open. */ - p = pfen->work; - while (!(*p == '*' || *p == '?' || *p == 0)) - p++; - while (!(*p == '/' || *p == 0)) - p++; - if (*p == '/') - *p = 0; - /* Substring for first wildcard match */ - pfen->pathead = p - work; - - /* Select the next higher directory-level. */ - p = rchr(work, '/', p - work); - if (!p) { /* No directory specification */ - work[0] = 0; - pfen->worklen = 0; - } else { - if (p == work) { /* Root directory -- don't turn "/" into "" */ - p++; - } - *p = 0; - pfen->worklen = p - work; - } - - pfen->memory = mem; - pfen->dstack = 0; - pfen->first_time = true; - pfen->patlen = patlen; - return pfen; -} - -/* Enumerate the next file. */ -uint -gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen) -{ - const dir_entry *de; - char *work = pfen->work; - int worklen = pfen->worklen; - char *pattern = pfen->pattern; - int pathead = pfen->pathead; - int len; - struct stat stbuf; - - if (pfen->first_time) { - pfen->dirp = ((worklen == 0) ? opendir(".") : opendir(work)); - if_debug1('e', "[e]file_enum:First-Open '%s'\n", work); - pfen->first_time = false; - if (pfen->dirp == 0) { /* first opendir failed */ - gp_enumerate_files_close(pfen); - return ~(uint) 0; - } - } - top:de = readdir(pfen->dirp); - if (de == 0) { /* No more entries in this directory */ - char *p; - - if_debug0('e', "[e]file_enum:Closedir\n"); - closedir(pfen->dirp); - /* Back working directory and matching pattern up one level */ - p = rchr(work, '/', worklen); - if (p != 0) { - if (p == work) - p++; - *p = 0; - worklen = p - work; - } else - worklen = 0; - p = rchr(pattern, '/', pathead); - if (p != 0) - pathead = p - pattern; - else - pathead = 0; - - if (popdir(pfen)) { /* Back up the directory tree. */ - if_debug1('e', "[e]file_enum:Dir popped '%s'\n", work); - goto top; - } else { - if_debug0('e', "[e]file_enum:Dirstack empty\n"); - gp_enumerate_files_close(pfen); - return ~(uint) 0; - } - } - /* Skip . and .. */ - len = strlen(de->d_name); - if (len <= 2 && (!strcmp(de->d_name, ".") || !strcmp(de->d_name, ".."))) - goto top; - if (len + worklen + 1 > MAXPATHLEN) - /* Should be an error, I suppose */ - goto top; - if (worklen == 0) { /* "Current" directory (evil un*x kludge) */ - memcpy(work, de->d_name, len + 1); - } else if (worklen == 1 && work[0] == '/') { /* Root directory */ - memcpy(work + 1, de->d_name, len + 1); - len = len + 1; - } else { - work[worklen] = '/'; - memcpy(work + worklen + 1, de->d_name, len + 1); - len = worklen + 1 + len; - } - - /* Test for a match at this directory level */ - if (!string_match((byte *) work, len, (byte *) pattern, pathead, NULL)) - goto top; - - /* Perhaps descend into subdirectories */ - if (pathead < pfen->patlen) { - DIR *dp; - - if (((stat(work, &stbuf) >= 0) - ? !stat_is_dir(stbuf) - /* Couldn't stat it. - * Well, perhaps it's a directory and - * we'll be able to list it anyway. - * If it isn't or we can't, no harm done. */ - : 0)) - goto top; - - if (pfen->patlen == pathead + 1) { /* Listing "foo/?/" -- return this entry */ - /* if it's a directory. */ - if (!stat_is_dir(stbuf)) { /* Do directoryp test the hard way */ - dp = opendir(work); - if (!dp) - goto top; - closedir(dp); - } - work[len++] = '/'; - goto winner; - } - /* >>> Should optimise the case in which the next level */ - /* >>> of directory has no wildcards. */ - dp = opendir(work); -#ifdef DEBUG - { - char save_end = pattern[pathead]; - - pattern[pathead] = 0; - if_debug2('e', "[e]file_enum:fname='%s', p='%s'\n", - work, pattern); - pattern[pathead] = save_end; - } -#endif /* DEBUG */ - if (!dp) - /* Can't list this one */ - goto top; - else { /* Advance to the next directory-delimiter */ - /* in pattern */ - char *p; - dirstack *d; - - for (p = pattern + pathead + 1;; p++) { - if (*p == 0) { /* No more subdirectories to match */ - pathead = pfen->patlen; - break; - } else if (*p == '/') { - pathead = p - pattern; - break; - } - } - - /* Push a directory onto the enumeration stack. */ - d = gs_alloc_struct(pfen->memory, dirstack, - &st_dirstack, - "gp_enumerate_files(pushdir)"); - if (d != 0) { - d->next = pfen->dstack; - d->entry = pfen->dirp; - pfen->dstack = d; - } else - DO_NOTHING; /* >>> e_VMerror!!! */ - - if_debug1('e', "[e]file_enum:Dir pushed '%s'\n", - work); - worklen = len; - pfen->dirp = dp; - goto top; - } - } - winner: - /* We have a winner! */ - pfen->worklen = worklen; - pfen->pathead = pathead; - memcpy(ptr, work, len); - return len; -} - -/* Clean up the file enumeration. */ -void -gp_enumerate_files_close(file_enum * pfen) -{ - gs_memory_t *mem = pfen->memory; - - if_debug0('e', "[e]file_enum:Cleanup\n"); - while (popdir(pfen)) /* clear directory stack */ - DO_NOTHING; - gs_free_object(mem, (byte *) pfen->work, - "gp_enumerate_close(work)"); - gs_free_object(mem, (byte *) pfen->pattern, - "gp_enumerate_files_close(pattern)"); - gs_free_object(mem, pfen, "gp_enumerate_files_close"); -} - -/* Test-cases: - (../?*r*?/?*.ps) {==} 100 string filenameforall - (../?*r*?/?*.ps*) {==} 100 string filenameforall - (../?*r*?/) {==} 100 string filenameforall - (/t*?/?*.ps) {==} 100 string filenameforall - */ diff --git a/pstoraster/gp_unix.c b/pstoraster/gp_unix.c deleted file mode 100644 index 4f1294bd35..0000000000 --- a/pstoraster/gp_unix.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright (C) 1989, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gp_unix.c,v 1.2 2000/03/08 23:14:27 mike Exp $ */ -/* Unix-specific routines for Ghostscript */ -#include "pipe_.h" -#include "string_.h" -#include "time_.h" -#include "gx.h" -#include "gsexit.h" -#include "gp.h" - -/* - * This is the only place in Ghostscript that calls 'exit'. Including - * is overkill, but that's where it's declared on ANSI systems. - * We don't have any way of detecting whether we have a standard library - * (some GNU compilers perversely define __STDC__ but don't provide - * an ANSI-compliant library), so we check __PROTOTYPES__ and - * hope for the best. We pick up getenv at the same time. - */ -#ifdef __PROTOTYPES__ -# include /* for exit and getenv */ -#else -extern void exit(P1(int)); -extern char *getenv(P1(const char *)); - -#endif - -/* Do platform-dependent initialization. */ -void -gp_init(void) -{ -} - -/* Do platform-dependent cleanup. */ -void -gp_exit(int exit_status, int code) -{ -} - -/* Exit the program. */ -void -gp_do_exit(int exit_status) -{ - exit(exit_status); -} - -/* ------ Miscellaneous ------ */ - -/* Get the string corresponding to an OS error number. */ -/* Unix systems support this so inconsistently that we don't attempt */ -/* to figure out whether it's available. */ -const char * -gp_strerror(int errnum) -{ - return NULL; -} - -/* ------ Date and time ------ */ - -/* Read the current time (in seconds since Jan. 1, 1970) */ -/* and fraction (in nanoseconds). */ -void -gp_get_realtime(long *pdt) -{ - struct timeval tp; - -#if gettimeofday_no_timezone /* older versions of SVR4 */ - { - if (gettimeofday(&tp) == -1) { - lprintf("Ghostscript: gettimeofday failed!\n"); - gs_exit(1); - } - } -#else /* All other systems */ - { - struct timezone tzp; - - if (gettimeofday(&tp, &tzp) == -1) { - lprintf("Ghostscript: gettimeofday failed!\n"); - gs_exit(1); - } - } -#endif - - /* tp.tv_sec is #secs since Jan 1, 1970 */ - pdt[0] = tp.tv_sec; - - /* Some Unix systems (e.g., Interactive 3.2 r3.0) return garbage */ - /* in tp.tv_usec. Try to filter out the worst of it here. */ - pdt[1] = tp.tv_usec >= 0 && tp.tv_usec < 1000000 ? tp.tv_usec * 1000 : 0; - -#ifdef DEBUG_CLOCK - printf("tp.tv_sec = %d tp.tv_usec = %d pdt[0] = %ld pdt[1] = %ld\n", - tp.tv_sec, tp.tv_usec, pdt[0], pdt[1]); -#endif -} - -/* Read the current user CPU time (in seconds) */ -/* and fraction (in nanoseconds). */ -void -gp_get_usertime(long *pdt) -{ -#if use_times_for_usertime - struct tms tms; - long ticks; - const long ticks_per_sec = CLK_TCK; - - times(&tms); - ticks = tms.tms_utime + tms.tms_stime + tms.tms_cutime + tms.tms_cstime; - pdt[0] = ticks / ticks_per_sec; - pdt[1] = (ticks % ticks_per_sec) * (1000000000 / ticks_per_sec); -#else - gp_get_realtime(pdt); /* Use an approximation on other hosts. */ -#endif -} - -/* ------ Screen management ------ */ - -/* Get the environment variable that specifies the display to use. */ -const char * -gp_getenv_display(void) -{ - return getenv("DISPLAY"); -} - -/* ------ Printer accessing ------ */ - -/* Open a connection to a printer. A null file name means use the */ -/* standard printer connected to the machine, if any. */ -/* "|command" opens an output pipe. */ -/* Return NULL if the connection could not be opened. */ -FILE * -gp_open_printer(char fname[gp_file_name_sizeof], int binary_mode) -{ - return - (strlen(fname) == 0 ? - gp_open_scratch_file(gp_scratch_file_name_prefix, fname, "w") : - fname[0] == '|' ? - popen(fname + 1, "w") : - fopen(fname, "w")); -} - -/* Close the connection to the printer. */ -void -gp_close_printer(FILE * pfile, const char *fname) -{ - if (fname[0] == '|') - pclose(pfile); - else - fclose(pfile); -} diff --git a/pstoraster/gpcheck.h b/pstoraster/gpcheck.h deleted file mode 100644 index 4da0da6f79..0000000000 --- a/pstoraster/gpcheck.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 1992, 1994 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gpcheck.h,v 1.2 2000/03/08 23:14:27 mike Exp $ */ -/* Interrupt check interface */ - -#ifndef gpcheck_INCLUDED -# define gpcheck_INCLUDED - -/* - * On some platforms, the interpreter must check periodically for user- - * initiated actions. (Eventually, this may be extended to all platforms, - * to handle multi-tasking through the 'context' facility.) Routines that - * run for a long time must periodically call gp_check_interrupts(), and - * if it returns true, must clean up whatever they are doing and return an - * e_interrupted (or gs_error_interrupted) exceptional condition. - * The return_if_interrupt macro provides a convenient way to do this. - * - * On platforms that require an interrupt check, the makefile defines - * a symbol CHECK_INTERRUPTS. Currently this is only the Microsoft - * Windows platform. - */ - -#ifdef CHECK_INTERRUPTS -int gp_check_interrupts(P0()); -int gs_return_check_interrupt(P1(int code)); - -# define process_interrupts() discard(gp_check_interrupts()) -# define return_if_interrupt()\ - { int icode_ = gp_check_interrupts();\ - if ( icode_ )\ - return gs_note_error((icode_ > 0 ? gs_error_interrupt : icode_));\ - } -# define return_check_interrupt(code)\ - return gs_return_check_interrupt(code) -#else -# define gp_check_interrupts() 0 -# define process_interrupts() DO_NOTHING -# define return_if_interrupt() DO_NOTHING -# define return_check_interrupt(code)\ - return (code) -#endif - -#endif /* gpcheck_INCLUDED */ diff --git a/pstoraster/gpgetenv.h b/pstoraster/gpgetenv.h deleted file mode 100644 index 2da20e0e2d..0000000000 --- a/pstoraster/gpgetenv.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gpgetenv.h,v 1.1 2000/03/13 19:00:47 mike Exp $ */ -/* Interface to platform-specific getenv routine */ - -#ifndef gpgetenv_INCLUDED -# define gpgetenv_INCLUDED - -/* - * Get a value from the environment (getenv). - * - * If the key is missing, set *ptr = 0 (if *plen > 0), set *plen = 1, - * and return 1. - * - * If the key is present and the length len of the value (not counting - * the terminating \0) is less than *plen, copy the value to ptr, set - * *plen = len + 1, and return 0. - * - * If the key is present and len >= *plen, set *plen = len + 1, - * don't store anything at ptr, and return -1. - * - * Note that *plen is the size of the buffer, not the length of the string: - * because of the terminating \0, the maximum string length is 1 less than - * the size of the buffer. - */ -int gp_getenv(P3(const char *key, char *ptr, int *plen)); - -#endif /* gpgetenv_INCLUDED */ diff --git a/pstoraster/gpsync.h b/pstoraster/gpsync.h deleted file mode 100644 index 07411c5413..0000000000 --- a/pstoraster/gpsync.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 1998 Aladdin Enterprises. All rights reserved. - - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given - to you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises supports the work of the GNU Project, but is not - affiliated with the Free Software Foundation or the GNU Project. GNU - Ghostscript, as distributed by Aladdin Enterprises, does not require any - GNU software to build or run it. -*/ - -/*$Id: gpsync.h,v 1.2 2001/01/04 17:33:52 mike Exp $ */ -/* Interface to platform-dependent synchronization primitives */ - -#if !defined(gpsync_INCLUDED) -#define gpsync_INCLUDED - -/* Initial version 4/1/98 by John Desrosiers (soho@crl.com). */ -/* 8/9/98 L. Peter Deutsch (ghost@aladdin.com) Changed ...sizeof to - procedures, added some comments. */ - -/* -------- Synchronization primitives ------- */ - -/* - * Semaphores support wait/signal semantics: a wait operation will allow - * control to proceed iff the number of signals since semaphore creation - * is greater than the number of waits. - */ -typedef struct { - void *dummy_; -} gp_semaphore; - -uint gp_semaphore_sizeof(P0()); -/* - * Hack: gp_semaphore_open(0) succeeds iff it's OK for the memory manager - * to move a gp_semaphore in memory. - */ -int gp_semaphore_open(P1(gp_semaphore * sema)); -int gp_semaphore_close(P1(gp_semaphore * sema)); -int gp_semaphore_wait(P1(gp_semaphore * sema)); -int gp_semaphore_signal(P1(gp_semaphore * sema)); - -/* - * Monitors support enter/leave semantics: at most one thread can have - * entered and not yet left a given monitor. - */ -typedef struct { - void *dummy_; -} gp_monitor; - -uint gp_monitor_sizeof(P0()); -/* - * Hack: gp_monitor_open(0) succeeds iff it's OK for the memory manager - * to move a gp_monitor in memory. - */ -int gp_monitor_open(P1(gp_monitor * mon)); -int gp_monitor_close(P1(gp_monitor * mon)); -int gp_monitor_enter(P1(gp_monitor * mon)); -int gp_monitor_leave(P1(gp_monitor * mon)); - -/* - * A new thread starts by calling a procedure, passing it a void * that - * allows it to gain access to whatever data it needs. - */ -typedef void (*gp_thread_creation_callback_t) (P1(void *)); -int gp_create_thread(P2(gp_thread_creation_callback_t, void *)); - -#endif /* !defined(gpsync_INCLUDED) */ diff --git a/pstoraster/gs_btokn.ps b/pstoraster/gs_btokn.ps deleted file mode 100644 index 7061ec67a4..0000000000 --- a/pstoraster/gs_btokn.ps +++ /dev/null @@ -1,313 +0,0 @@ -% Copyright 1993-2001 by Easy Software Products. -% Copyright 1994, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_btokn.ps,v 1.4 2001/03/02 22:34:19 andy Exp $ -% Initialization file for binary tokens. -% When this is run, systemdict is still writable, -% but everything defined here goes into level2dict. - -% Define whether or not to allow writing dictionaries. -/WRITEDICTS true def - -languagelevel 1 .setlanguagelevel -level2dict begin - -% Initialization for the system name table. - -mark -% 0 - /abs /add /aload /anchorsearch /and - /arc /arcn /arct /arcto /array - /ashow /astore /awidthshow /begin /bind - /bitshift /ceiling /charpath /clear /cleartomark -% 20 - /clip /clippath /closepath /concat /concatmatrix - /copy /count /counttomark /currentcmykcolor /currentdash - /currentdict /currentfile /currentfont /currentgray /currentgstate - /currenthsbcolor /currentlinecap /currentlinejoin /currentlinewidth /currentmatrix -% 40 - /currentpoint /currentrgbcolor /currentshared /curveto /cvi - /cvlit /cvn /cvr /cvrs /cvs - /cvx /def /defineusername /dict /div - /dtransform /dup /end /eoclip /eofill -% 60 - /eoviewclip /eq /exch /exec /exit - /file /fill /findfont /flattenpath /floor - /flush /flushfile /for /forall /ge - /get /getinterval /grestore /gsave /gstate -% 80 - /gt /identmatrix /idiv /idtransform /if - /ifelse /image /imagemask /index /ineofill - /infill /initviewclip /inueofill /inufill /invertmatrix - /itransform /known /le /length /lineto -% 100 - /load /loop /lt /makefont /matrix - /maxlength /mod /moveto /mul /ne - /neg /newpath /not /null /or - /pathbbox /pathforall /pop /print /printobject -% 120 - /put /putinterval /rcurveto /read /readhexstring - /readline /readstring /rectclip /rectfill /rectstroke - /rectviewclip /repeat /restore /rlineto /rmoveto - /roll /rotate /round /save /scale -% 140 - /scalefont /search /selectfont /setbbox /setcachedevice - /setcachedevice2 /setcharwidth /setcmykcolor /setdash /setfont - /setgray /setgstate /sethsbcolor /setlinecap /setlinejoin - /setlinewidth /setmatrix /setrgbcolor /setshared /shareddict -% 160 - /show /showpage /stop /stopped /store - /string /stringwidth /stroke /strokepath /sub - /systemdict /token /transform /translate /truncate - /type /uappend /ucache /ueofill /ufill -% 180 - /undef /upath /userdict /ustroke /viewclip - /viewclippath /where /widthshow /write /writehexstring - /writeobject /writestring /wtranslation /xor /xshow - /xyshow /yshow /FontDirectory /SharedFontDirectory /Courier -% 200 - /Courier-Bold /Courier-BoldOblique /Courier-Oblique /Helvetica /Helvetica-Bold - /Helvetica-BoldOblique /Helvetica-Oblique /Symbol /Times-Bold /Times-BoldItalic - /Times-Italic /Times-Roman /execuserobject /currentcolor /currentcolorspace - /currentglobal /execform /filter /findresource /globaldict -% 220 - /makepattern /setcolor /setcolorspace /setglobal /setpagedevice - /setpattern -% pad to 256 - counttomark 256 exch sub { 0 } repeat -% 256 - /= /== /ISOLatin1Encoding /StandardEncoding -% 260 - ([) cvn (]) cvn /atan /banddevice /bytesavailable - /cachestatus /closefile /colorimage /condition /copypage - /cos /countdictstack /countexecstack /cshow /currentblackgeneration - /currentcacheparams /currentcolorscreen /currentcolortransfer /currentcontext /currentflat -% 280 - /currenthalftone /currenthalftonephase /currentmiterlimit /currentobjectformat /currentpacking - /currentscreen /currentstrokeadjust /currenttransfer /currentundercolorremoval /defaultmatrix - /definefont /deletefile /detach /deviceinfo /dictstack - /echo /erasepage /errordict /execstack /executeonly -% 300 - /exp /false /filenameforall /fileposition /fork - /framedevice /grestoreall /handleerror /initclip /initgraphics - /initmatrix /instroke /inustroke /join /kshow - /ln /lock /log /mark /monitor -% 320 - /noaccess /notify /nulldevice /packedarray /quit - /rand /rcheck /readonly /realtime /renamefile - /renderbands /resetfile /reversepath /rootfont /rrand - /run /scheck /setblackgeneration /setcachelimit /setcacheparams -% 340 - /setcolorscreen /setcolortransfer /setfileposition /setflat /sethalftone - /sethalftonephase /setmiterlimit /setobjectformat /setpacking /setscreen - /setstrokeadjust /settransfer /setucacheparams /setundercolorremoval /sin - /sqrt /srand /stack /status /statusdict -% 360 - /true /ucachestatus /undefinefont /usertime /ustrokepath - /version /vmreclaim /vmstatus /wait /wcheck - /xcheck /yield /defineuserobject /undefineuserobject /UserObjects - /cleardictstack -% 376 - /A /B /C /D /E /F /G /H /I /J /K /L /M - /N /O /P /Q /R /S /T /U /V /W /X /Y /Z - /a /b /c /d /e /f /g /h /i /j /k /l /m - /n /o /p /q /r /s /t /u /v /w /x /y /z -% 428 - /setvmthreshold (<<) cvn - (>>) cvn /currentcolorrendering /currentdevparams /currentoverprint /currentpagedevice - /currentsystemparams /currentuserparams /defineresource /findencoding /gcheck -% 440 - /glyphshow /languagelevel /product /pstack /resourceforall - /resourcestatus /revision /serialnumber /setcolorrendering /setdevparams - /setoverprint /setsystemparams /setuserparams /startjob /undefineresource - /GlobalFontDirectory /ASCII85Decode /ASCII85Encode /ASCIIHexDecode /ASCIIHexEncode -% 460 - /CCITTFaxDecode /CCITTFaxEncode /DCTDecode /DCTEncode /LZWDecode - /LZWEncode /NullEncode /RunLengthDecode /RunLengthEncode /SubFileDecode - /CIEBasedA /CIEBasedABC /DeviceCMYK /DeviceGray /DeviceRGB - /Indexed /Pattern /Separation -% 478 -- end -.packtomark -dup /SystemNames exch def .installsystemnames - -% Define printobject and writeobject. -% These are mostly implemented in PostScript, so that we don't have to -% worry about interrupts or callbacks when writing to the output file. - -% Define procedures for accumulating the space required to represent -% an object in binary form. -/cntdict mark % <#refs> <#chars> -proc- <#refs> <#chars> - /integertype /pop load - /realtype 1 index - /marktype 1 index - /nulltype 1 index - /booleantype 1 index - /nametype { length add } bind - /stringtype 1 index - /arraytype null - WRITEDICTS { /dicttype null } if -.dicttomark def -cntdict /arraytype - { dup dup length 5 -1 roll add 4 2 roll - { dup type //cntdict exch get exec } forall - } bind put -WRITEDICTS - { cntdict /dicttype - { dup dup length 2 mul 5 -1 roll add 4 2 roll - { 4 1 roll dup type //cntdict exch get exec - 3 -1 roll dup type //cntdict exch get exec - } forall - } bind put - } if - -/w2dict mark - /nametype { 2 copy .writecvs pop } bind - /stringtype 1 index -.dicttomark def - -/.bosheader { % .bosheader - % - dup 0 currentobjectformat 127 add put % object format => BOS tag - 2 index 255 le 2 index 65531 le and { - % Use the short header format: tag toplen(1) totlen(2) - exch 4 add exch - 0 4 getinterval - dup 1 5 -1 roll put - } { - % Use the long header format: tag 0(1) toplen(2) totlen(4) - exch 8 add exch - 0 0 4 2 roll .bosobject exch pop exch pop % store with byte swapping - } ifelse % Stack: shortlen str - exch dup -8 bitshift exch 255 and % str hibyte lobyte - currentobjectformat 1 and 0 eq { % lsb first - exch - } if - 2 index 3 3 -1 roll put - 1 index 2 3 -1 roll put -} .bind def - -/.writeobjects % .writeobjects - - { - mark exch - - % Count the space required for refs and strings. - dup length 0 3 -1 roll - % Stack: -mark- <#refs> <#chars> - - dup 4 1 roll - { dup type //cntdict exch get exec - } forall - - % Write the header. - % Stack: -mark- ... <#refs> <#chars> - counttomark 3 add -2 roll 4 1 roll - % Stack: -mark- ... <#refs> <#chars> - dup counttomark 1 sub index length - 4 index 3 bitshift 4 index add - (xxxxxxxx) .bosheader writestring - - % Write the objects per se. - 3 1 roll pop - counttomark 1 sub index length 3 bitshift exch - 3 bitshift - % Stack: -mark- ... - - counttomark 4 sub - { counttomark -1 roll dup 6 1 roll - dup type /dicttype eq % can't be first object - { { 5 1 roll (xxxxxxxx) .bosobject - 3 index exch writestring - 4 -1 roll (xxxxxxxx) .bosobject - 3 index exch writestring - } forall - } - { { (xxxxxxxx) .bosobject - dup 1 6 index put - 3 index exch writestring - 4 -1 roll pop 0 4 1 roll % clear tag - } forall - } - ifelse - } - repeat - - % Write the strings and names. - pop pop exch pop - % Stack: -mark- ... - - counttomark 1 sub - { counttomark -1 roll - { % The counting pass ensured that the keys and values - % of any dictionary must be writable objects. - % Hence, we are processing a dictionary iff - % the next-to-top stack element is not a file. - 1 index type /filetype ne - { exch 2 index exch dup type //w2dict exch .knownget - { exec } { pop } ifelse pop - } - if - dup type //w2dict exch .knownget { exec } { pop } ifelse - } forall - } - repeat - - % Clean up. - % Stack: -mark- - - pop pop - - } odef -currentdict /cntdict .undef -currentdict /w2dict .undef - -%%%% MRS - stderr instead of stdout, which is used for output... -/printobject { % printobject - - (%stderr) (w) file 2 index 2 index writeobject pop pop -} odef -/writeobject { % writeobject - - 3 copy exch - % We must allocate the array in local VM - % to avoid a possible invalidaccess. - .currentglobal false .setglobal exch 1 array astore exch .setglobal - .writeobjects pop pop pop -} odef - -% Implement binary error message output. - /.printerror - { $error /binary get .languagelevel 2 ge and - { currentobjectformat 0 ne - { [ /Error $error /errorname get $error /command get false - ] 250 printobject - } - //.printerror - ifelse - } - //.printerror - ifelse - } bind def - -% End of level2dict - -end -.setlanguagelevel diff --git a/pstoraster/gs_ccfnt.ps b/pstoraster/gs_ccfnt.ps deleted file mode 100644 index 204aba3814..0000000000 --- a/pstoraster/gs_ccfnt.ps +++ /dev/null @@ -1,100 +0,0 @@ -% Copyright (C) 1994, 1996 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_ccfnt.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% Find and register all the precompiled font operators in systemdict. - -/registerfont % registerfont - { DEBUG { (Registering ) print 1 index = } if - dup begin - Encoding type /nametype eq - { Encoding .findencoding /Encoding exch def - } - if - dup /PrefEnc known - { PrefEnc type /nametype eq - { PrefEnc .findencoding /PrefEnc exch def - } - if - } - if - dup /FDepVector known - { /FDepVector [ FDepVector - { .FontDirectory 1 index .knownget - { exch pop } - { ccfonts 1 index .knownget - { registerfont - } - { Fontmap 1 index known - { findfont } - { pop NullFont } - ifelse - } - ifelse - } - ifelse - } - forall ] readonly def - } - if - end - % Use the value of definefont appropriate at run-time, not bind-time - /definefont load exec - } bind odef -% Bind recursive call (bind descends into oparrays: feature!) -/registerfont dup load bind def - -/.loadinitialfonts { - //.loadinitialfonts exec - /ccfonts mark - 0 1 null .getccfont 1 sub { .getccfont dup /FontName get exch } for - .dicttomark def - ccfonts - { .FontDirectory 2 index known { pop pop } { registerfont pop } ifelse } - forall - currentdict /ccfonts .undef -} bind def - -currentdict /registerfont .undef - - -% If we're in a Level 2 system but running in Level 1 mode, -% register the fonts explicitly as resources. -% This is a bit of a hack, but doing better is too much work. - -/level2dict where - { pop /findresource where - { % Level 2 system, Level 2 mode - pop - } - { % Level 2 system, Level 1 mode - /Font /Category level2dict /findresource get exec begin - .FontDirectory - { dup .gcheck { Instances } { LocalInstances } ifelse - 3 1 roll [exch 0 -1] .growput - } - forall end - } - ifelse - } -if diff --git a/pstoraster/gs_cff.ps b/pstoraster/gs_cff.ps deleted file mode 100644 index 18f92ee67a..0000000000 --- a/pstoraster/gs_cff.ps +++ /dev/null @@ -1,614 +0,0 @@ -% Copyright (C) 1997 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_cff.ps,v 1.2 2000/06/26 15:50:17 mike Exp $ -% Loader for CFF (compressed) fonts. -% The following are not implemented yet: -% Deleted entries in the Name Index -% Embedded PostScript -% Multiple Master fonts -% CIDFonts -% Chameleon fonts -% Synthetic fonts -% Also, Type 2 charstrings are converted into Type 1 fonts with -% CharstringType = 2, which may or may not be supported. - -100 dict begin - -% ---------------- Standard strings (actually names) ---------------- % - -/StandardStrings mark -% 0 - /.notdef /space /exclam /quotedbl /numbersign - /dollar /percent /ampersand /quoteright /parenleft - /parenright /asterisk /plus /comma /hyphen - /period /slash /zero /one /two - /three /four /five /six /seven - /eight /nine /colon /semicolon /less - /equal /greater /question /at /A - /B /C /D /E /F - /G /H /I /J /K - /L /M /N /O /P -% 50 - /Q /R /S /T /U - /V /W /X /Y /Z - /bracketleft /backslash /bracketright /asciicircum /underscore - /quoteleft /a /b /c /d - /e /f /g /h /i - /j /k /l /m /n - /o /p /q /r /s - /t /u /v /w /x - /y /z /braceleft /bar /braceright - /asciitilde /exclamdown /cent /sterling /fraction -% 100 - /yen /florin /section /currency /quotesingle - /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi - /fl /endash /dagger /daggerdbl /periodcentered - /paragraph /bullet /quotesinglbase /quotedblbase /quotedblright - /guillemotright /ellipsis /perthousand /questiondown /grave - /acute /circumflex /tilde /macron /breve - /dotaccent /dieresis /ring /cedilla /hungarumlaut - /ogonek /caron /emdash /AE /ordfeminine - /Lslash /Oslash /OE /ordmasculine /ae - /dotlessi /lslash /oslash /oe /germandbls -% 150 - /onesuperior /logicalnot /mu /trademark /Eth - /onehalf /plusminus /Thorn /onequarter /divide - /brokenbar /degree /thorn /threequarters /twosuperior - /registered /minus /eth /multiply /threesuperior - /copyright /Aacute /Acircumflex /Adieresis /Agrave - /Aring /Atilde /Ccedilla /Eacute /Ecircumflex - /Edieresis /Egrave /Iacute /Icircumflex /Idieresis - /Igrave /Ntilde /Oacute /Ocircumflex /Odieresis - /Ograve /Otilde /Scaron /Uacute /Ucircumflex - /Udieresis /Ugrave /Yacute /Ydieresis /Zcaron -% 200 - /aacute /acircumflex /adieresis /agrave /aring - /atilde /ccedilla /eacute /ecircumflex /edieresis - /egrave /iacute /icircumflex /idieresis /igrave - /ntilde /oacute /ocircumflex /odieresis /ograve - /otilde /scaron /uacute /ucircumflex /udieresis - /ugrave /yacute /ydieresis /zcaron /exclamsmall - /Hungarumlautsmall /dollaroldstyle /dollarsuperior /ampersandsmall /Acutesmall - /parenleftsuperior /parenrightsuperior /twodotenleader /onedotenleader /zerooldstyle - /oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle - /sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /commasuperior -% 250 - /threequartersemdash /periodsuperior /questionsmall /asuperior /bsuperior - /centsuperior /dsuperior /esuperior /isuperior /lsuperior - /msuperior /nsuperior /osuperior /rsuperior /ssuperior - /tsuperior /ff /ffi /ffl /parenleftinferior - /parenrightinferior /Circumflexsmall /hyphensuperior /Gravesmall /Asmall - /Bsmall /Csmall /Dsmall /Esmall /Fsmall - /Gsmall /Hsmall /Ismall /Jsmall /Ksmall - /Lsmall /Msmall /Nsmall /Osmall /Psmall - /Qsmall /Rsmall /Ssmall /Tsmall /Usmall - /Vsmall /Wsmall /Xsmall /Ysmall /Zsmall -% 300 - /colonmonetary /onefitted /rupiah /Tildesmall /exclamdownsmall - /centoldstyle /Lslashsmall /Scaronsmall /Zcaronsmall /Dieresissmall - /Brevesmall /Caronsmall /Dotaccentsmall /Macronsmall /figuredash - /hypheninferior /Ogoneksmall /Ringsmall /Cedillasmall /questiondownsmall - /oneeighth /threeeighths /fiveeighths /seveneighths /onethird - /twothirds /zerosuperior /foursuperior /fivesuperior /sixsuperior - /sevensuperior /eightsuperior /ninesuperior /zeroinferior /oneinferior - /twoinferior /threeinferior /fourinferior /fiveinferior /sixinferior - /seveninferior /eightinferior /nineinferior /centinferior /dollarinferior - /periodinferior /commainferior /Agravesmall /Aacutesmall /Acircumflexsmall -% 350 - /Atildesmall /Adieresissmall /Aringsmall /AEsmall /Ccedillasmall - /Egravesmall /Eacutesmall /Ecircumflexsmall /Edieresissmall /Igravesmall - /Iacutesmall /Icircumflexsmall /Idieresissmall /Ethsmall /Ntildesmall - /Ogravesmall /Oacutesmall /Ocircumflexsmall /Otildesmall /Odieresissmall - /OEsmall /Oslashsmall /Ugravesmall /Uacutesmall /Ucircumflexsmall - /Udieresissmall /Yacutesmall /Thornsmall /Ydieresissmall (001.000) - (001.001) (001.002) (001.003) /Black /Bold - /Book /Light /Medium /Regular /Roman - /Semibold -.packtomark def - -% ---------------- Standard encodings ---------------- % - -/StandardEncodings [ - -% StandardEncoding -mark - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 - 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 - 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 - 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 - 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 - 0 111 112 113 114 0 115 116 117 118 119 120 121 122 0 123 - 0 124 125 126 127 128 129 130 131 0 132 133 0 134 135 136 - 137 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 138 0 139 0 0 0 0 140 141 142 143 0 0 0 0 - 0 144 0 0 0 145 0 0 146 147 148 149 0 0 0 0 -.packtomark - -% ExpertEncoding -mark - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 1 229 230 0 231 232 233 234 235 236 237 238 13 14 15 99 - 239 240 241 242 243 244 245 246 247 248 27 28 249 250 251 252 - 0 253 254 255 256 257 0 0 0 258 0 0 259 260 261 262 - 0 0 263 264 265 0 266 109 110 267 268 269 0 270 271 272 - 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 - 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 304 305 306 0 0 307 308 309 310 311 0 312 0 0 313 - 0 0 314 315 0 0 316 317 318 0 0 0 158 155 163 319 - 320 321 322 323 324 325 0 0 326 150 164 169 327 328 329 330 - 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 - 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 - 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 -.packtomark - -] readonly def - -% ---------------- Standard Charsets ---------------- % - -% We include an explicit 0 at the beginning of each charset. - -/StandardCharsets [ - -% ISOAdobe -mark - 0 - 1 1 228 { } for -.packtomark - -% Expert -mark - 0 - 1 229 230 231 232 233 234 235 236 237 238 13 14 15 99 239 - 240 241 242 243 244 245 246 247 248 27 28 249 250 251 252 253 - 254 255 256 257 258 259 260 261 262 263 264 265 266 109 110 267 - 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 - 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 - 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 - 316 317 318 158 155 163 319 320 321 322 323 324 325 326 150 164 - 169 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 - 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 - 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 - 374 375 376 377 378 -.packtomark - -% ExpertSubset -mark - 0 - 1 231 232 235 236 237 238 13 14 15 99 239 240 241 242 243 - 244 245 246 247 248 27 28 249 250 251 253 254 255 256 257 258 - 259 260 261 262 263 264 265 266 109 110 267 268 269 270 272 300 - 301 302 305 314 315 158 155 163 320 321 322 323 324 325 326 150 - 164 169 327 328 329 330 331 332 333 334 335 336 337 338 339 340 - 341 342 343 344 345 346 -.packtomark - -] readonly def - -% ---------------- Font loading ---------------- % - -% ------ Utilities ------ % - -/advance { % advance - - f cff eq { /pos pos 3 -1 roll add store } { pop } ifelse -} def -/next { % - next - f read { 1 advance } if -} def -/nextstring { % nextstring - dup 0 eq { - pop () - } { - string f exch readstring pop dup length advance - } ifelse -} def -/card8 % - card8 - /next load -def -/card16 { % - card16 - card8 8 bitshift card8 add -} def -/offset { % offset - 0 exch { 8 bitshift next add } repeat -} def -/sid % - sid - /card16 load -def -/Index { % - Index - mark card16 dup 0 ne { - 1 exch next dup offset pop exch { - dup offset dup 4 -1 roll sub 3 1 roll exch - } repeat pop - } if pop .packtomark - [ exch { nextstring } forall ] readonly -} def -/tokens { % - tokens ... (op# = 12 means EOF) - { - f read not { 12 exit } if - 1 advance - dup 12 eq { pop next 32 add exit } if - dup 28 lt { exit } if - dup 32 lt { - 28 sub { - { card16 32768 xor 32768 sub } - { 4 offset dup 16#7fffffff gt { -1 32 bitshift add } if } - { tokenreal } - { 31 exit } - } exch get exec - } { - dup 247 lt { - 139 sub - } { - 247 sub { - { next 108 add } - { next 364 add } - { next 620 add } - { next 876 add } - { next 108 add neg } - { next 364 add neg } - { next 620 add neg } - { next 876 add neg } - % 255 is deliberately omitted and will cause a rangecheck - } exch get exec - } ifelse - } ifelse - } loop -} def -/tokenbuf 100 string def -/tokenput { % tokenput - tokenbuf 2 index 3 -1 roll put 1 add -} def -/tokenrealarray [ - (0123456789.E) { } forall - [(E) 0 get /tokenput cvx (-) 0 get] cvx - null % will give an error - (-) 0 get - { exit } -] readonly def -/tokenreal { % - tokenreal - 0 { - next exch 1 index -4 bitshift tokenrealarray exch get exec tokenput - % We must leave the byte on the stack temporarily so that - % the exit will see a consistent stack state. - 1 index 15 and tokenrealarray exch get exec tokenput exch pop - } loop - tokenbuf 0 3 -1 roll getinterval cvr exch pop -} def -/Dict { % Dict - - /opdict exch store { - mark tokens opdict exch .knownget { exec } if cleartomark - } loop cleartomark -} def -/idstring { % idstring - dup 391 lt { StandardStrings } { 391 sub strings } ifelse exch get -} def -/idname { % idname - idstring dup type /nametype ne { cvn } if -} def - -% ------ Top dictionary ------ % - -/offput { % offput - - currentdict exch aload length 1 add packedarray cvx - offsets 3 1 roll put -} def -/queueput { % queueput - - 16#7fffffff offsets { pop .min } forall - pos sub nextstring - 3 1 roll aload length 2 add packedarray cvx - [ queued aload pop counttomark 2 add -1 roll ] - /queued exch store -} def -/xxput { % xxput - - 3 1 roll exch put -} def -/putfi { % putfi - - FontInfo xxput -} def -/xdef { % xdef - - exch def -} def -/topdictops mark - 12 { exit } - 0 { idstring /version putfi } - 1 { idstring /Notice putfi } - 32 { idstring /Copyright putfi } - 2 { idstring /FullName putfi } - 3 { idstring /FamilyName putfi } - 4 { idstring /Weight putfi } - 33 { 0 ne /isFixedPitch putfi } - 34 { /ItalicAngle putfi } - 35 { /UnderlinePosition putfi } - 36 { /UnderlineThickness putfi } - 37 { /PaintType xdef } - 38 { /CharstringType xdef } - 39 { counttomark array astore /FontMatrix xdef } - 13 { /UniqueID xdef } - 5 { counttomark array astore /FontBBox xdef } - 40 { /StrokeWidth xdef } - 14 { counttomark array astore /XUID xdef } - 15 { - dup StandardCharsets length lt { - StandardCharsets exch get /charset xdef - } { - { queuecharset } offput - } ifelse - } - 16 { - dup StandardEncodings length lt { - /Encoding xdef - } { - { queueEncoding } offput - } ifelse - } - 17 { { readCharStrings } offput } - 18 { exch /readPrivate cvx 2 packedarray offput } -.dicttomark readonly def - -/readCharStrings { % readCharStrings - - /CharStringArray Index put -} def - -% ------ Charsets and encodings ------ % - -% Note: formats 1 and 2 can overflow the operand stack. -% We'll fix this if it ever becomes necessary. -/charsetformats [ -{ [ 0 CharStringArray length 1 sub { sid } repeat ] -} -{ [ 0 CharStringArray length 1 sub { - dup 0 eq { pop exit } if - sid card8 1 add 2 index .min { exch 1 sub 1 index 1 add } repeat pop - } loop ] -} -{ [ 0 CharStringArray length 1 sub { - dup 0 eq { pop exit } if - sid card16 1 add 2 index .min { exch 1 sub 1 index 1 add } repeat pop - } loop ] -} -] readonly def -/queuecharset { % queuecharset - - { readcharset } queueput -} def -/readcharset { % readcharset - - begin 0 () /SubFileDecode filter /f exch store - charsetformats next get exec /charset exch def end -} def - -/encodingformats [ -{ 1 1 next { next exch Encoding 3 1 roll put } for -} -{ 1 next { - next next 1 add { - % Stack: gid code - Encoding 1 index 3 index put - exch 1 add exch 1 add - } repeat pop - } repeat pop -} -] readonly def -/queueEncoding { % queueEncoding - - { readEncoding } queueput -} def -/readEncoding { % readEncoding - - begin 0 () /SubFileDecode filter /f exch store - /Encoding [ 256 { /.notdef } repeat ] def - next encodingformats 1 index 127 and get exec - 128 ge { - % Read supplementary encodings. - next { - Encoding next sid idname put - } repeat - } if end -} def - -% ------ Private dictionary ------ % - -/deltarray { % -mark- ... deltarray ... - 0 counttomark 1 sub { counttomark -1 roll add dup } repeat pop - counttomark array astore -} def - -/privatedictops mark - 12 { exit } - 6 { deltarray /BlueValues xdef } - 7 { deltarray /OtherBlues xdef } - 8 { deltarray /FamilyBlues xdef } - 9 { deltarray /FamilyOtherBlues xdef } - 41 { /BlueScale xdef } - 42 { /BlueShift xdef } - 43 { /BlueFuzz xdef } - 10 { 1 array astore /StdHW xdef } - 11 { 1 array astore /StdVW xdef } - 44 { deltarray /StemSnapH xdef } - 45 { deltarray /StemSnapV xdef } - 46 { 0 ne /ForceBold xdef } - 47 { /ForceBoldThreshold xdef } - 48 { /lenIV xdef } - 49 { /LanguageGroup xdef } - 50 { /ExpansionFactor xdef } - 51 { /initialRandomSeed xdef } - 19 { { readSubrs } offput } - 20 { /defaultWidthX xdef } - 21 { /nominalWidthX xdef } - % Multiple Master fonts only - 59 { /NDV xdef } - 60 { /CDV xdef } - 61 { /lenBuildCharArray xdef } -.dicttomark readonly def - -/readPrivate { % readPrivate - - exch 1 index f exch () /SubFileDecode filter /f exch def - /Private get begin //privatedictops Dict end - /f cff def advance -} def - -% ------ Main program ------ % - -% We need to pass the file as a parameter for the sake of the PDF -% interpreter. -/StartData { % StartData - - currentfile exch () /SubFileDecode filter ReadData -} def -/ReadData { % ReadData - - - % Initialize. - - 30 dict begin - /cff exch def - /pos 0 def - /resname exch cvlit def - - % Read the header. - - /f cff def - /vmajor next def - /vminor next def - /hdrsize next def - /aoffsize next def - - % Read the Indexes. - - /names Index def - /topdicts Index def - /strings Index def - /gsubrs Index def - - % Read the top Dicts. - - /offsets 50 dict def - /queued [] def - /opdict null def % reserve a slot - /fonts [ topdicts { - 0 () /SubFileDecode filter /f exch def - 40 dict begin - % Preload defaults that differ from PostScript defaults, - % or that are required. - /FontType 1 def - /PaintType 0 def - /CharstringType 2 def - /FontMatrix [0.001 0 0 0.001 0 0] def - /charset StandardCharsets 0 get def - /Encoding 0 def - /FontInfo 10 dict - dup /UnderlinePosition -100 put - dup /UnderlineThickness 50 put - def - /Private 20 dict - gsubrs length 0 ne { dup /GlobalSubrs gsubrs put } if - def - //topdictops Dict - currentdict end - } forall ] def - - % Read other tables with queued offsets. - - DEBUG { offsets length =only ( offsets) = flush } if - { /f cff def - offsets pos 2 copy .knownget not { pop pop exit } if - 3 1 roll undef exec - } loop - offsets length 0 ne { - (Error: missing tables at ) print [ offsets { pop } forall ] == - (Current position is ) print pos == - flush stop - } if - - % Process out-of-order tables. - - DEBUG { queued length =only ( queued) = flush } if - queued { exec } forall - - % Update Encoding and CharStrings. - - fonts { - begin - % Construct the real Encoding. - % The value of Encoding is either a number, for predefined - % encodings, or an array of mixed GIDs and names. - /Encoding mark Encoding - DEBUG { (Encoding: ) print dup === flush } if - dup type /integertype eq { - StandardEncodings exch get { idname } forall - } { - { - dup type /integertype eq { charset exch get idname } if - } forall - } ifelse .packtomark def - % Construct the CharStrings. - % Note that they may only correspond to an initial - % subset of the charset. - /CharStrings charset length CharStringArray length .min dict def - DEBUG { - charset length =only ( charset ) print - CharStringArray length =only ( CharStringArray) = - charset == flush - } if - 0 1 CharStrings maxlength 1 sub { - dup CharStringArray exch get - exch charset exch get idstring - CharStrings xxput - } for - % Remove unwanted entries. - currentdict /charset undef - currentdict /CharStringArray undef - end - } forall - - % Wrap up. - - resname mark 0 1 fonts length 1 sub { - DEBUG { dup =only ( ) print flush } if - dup names exch get - DEBUG { dup == flush } if - exch fonts exch get - dup /FontName 3 index put - 1 index exch definefont - } for .dicttomark - end % temporary dict - end % FontSetInit ProcSet - /FontSet defineresource pop - -} bind def - -% ---------------- Resource category definition ---------------- % - -currentdict end readonly - -languagelevel exch 2 .setlanguagelevel - -/FontSet /Generic /Category findresource dup length dict .copydict -/Category defineresource pop - -/FontSetInit exch /ProcSet defineresource pop - -.setlanguagelevel diff --git a/pstoraster/gs_cidfn.ps b/pstoraster/gs_cidfn.ps deleted file mode 100644 index d9cc50aa71..0000000000 --- a/pstoraster/gs_cidfn.ps +++ /dev/null @@ -1,466 +0,0 @@ -% Copyright (C) 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_cidfn.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% ProcSet for implementing CIDFont and CIDMap resources. -% When this is run, systemdict is still writable. - -% ---------------- Defining CIDFont resources ---------------- % - -% Define a CIDFont resource. This is the defineresource implementation for -% the CIDFont resource category. - -/.cidfonttypes where { pop } { /.cidfonttypes 6 dict def } ifelse -.cidfonttypes begin - -% The key in .cidfonttypes is the CIDFontType value; -% the value is a procedure that takes a font name and the CIDFont dictionary -% and replaces the latter with a real font. - -0 { % CIDFontType 0 = FontType 9 - currentglobal 3 1 roll dup gcheck setglobal - dup /FontType 9 put - dup /FontMatrix known not { - dup /FontMatrix [0.001 0 0 0.001 0 0] put - dup /FDArray get { - /FontMatrix get [1000 0 0 1000 0 0] 1 index concatmatrix pop - } forall - } if - dup /FDArray get mark exch { - % Add pro forma entries - currentglobal exch dup gcheck setglobal - dup /FontType 1 put - dup /CharStrings mark /.notdef () .dicttomark put - dup /Encoding [] put - % Create a dummy Subrs array now, if there isn't one here - % already (which can only happen if we're giving another - % name to an existing font). - dup /Private get dup /Subrs known not { - dup /SubrCount .knownget { - array 1 index /Subrs 3 -1 roll put - } if readonly - } if pop - exch setglobal - dup /FontName .knownget not { () } if exch .buildfont1 exch pop - } forall ] 1 index /FDepVector 3 -1 roll put - 3 -1 roll setglobal - 1 index exch .buildfont9 exch pop -} bind def - -1 { % CIDFontType 1 = FontType 10 - dup /FontType 10 put - 1 index exch .buildfont10 exch pop -} bind def - -2 { % CIDFontType 2 = FontType 11 - dup /FontType 11 put - 1 index exch .buildfont11 exch pop -} bind def - -end % .cidfonttypes - -% ---------------- Reading CIDFontType 0 files ---------------- % - -30 dict begin - -% We add the following entries to the CIDFont dictionary, in addition to -% the ones documented by Adobe: -% ReadString - procedure for reading a string from the binary data -% SubrCache - dictionary for caching Subr arrays -% For CIDFonts where we read the data from disk incrementally: -% DataOffset - starting position of data in file -% (if data are in hex) OffsetMap - map from logical data positions to -% physical positions in file - -/StartData % <(Binary)|(Hex)> StartData - - % (currentdict is CID font dict) -{ % If we're loading a resource file, we can just save a - % pointer to the binary data and load it incrementally. - % Check for this by opening the resource file, - % positioning it to currentfile's position plus the - % data length, and checking for %%EndData. - mark - { currentfile fileposition - CIDFontName 100 string ResourceFileName (r) file - mark - { % Stack: (Binary)|(Hex) length -mark- pos resfile - % -mark- - 5 index (Hex) eq - { 1 index 3 index setfileposition - 1 index 5 index .skiphex - %**************** SKIP > AND WHITESPACE SOMEHOW - } - { 1 index 3 index 6 index add setfileposition - } - ifelse - 1 index 9 string readstring pop (%%EndData) ne { stop } if - } - .internalstopped { cleartomark closefile stop } if - pop % pop the mark - } - .internalstopped - { % File is not positionable, load the data now. - cleartomark exch (Hex) eq - { { currentfile exch readhexstring pop } } - { { currentfile exch readstring pop } } - ifelse /ReadString exch def - dup 65535 le - { string ReadString - } - { mark exch - { dup 0 eq { pop exit } if - dup 65535 min dup string ReadString - 3 1 roll sub - } - loop ] - } - ifelse - /GlyphData exch def - % If we were reading hex data, skip past the >. - /ReadString load 2 get { readhexstring } 0 get eq { - currentfile 0 (>) /SubFileDecode filter dup flushfile closefile - } if - /.vmreadstring cvx - } - { % File is positionable, just save a pointer. - % Stack: (Binary)|(Hex) length -mark- pos file - 4 1 roll - /DataOffset exch def - pop /GlyphData exch def - exch (Hex) eq - { % Hex data, build the offset map. - .buildoffsetmap - /.hexreadstring - } - { % Binary data, just skip over it. - currentfile DataOffset GlyphData add setfileposition - /.binaryreadstring - } - ifelse cvx - 2 packedarray cvx - } - ifelse /ReadString exch def - /SubrCache 10 dict def - CIDFontName currentdict /CIDFont defineresource pop - end % CID font dict - end % resource category dict -} bind def - -% Skip a given distance in an ASCIIHex encoded file. We use this at -% rendering time as well. -/.skiphex % .skiphex - -{ exch /ASCIIHexDecode filter dup 3 -1 roll () /SubFileDecode filter - dup flushfile closefile closefile -} bind def - -% Build the map from logical offsets to physical offsets in ASCIIHex -% encoded data. -/.buildoffsetmap -{ /OffsetMap GlyphData 256 idiv 8000 min array def - 2 dict begin - /block GlyphData OffsetMap length idiv def - 0 1 OffsetMap length 1 sub - { OffsetMap exch currentfile fileposition put - currentfile block .skiphex - } - for - GlyphData block mod dup 0 eq - { pop } - { currentfile exch .skiphex } - ifelse - end % scratch dict -} bind def - -currentdict end - -% ---------------- Rendering ---------------- % - -% ------ Generic ------ % - -% Read a string at a given offset in a "file" (binary file, ASCII hex file, -% or GlyphData in RAM). -/.binaryreadstring % .binaryreadstring - { dup 4 -1 roll DataOffset add setfileposition exch readstring pop - } bind def -/.hexreadstring % .hexreadstring -{ % Use the OffsetMap to get to the block of hex data, - % then skip to the correct position by reading. - GlyphData OffsetMap length idiv - % Stack: pos string file blocklen - 3 index 1 index idiv OffsetMap exch get - 2 index exch setfileposition - % Skip the next (pos % blocklen) hex bytes. - 4 -1 roll exch mod 1 index exch .skiphex - % Stack: string file - exch readhexstring pop -} bind def -/.vmreadstring % .vmreadstring -{ GlyphData .stringsreadstring -} bind def -/.stringsreadstring % .stringsreadstring - % -{ dup type /stringtype eq - { 3 1 roll length getinterval - } - { { % Stack: pos string glyphdata - dup 0 get length dup 4 index gt { exit } if - 4 -1 roll exch sub 3 1 roll - dup length 1 sub 1 exch getinterval - } - loop - % Stack: pos string glyphdata glyphdata[0]length - % We know no request can span more than 2 strings. - 3 index 3 index length add 1 index le - { % Request fits in a single string: just return a substring. - pop 0 get 3 1 roll length getinterval - } - { % Request spans 2 strings. Copy the first part. - 1 index 0 get 4 index 3 -1 roll 1 index sub getinterval - 2 index copy - % Copy the second part. - % Stack: pos str glyphdata str1 - length exch 1 get 0 3 index length - 3 index sub getinterval 2 index 3 1 roll putinterval - exch pop - } - ifelse - } - ifelse -} bind def - -% Interpret a byte string as a (big-endian) integer. -/.cvbsi % .cvbsi -{ 0 exch { exch 8 bitshift add } forall -} bind def - -% Read an integer from binary data. -/.readint % .readint -{ string ReadString .cvbsi -} bind def - -% Read the glyph data for a given CID. The CIDFont is currentdict. -% Note that the data must be read into the same VM as the CharStrings -% dictionary of the selected subfont. -/.readglyphdata { % .readglyphdata - currentdict /GlyphDirectory .knownget { - dup type /arraytype eq { - 1 index exch get - } { - 1 index exch .knownget not { null } if - } ifelse - dup null eq { - FDepVector 0 get exch - } { - FDBytes 0 eq { - FDepVector 0 get exch - } { - % Note: FDBytes > 1 is not supported. - dup 0 get FDepVector exch get - exch dup length 1 sub 1 exch getinterval - } ifelse - } ifelse - } { - FDBytes GDBytes add mul CIDMapOffset add - dup FDBytes .readint exch - FDBytes add dup GDBytes .readint - exch GDBytes add FDBytes add GDBytes .readint - % Stack: fd pos nextpos - 1 index sub dup 0 eq { - pop pop pop FDepVector 0 get null - } { - % Stack: fd pos len - FDepVector 4 -1 roll get - dup /CharStrings get gcheck .currentglobal exch .setglobal - % Stack: pos len subfont global - 4 2 roll string ReadString exch .setglobal - } ifelse - } ifelse -} bind def - -% ------ CIDFontType 0 ------ % - -% Read some Subrs for the current Type 1 subfont. -% The subfont's Private dict is currentdict; the CIDFont itself is the -% next dictionary on the stack. -/.readsubrs { % .readsubrs - 1 SubrCount 1 sub { - dup SDBytes mul SubrMapOffset add - dup SDBytes .readint exch SDBytes add SDBytes .readint - 1 index sub string ReadString 2 index 3 1 roll put - } for -} bind def - -% Ensure that all the Subrs for the current Type 1 subfont are loaded. -% The subfont's Private dict is currentdict; the CIDFont itself is the -% next dictionary on the stack. -/.loadsubrs { - currentdict /SubrMapOffset .knownget { - Subrs 0 get null ne { - pop % We've already loaded the Subrs. - } { - currentglobal exch currentdict gcheck setglobal - SubrCache 1 index .knownget { - % We've already loaded some Subrs at this offset. - % Make sure we've got as many as we need. - dup length SubrCount lt { - % We need to load more. - SubrCount array exch 1 index copy length .readsubrs - SubrCache 3 -1 roll 2 index put - } if - } { - % We haven't loaded any Subrs at this offset yet. - SubrCount array 0 .readsubrs - SubrCache 3 -1 roll 2 index put - } ifelse - Subrs copy pop setglobal - } ifelse - } if -} bind def - -% BuildGlyph procedure for CIDFontType 0. -% ****** WHY NOT USE .type1execchar FOR THIS? ****** -% The name %Type9BuildGlyph is known to the interpreter. -/.cid0buildstring 10 string def -(%Type9BuildGlyph) cvn { % %Type9BuildGlyph - - .currentglobal 3 1 roll 1 index gcheck .setglobal - 1 index begin - dup .readglyphdata dup null eq - { %**** HANDLE NOTDEF **** - } - if - % Stack: cidfont cid subfont charstring -dup null eq { pop pop pop pop } { %**** WRONG **** - 4 -1 roll pop - exch dup /Private get begin .loadsubrs end - 3 -1 roll //.cid0buildstring cvs cvn 3 1 roll - dup /CharStrings get 3 index 4 -1 roll put - setfont - 1000 0 setcharwidth %**** WRONG **** - 0 0 moveto glyphshow -} ifelse %**** WRONG **** - end - .setglobal -} bind def - -% ------ CIDFontType 2 ------ % - -% BuildGlyph procedure for CIDFontType 2. -% ****** ADD THE OUTLINE STRING AS AN ARGUMENT TO .type42execchar. ****** -% The name %Type11BuildGlyph is known to the interpreter. -(%Type11BuildGlyph) cvn { % %Type11BuildGlyph - - .currentglobal 3 1 roll 1 index gcheck .setglobal - 1 index begin - % We must be prepared for out-of-range CIDs. - dup GDBytes mul GDBytes string CIDMap - mark 4 1 roll { .stringsreadstring } .internalstopped { - %**** 0 IS WRONG - cleartomark 0 GDBytes string CIDMap .stringsreadstring - } { - exch pop - } ifelse .cvbsi - % Stack: cidfont cid glyphindex -%**************** GlyphDirectory is not supported yet. -( - currentdict /GlyphDirectory .knownget -) pop false - { dup type /arraytype eq - { 1 index exch get } - { 1 index exch .knownget not { null } if } - ifelse - dup null eq - { %**** HANDLE NOTDEF - } - if - 1 index exch .type42execchar - } - { 1 index exch .type42execchar - } - ifelse - end - .setglobal -} bind def - -% ---------------- Define resources ---------------- % - -languagelevel exch 2 .setlanguagelevel - -% Define the CIDInit ProcSet resource. -% The ProcSet dictionary is still on the stack. - -/CMap /Generic /Category findresource dup length dict .copydict -/Category defineresource pop - % We might have loaded CMap support already. -/CIDInit /ProcSet 2 copy resourcestatus { - pop pop findresource dup length 4 index length add dict .copydict - 4 -1 roll exch .copydict -} { - 3 -1 roll -} ifelse exch defineresource pop - -% Define the CIDFont resource category. -% We break out .buildcidfont because it appears that at least for -% Type 32 (CIDFontType 4) fonts, the font can be registered in the Font -% category with only a CIDFontType and no FontType. -/.buildcidfont { % .buildcidfont - % - dup /CIDFontType get //.cidfonttypes exch get exec -} odef - -/CIDFont /Generic /Category findresource dup length dict .copydict -dup /InstanceType /dicttype put -dup /DefineResource { - .buildcidfont - /Generic /Category findresource /DefineResource get exec -} put -/Category defineresource pop - -% Add the new FontType resources. - -9 1 11 { dup /FontType defineresource pop } for - -% Add the new FMapType resource. - -9 dup /FMapType defineresource pop - -% Define the CIDMap resource category. -% These aren't documented, but it's clear what they are for: -% to give names to CIDMaps for CIDFontType 2 fonts. - -/CIDMap /Generic /Category findresource dup length dict .copydict -dup /.CheckResource { - % Allow either a string or an array of strings. - dup type dup /stringtype eq - { pop true - } - { dup /arraytype eq exch /packedarraytype eq or - { true exch { type /stringtype ne { pop false exit } if } forall - } - { false - } - ifelse - } - ifelse -} bind put -/Category defineresource pop - -.setlanguagelevel diff --git a/pstoraster/gs_cmap.ps b/pstoraster/gs_cmap.ps deleted file mode 100644 index 409c750a3a..0000000000 --- a/pstoraster/gs_cmap.ps +++ /dev/null @@ -1,256 +0,0 @@ -% Copyright (C) 1995, 1996, 1997 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_cmap.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% ProcSet for implementing CMap resources. -% When this is run, systemdict is still writable. - -% NOTE: Rearranged fonts are not implemented yet. - -% ---------------- Public operators ---------------- % - -% composefont doesn't appear in CMap files -- it's documented in -% the "PostScript Language Reference Manual Supplement". -/composefont { % composefont - 10 dict begin - /CMap 2 index dup type /dicttype ne { /CMap findresource } if def - /Encoding [ 0 1 4 index length 1 sub { } for ] def - /FDepVector [ 2 index { - dup type /dicttype ne { - dup /CIDFont resourcestatus { - pop pop /CIDFont findresource - } { - /Font findresource - } ifelse - } if - } forall ] readonly def - /FMapType 9 def - /FontMatrix matrix def - /FontName 3 index def - /CMap load /WMode .knownget { /WMode exch def } if - /FontType 0 def - pop pop currentdict end /Font defineresource -} bind odef - -% ---------------- CMap operators ---------------- % - -30 dict begin - -% Our internal .CodeMaps structure is an array of two arrays: array 0 -% is the map for defined characters, array 1 is the map for notdefs. -% Both are multi-level arrays indexed by the successive bytes of the -% character code. Each value is either a sub-array, null, a character name, -% a CID (an integer), or a character code (expressed as a byte string). -% All of the arrays are read-only after they have been built. -% -% Note that the code in zfcmap.c that constructs the C structures from -% the PostScript structures has intimate knowledge of the above format. - -/.getmap { .CodeMaps exch get } bind def -/.putmap { .CodeMaps exch 3 -1 roll put } bind def - -% ------ Font-level operators ------ % - -/begincmap % - begincmap - - { /.CodeMaps [256 array 256 array] def - } bind def -/endcmap % - endcmap - - { /.CodeMaps .CodeMaps .endmap def - /CodeMap null def % for .buildcmap - currentdict end .buildcmap begin - } bind def - -/begincodespacerange % begincodespacerange - - { pop mark - } bind def -/endcodespacerange % ... endcodespacerange - - { counttomark 2 idiv - { .CodeMaps { 3 copy .addcodespacerange pop } forall pop pop - } repeat pop - } bind def - -/.addcodespacerange % .addcodespacerange - - { 2 index length 1 eq - { 2 { 3 -1 roll 0 get } repeat 1 exch - { 2 copy 0 put pop } for pop - } - { 2 index 0 get 1 3 index 0 get - 6 -2 roll - 2 { 1 1 index length 1 sub getinterval 6 1 roll } repeat - % Stack: lo hi map lo0 1 hi0 - { 2 copy get null eq { 2 copy 256 array put } if - 4 copy get .addcodespacerange pop - } - for pop pop pop - } - ifelse - } bind def -/.endmap % .endmap - { dup type /arraytype eq { dup { .endmap exch } forall astore readonly } if - } bind def - -/usecmap % usecmap - - { /CMap findresource - dup length dict .copydict - currentdict end exch .copydict begin - } bind def - -% ------ Rearranged font operators ------ % - -/beginrearrangedfont % beginrearrangedfont - - { (NOT IMPLEMENTED YET.\n) print flush - } bind def -/endrearrangedfont % - endrearrangedfont - - { (NOT IMPLEMENTED YET.\n) print flush - } bind def - -/usefont % usefont - - { (NOT IMPLEMENTED YET.\n) print flush - } bind def - -/beginusematrix % beginusematrix - - { (NOT IMPLEMENTED YET.\n) print flush - } bind def -/endusematrix % endusematrix - - { (NOT IMPLEMENTED YET.\n) print flush - } bind def - -% ------ Character name/code selector operators ------ % - -/beginbfchar % beginbfchar - - { pop mark - } bind def -/endbfchar % ... endbfchar - { 0 .getmap .endmapchar 0 .putmap - } bind def - -/beginbfrange % beginbfrange - - { pop mark - } bind def -/endbfrange % ... - % endbfrange - - { 0 .getmap counttomark 3 idiv { .addbfrange } repeat 0 .putmap pop - } bind def - -/.addbfrange % - % .addbfrange - { 1 index type /stringtype eq - { { dup length string copy dup dup length 1 sub 2 copy get 1 add put } - exch .addmaprange - } - { 2 dict begin exch /codes 1 index def 0 get exch - { codes dup length 1 sub 1 exch getinterval /codes 1 index def - dup length 0 gt { 0 get } if - } - exch .addmaprange end - } - ifelse exch pop - } bind def - -% ------ CID selector operators ------ % - -/begincidchar % begincidchar - - { pop mark - } bind def -/endcidchar % ... endcidchar - - { 0 .getmap .endmapchar 0 .putmap - } bind def - -/begincidrange % begincidrange - - { pop mark - } bind def -/endcidrange % ... endcidrange - - { 0 .getmap counttomark 3 idiv { { 1 add } exch .addmaprange exch pop } repeat - 0 .putmap pop - } bind def - -/.endmapchar % -mark- ... .endmapchar - - { counttomark 2 idiv - { 2 index 3 1 roll { } exch .addmaprange exch pop - } repeat exch pop - } bind def - -/.addmaprange % - % .addcidrange - { % We may be updating a (partly) read-only map from another CMap. - % If so, implement copy-on-write. - dup wcheck not { dup length array copy } if - 4 index length 1 eq - { 2 { 5 -1 roll 0 get } repeat 1 exch - { % Stack: value proc map code - 2 copy 5 index put pop - 3 -1 roll 2 index exec 3 1 roll - } for - } - { 4 index 0 get 1 5 index 0 get - 8 -2 roll - 2 { 1 1 index length 1 sub getinterval 8 1 roll } repeat - % Stack: lo hi next proc map lo0 1 hi0 - { 6 copy get .addmaprange - % Stack: lo hi oldnext proc map i next submap - exch 6 1 roll 5 -1 roll pop - % Stack: lo hi next proc map i submap - 3 copy put pop pop - } - for 5 -2 roll pop pop - } - ifelse exch pop - } bind def - -% ------ notdef operators ------ % - -/beginnotdefchar % beginnotdefchar - - { pop mark - } bind def -/endnotdefchar % ... endnotdefchar - - { counttomark 2 idiv { 1 index exch .addnotdefrange } repeat pop - } bind def - -/beginnotdefrange % beginnotdefrange - - { pop mark - } bind def -/endnotdefrange % ... endnotdefrange - - { counttomark 3 idiv { .addnotdefrange } repeat pop - } bind def - -/.addnotdefrange % .addnotdefrange - - { { } 1 .getmap .addmaprange 1 .putmap pop - } bind def - -% ---------------- Resource category definition ---------------- % - -currentdict end - -languagelevel exch 2 .setlanguagelevel - -/CMap /Generic /Category findresource dup length dict .copydict -/Category defineresource pop - % We might have loaded CID font support already. -/CIDInit /ProcSet 2 copy { findresource } .internalstopped - % An interior `stopped' might have reset VM allocation to local. -true .setglobal - { pop pop 3 -1 roll } - { dup length 4 index length add dict .copydict 4 -1 roll exch .copydict } -ifelse exch defineresource pop - -.setlanguagelevel diff --git a/pstoraster/gs_cmdl.ps b/pstoraster/gs_cmdl.ps deleted file mode 100644 index ebb82bbe1a..0000000000 --- a/pstoraster/gs_cmdl.ps +++ /dev/null @@ -1,188 +0,0 @@ -% Copyright (C) 1994, 1996 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_cmdl.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% Parse and execute the command line. -% C code handles the following switches: -h/-? -I -M -v - -/cmddict 50 dict def -cmddict begin - -% ---------------- Utility procedures ---------------- % - -% Get the next argument from the parsed argument list. -/nextarg % - nextarg true - % - nextarg false - { argv length 0 eq - { false } - { argv dup 0 get exch dup length 1 sub 1 exch getinterval /argv exch def } - ifelse - } bind def - -% Run a file, under job control if implemented. -/runjob % runjob - - { end % cmddict - /startjob where { pop false () startjob pop } - run - //cmddict begin - } bind def -/runfilejob % runfilejob - - { findlibfile { exch pop } { (r) file } runjob - } bind def - -% Expand arguments. Free variables: expand@. -/expandarg % expandarg - { dup () eq - { pop - } - { dup dup (--) eq exch (-+) eq or - { pop /expand@ false def - } - { expand@ { (@) anchorsearch } { false } ifelse - { pop findlibfile - { exch pop } - { (r) file } % let the error happen - expandargfile - } - if - } - ifelse - } - } bind def -/expandargfile % expandargfile - { [ exch cvlit - { token not { exit } if - dup type /stringtype ne { =string cvs dup length string copy } if - expandarg - } - /exec cvx - ] cvx loop - } bind def - -% ---------------- Recognized switches ---------------- % - -% Switches with arguments are defined as ; -% switches without arguments are defined as -. - -% Switches without arguments -/-- - { nextarg not - { (-- and -+ require a file name.\n) print flush } - { //systemdict /ARGUMENTS argv put /argv [] def runjob } - ifelse - } bind def -/-+ /-- load def -/-@ /-- load def -/-A { (@) Z } bind def -/-c - { { argv length 0 eq { exit } if - argv 0 get (-) anchorsearch { pop pop exit } if - pop nextarg token - { exch pop % Probably should check for empty. - end exec //cmddict begin - } - if - } - loop - } bind def -/-e { (#) Z } bind def -/-E /-e load def -/-f { } def -/-q { //systemdict /QUIET true put } bind def - -% Switches with arguments -/d - { (=) search not { (#) search not { () exch dup } if } if - exch pop cvn dup where - { pop (Redefining ) print print ( is not allowed.\n) print flush pop } - { exch token - { exch pop } % Probably should check for empty. - { true } - ifelse - //systemdict 3 1 roll put - } - ifelse - } bind def -/D /d load def -/f { dup length 0 ne { runfilejob } if } bind def -/g - { (x) search { cvi pop exch cvi } { cvi dup } ifelse - //systemdict begin /DEVICEHEIGHT exch def /DEVICEWIDTH exch def end - } bind def -/r - { (x) search { cvr pop exch cvr } { cvr dup } ifelse - //systemdict begin /DEVICEYRESOLUTION exch def /DEVICEXRESOLUTION exch def end - } bind def -/s - { (=) search not { (#) search not { () exch dup } if } if - exch pop cvn dup where { pop dup load } { () } ifelse - type /stringtype ne - { (Redefining ) print print ( is not allowed.\n) print flush pop } - { exch //systemdict 3 1 roll put } - ifelse - } bind def -/S /s load def -/Z { true .setdebug } bind def - -% ---------------- Main program ---------------- % - -% We process the command line in two passes. In the first pass, -% we read and expand any @-files as necessary. The second pass -% does the real work. - -/cmdstart - { //cmddict begin - /expand@ true def - [ - % Process the GS_OPTIONS environment variable. - (GS_OPTIONS) getenv { 0 () /SubFileDecode filter expandargfile } if - % Process the actual command line. - .getargv { expandarg } forall - ] readonly /argv exch def - % Now interpret the commands. - { nextarg not { exit } if - dup 0 get (-) 0 get eq - { dup length 1 eq - { pop (%stdin) (r) file runjob - } - { dup length 2 gt - { dup dup length 2 sub 2 exch getinterval exch 1 1 getinterval } - if currentdict .knownget - { exec - } - { (Ignoring unknown switch ) print - dup length 1 eq { (-) print print } if print - (\n) print flush - } - ifelse - } - ifelse - } - { runfilejob - } - ifelse - } - loop end - } bind def - -end % cmddict diff --git a/pstoraster/gs_dbt_e.ps b/pstoraster/gs_dbt_e.ps deleted file mode 100644 index 70ea9fa0e6..0000000000 --- a/pstoraster/gs_dbt_e.ps +++ /dev/null @@ -1,67 +0,0 @@ -% Copyright (C) 1993, 1994 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_dbt_e.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% Define the Dingbats encoding vector. -/currentglobal where - { pop currentglobal { setglobal } true setglobal } - { { } } -ifelse -/DingbatsEncoding -% \000 - StandardEncoding 0 32 getinterval aload pop % /.notdef -% \040 - /space /a1 /a2 /a202 /a3 /a4 /a5 /a119 - /a118 /a117 /a11 /a12 /a13 /a14 /a15 /a16 - /a105 /a17 /a18 /a19 /a20 /a21 /a22 /a23 - /a24 /a25 /a26 /a27 /a28 /a6 /a7 /a8 -% \100 - /a9 /a10 /a29 /a30 /a31 /a32 /a33 /a34 - /a35 /a36 /a37 /a38 /a39 /a40 /a41 /a42 - /a43 /a44 /a45 /a46 /a47 /a48 /a49 /a50 - /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 -% \140 - /a59 /a60 /a61 /a62 /a63 /a64 /a65 /a66 - /a67 /a68 /a69 /a70 /a71 /a72 /a73 /a74 - /a203 /a75 /a204 /a76 /a77 /a78 /a79 /a81 - /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef -% \200 - StandardEncoding 0 32 getinterval aload pop % /.notdef -% \240 - /.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 - /a112 /a111 /a110 /a109 /a120 /a121 /a122 /a123 - /a124 /a125 /a126 /a127 /a128 /a129 /a130 /a131 - /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 -% \300 - /a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 - /a148 /a149 /a150 /a151 /a152 /a153 /a154 /a155 - /a156 /a157 /a158 /a159 /a160 /a161 /a163 /a164 - /a196 /a165 /a192 /a166 /a167 /a168 /a169 /a170 -% \340 - /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 - /a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 - /.notdef /a201 /a183 /a184 /a197 /a185 /a194 /a198 - /a186 /a195 /a187 /a188 /a189 /a190 /a191 /.notdef -256 packedarray .defineencoding -3 DingbatsEncoding .registerencoding -exec diff --git a/pstoraster/gs_diskf.ps b/pstoraster/gs_diskf.ps deleted file mode 100644 index e9b46154f8..0000000000 --- a/pstoraster/gs_diskf.ps +++ /dev/null @@ -1,232 +0,0 @@ -% Copyright (C) 1996 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_diskf.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% Support for converting Type 1 fonts without eexec encryption to -% Type 4 fonts that load individual character outlines on demand. - -% If DISKFONTS is true, we load individual CharStrings as they are needed. -% (This is intended primarily for machines with very small memories.) -% Initially, the character definition is the file position of the definition; -% this gets replaced with the actual CharString. -% Note that if we are loading characters lazily, CharStrings is writable. - -% _Cstring must be long enough to hold the longest CharString for -% a character defined using seac. This is lenIV + 4 * 5 (for the operands -% of sbw, assuming div is not used) + 2 (for sbw) + 3 * 5 (for the operands -% of seac other than the character codes) + 2 * 2 (for the character codes) -% + 2 (for seac), i.e., lenIV + 43. - -/_Cstring 60 string def - -% When we initially load the font, we call -% cskip_C -% to skip over each character definition and return the file position instead. -% This substitutes for the procedure -% string currentfile exch read[hex]string pop -% [encrypt] -% What we actually store in the CharString is fileposition * 1000 + length, -% negated if the string is stored in binary form. - -/cskip_C - { exch dup 1000 ge 3 index type /nametype ne or - { % This is a Subrs string, or the string is so long we can't represent - % its length. Load it now. - exch exec - } - { % Record the position and length, and skip the string. - dup currentfile fileposition 1000 mul add - 2 index 3 get /readstring cvx eq { neg } if - 3 1 roll - dup _Cstring length idiv - { currentfile _Cstring 3 index 3 get exec pop pop - } repeat - _Cstring length mod _Cstring exch 0 exch getinterval - currentfile exch 3 -1 roll 3 get exec pop pop - } - ifelse - } bind def - -% Load a CharString from the file. The font is the top entry -% on the dictionary stack. -/load_C % load_C - - { dup abs 1000 idiv FontFile exch setfileposition - CharStrings 3 1 roll - .currentglobal CharStrings .gcheck .setglobal exch - dup 0 lt - { neg 1000 mod string FontFile exch readstring } - { 1000 mod string FontFile exch readhexstring } - ifelse pop - exch .setglobal -% If the CharStrings aren't encrypted on the file, encrypt now. - Private /-| get 0 get - dup type /nametype ne - { dup length 5 sub 5 exch getinterval exec } - { pop } - ifelse dup 4 1 roll put -% If the character is defined with seac, load its components now. - mark exch seac_C - counttomark - { StandardEncoding exch get dup CharStrings exch get - dup type /integertype eq { load_C } { pop pop } ifelse - } repeat - pop % the mark - } bind def - -/seac_C % seac_C ..or nothing.. - { dup length _Cstring length le - { 4330 exch _Cstring .type1decrypt exch pop - dup dup length 2 sub 2 getinterval <0c06> eq % seac - { dup length - Private /lenIV known { Private /lenIV get } { 4 } ifelse - exch 1 index sub getinterval -% Parse the string just enough to extract the seac information. -% We assume that the only possible operators are hsbw, sbw, and seac, -% and that there are no 5-byte numbers. - mark 0 3 -1 roll - { exch - { { dup 32 lt - { pop 0 } - { dup 247 lt - { 139 sub 0 } - { dup 251 lt - { 247 sub 256 mul 108 add 1 1 } - { 251 sub -256 mul -108 add -1 1 } - ifelse - } - ifelse - } - ifelse - } % 0 - { mul add 0 } % 1 - } - exch get exec - } - forall pop - counttomark 1 add 2 roll cleartomark % pop all but achar bchar - } - { pop % not seac - } - ifelse - } - { pop % punt - } - ifelse - } bind def - -% Define replacement procedures for loading fonts. -% If DISKFONTS is true and the body of the font is not encrypted with eexec: -% - Prevent the CharStrings from being made read-only. -% - Substitute a different CharString-reading procedure. -% (eexec disables this because the implicit 'systemdict begin' hides -% the redefinitions that make the scheme work.) -% We assume that: -% - The magic procedures (-|, -!, |-, and |) are defined with -% executeonly or readonly; -% - The contents of the reading procedures are as defined in bdftops.ps; -% - The font includes the code -% /CharStrings readonly put -/.loadfontdict 6 dict def mark - /begin % push this dict after systemdict - { dup begin - //systemdict eq { //.loadfontdict begin } if - } bind - /end % match begin - { currentdict end - //.loadfontdict eq currentdict //systemdict eq and { end } if - } bind - /dict % leave room for FontFile, BuildChar, BuildGlyph - { 3 add dict - } bind - /executeonly % for reading procedures - { readonly - } - /noaccess % for Subrs strings and Private dictionary - { readonly - } - /readonly % for procedures and CharStrings dictionary - { % We want to take the following non-standard actions here: - % - If the operand is the CharStrings dictionary, do nothing; - % - If the operand is a number (a file position replacing the - % actual CharString), do nothing; - % - If the operand is either of the reading procedures (-| or -!), - % substitute a different one. - dup type /dicttype eq % CharStrings or Private - count 2 gt and - { 1 index /CharStrings ne { readonly } if } - { dup type /arraytype eq % procedure or data array - { dup length 5 ge 1 index xcheck and - { dup 0 get /string eq - 1 index 1 get /currentfile eq and - 1 index 2 get /exch eq and - 1 index 3 get dup /readstring eq exch /readhexstring eq or and - 1 index 4 get /pop eq and - { /cskip_C cvx 2 packedarray cvx - } - { readonly - } - ifelse - } - { readonly - } - ifelse - } - { dup type /stringtype eq % must be a Subr string - { readonly } - if - } - ifelse - } - ifelse - } bind - /definefont % to insert BuildChar/Glyph and change FontType - { dup /FontType get 1 eq - { dup /FontType 4 put - dup /BuildChar /build_C load put - dup /BuildGlyph /build_C load put - } - if definefont - } bind -counttomark 2 idiv { .loadfontdict 3 1 roll put } repeat pop -.loadfontdict readonly pop - -% Define the BuildChar and BuildGlyph procedures for modified fonts. -% A single procedure serves for both. -/build_C % build_C - - { 1 index begin - dup dup type /integertype eq { Encoding exch get } if - % Stack: font code|name name - dup CharStrings exch .knownget not - { 2 copy eq { exch pop /.notdef exch } if - QUIET not - { (Substituting .notdef for ) print = flush } - { pop } - ifelse - /.notdef CharStrings /.notdef get - } if - % Stack: font code|name name charstring - dup type /integertype eq - { load_C end build_C } - { end .type1execchar } - ifelse - } bind def diff --git a/pstoraster/gs_dpnxt.ps b/pstoraster/gs_dpnxt.ps deleted file mode 100644 index 77fb0e5d2a..0000000000 --- a/pstoraster/gs_dpnxt.ps +++ /dev/null @@ -1,120 +0,0 @@ -% Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_dpnxt.ps,v 1.1 2000/03/08 23:14:28 mike Exp $ -% gs_dpnxt.ps -% NeXT Display PostScript extensions - -% Define the operation values for compositing. These must match the values -% in gsdpnext.h, which also are the ones from the NeXT documentation. -% We put them in systemdict, which seems like as good a place as any. -mark - /Clear /Copy /Sover /Sin /Sout /Satop /Dover /Din /Dout /Datop /Xor - /PlusD /PlusL /Highlight % not sure about Highlight -counttomark { counttomark 1 sub def } repeat pop - -% We implement readimage and sizeimage using the following 3 otherwise -% undocumented lower-level operators: -% -% .sizeimagebox -% -% -% - .sizeimageparams -% -% -% .getbitsrect -% -% NOTE: These operators are subject to change without notice! - -% Implement readimage using .getbitsrect. Experimentation on a NeXT system -% shows that the data is always returned in order of increasing device Y, -% regardless of the CTM. -% -% Note that we can't make stack protection work for this operator, -% because it must remove its operands from the stack before calling -% the supplied procedure(s). - -/readimage { % [... ] - % readimage - - .sizeimageparams exch { - % multiproc = true. If N > 1, store the procedures in an array. - exch pop 1 index { 1 add } if - % Stack: ... string alpha? nprocs - dup 1 eq { - pop false % only 1 procedure, multiproc is irrelevant - } { - dup array 4 1 roll 3 add 2 roll astore 3 1 roll true - } ifelse - } { - % multiproc = false. - pop pop false - } ifelse - % Map the rectangle to device coordinates. - % Stack: x y w h proc(s) str alpha? multi? - 8 -4 roll matrix .sizeimagebox pop 8 4 roll - % Make sure we allocate the operand array in local VM - % to avoid a possible invalidaccess. - .currentglobal false .setglobal 9 1 roll - exch { 1 } { 0 } ifelse exch % alpha is last, if present - exch 4 1 roll 8 array astore exch .setglobal - { % Read out a block of scan lines and pass them to the procedure. - % Stack: [x y w h alpha? proc(s) str multi?] -- we must consume this. - dup 3 get 0 eq { pop exit } if - aload 9 1 roll pop exch pop currentdevice 7 1 roll - % Always read out the data as standard (not native) pixels. - .sizeimageparams pop pop exch .getbitsrect - % Stack: [x y w h alpha? proc(s) str multi?] hread substr - 3 -1 roll - % Stack: hread substr [x y w h alpha? proc(s) str multi?] - dup 1 2 copy get 5 index add put - % Stack: hread substr [x y' w h alpha? proc(s) str multi?] - dup 3 2 copy get 6 -1 roll sub put - % Stack: substr [x y' w h' alpha? proc(s) str multi?] - dup 5 get exch 7 get { - % multiproc = true, pass each plane to a different procedure. - % Stack: substr procs - 0 1 2 index length 1 sub { - % Push 1 plane and its procedure under the top 2 elements. - % Stack: ... substr procs plane# - 2 index length 2 index length idiv % bytes per plane - dup 2 index mul exch - % Stack: ... substr procs plane# start length - 4 index 3 1 roll getinterval 4 1 roll - 2 copy get 4 1 roll pop - } for - exch pop length 2 mul .execn - } { - % multiproc = false, just call the procedure. - exec - } ifelse - } //systemdict /exec get 3 packedarray cvx loop -} bind odef - -% Implement sizeimage using lower-level operators. - -/sizeimage { % sizeimage - % - % - .sizeimagebox 5 -2 roll pop pop - .sizeimageparams 3 -1 roll 4 1 roll -} bind odef diff --git a/pstoraster/gs_dps.ps b/pstoraster/gs_dps.ps deleted file mode 100644 index cbf1c6e9e6..0000000000 --- a/pstoraster/gs_dps.ps +++ /dev/null @@ -1,205 +0,0 @@ -% Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_dps.ps,v 1.1 2000/03/08 23:14:28 mike Exp $ -% Initialization file for Display PostScript functions. - -% ------ Contexts ------ % - -% To create a context with private local VM, we use the .localfork -% operator to actually create the context, the new VM, and an empty -% userdict, and then we call the .initlocaldicts procedure to make -% local copies of the initial contents of the dictionaries in local VM. -% savedlocaldicts in systemdict is a global read-only dictionary whose -% elements are global read-only copies of these initial contents; -% we just copy its elements into local VM and install them in systemdict. -% userdict and internaldict require special handling. - -% Switching between contexts with different local VMs requires -% changing the bindings in systemdict that reference local objects. -% For this purpose, each userdict has an entry called localdicts -% which holds the local copies of the elements of savedlocaldicts, -% plus internaldict. The context switching code in the interpreter -% effectively copies this dictionary into systemdict. -% NOTE: the name localdicts is known to the interpreter. - -% Switching between contexts also requires resetting the user parameters. -% The interpreter records the value of userparams (a local dictionary -% referenced from systemdict) for each context, and uses it for this. -% See gs_lev2.ps for more details. -% NOTE: the name userparams is known to the interpreter. - -% Save copies of local dictionaries at the end of system initialization. -% Also save the initial gstate. -/.savelocalstate { - .currentglobal true .setglobal - //systemdict /savedlocaldicts mark //systemdict { - dup gcheck { - pop pop - } { - dup type /dicttype eq { - % Save a copy of this dictionary in global VM. - dup maxlength dict .copydict readonly - } { - pop pop - } ifelse - } ifelse - } forall .dicttomark readonly .forceput % systemdict is read-only - % Create localdicts for the current context. - false .setglobal - userdict /localdicts mark savedlocaldicts { - pop dup load - } forall /internaldict dup load - .dicttomark readonly put - % Save a copy of the initial gstate. - true .setglobal - //systemdict /savedinitialgstate gstate readonly put - .setglobal -} .bind def - -% Initialize local dictionaries and gstate when creating a new context. -% Note that until this completes, we are in the anomalous situation of -% having systemdict point to dictionaries that are in a non-current -% local VM. Because of this, we turn off garbage collection temporarily. -/.copylocal { % .copylocal - % Copy a dictionary to the current (local) VM, - % and make it read-only if its current definition is. - dup maxlength dict .copydict - 1 index load wcheck not { readonly } if -} .bind def -% When this is called, the dictionary stack is in its initial state, -% and there is (anomalously) only one gstate on the gstate stack. -/.initlocaldicts { % - .initlocaldicts - - -2 vmreclaim - .currentglobal //systemdict begin - false .setglobal - % Since localdicts doesn't exist yet, references from - % systemdict to local objects won't get restored if - % a context switch happens in this code. Therefore, - % until localdicts is defined, we have to keep all our - % state on the operand stack. - - % Acquire userdict. - %****** WRONG IF NON-STANDARD INITIAL DSTACK ****** - countdictstack array dictstack - { dup gcheck not { exit } if pop } forall - % Create localdicts with a local copy of each dictionary, - % except for userdict and userparams, which just need - % to be filled in. - mark savedlocaldicts { - 1 index /userdict eq { - % Stack: userdict mark ... /userdict inituserdict - counttomark 1 add index exch .copydict - } { - 1 index /userparams eq { - % Stack: userparams mark ... /userparams inituserparams - userparams .copydict - } { - .copylocal - } ifelse - } ifelse - } forall /internaldict dup .makeinternaldict .makeoperator - .dicttomark readonly /localdicts exch put - % localdicts is now defined in userdict. - % Copy the definitions into systemdict. - localdicts { .forcedef } forall - % Set the user parameters. - userparams readonly .setuserparams - % Establish the initial gstate(s). - /savedinitialgstate .systemvar setgstate gsave - % Wrap up. - end .setglobal -} odef - -% Create a context with private local VM. -% The .localfork operator does all the work, but we must ensure that -% .initlocaldicts gets called when the new context starts up. -/localfork { % ... - % - % localfork - .currentglobal true .setglobal 3 index - dup dup xcheck - exch type dup /arraytype eq exch /packedarraytype eq or and not { - pop .setglobal /localfork cvx /typecheck signalerror - } if - {exec .initlocaldicts} aload pop - 3 1 roll 3 packedarray cvx - 4 1 roll 5 -1 roll pop .setglobal .localfork -} odef - -% Fork a context that shares VM. We still need to fill in userparams -% when the new context starts up. -/.postfork { % - .postfork - - % Initialize the user parameters. - savedlocaldicts /userparams get userparams .copydict readonly pop -} odef -/fork { % ... fork - .currentglobal false .setglobal 1 index - dup dup xcheck - exch type dup /arraytype eq exch /packedarraytype eq or and not { - pop .setglobal /fork cvx /typecheck signalerror - } if - {exec .postfork} aload pop - 3 1 roll 3 packedarray cvx - 3 1 roll exch pop .setglobal .fork -} odef - -% ------ Halftone phase ------ % - -/sethalftonephase { % sethalftonephase - - -1 2 index 2 index .setscreenphase pop pop -} odef -/currenthalftonephase { % - currenthalftonephase - 0 .currentscreenphase -} odef - -% ------ Device-source images ------ */ - -.imagetypes 2 /.image2 load put - -% ------ Device information ------ % - -/.deviceinfodict mark - /Colors null /GrayValues null /RedValues null /GreenValues null - /BlueValues null /ColorValues null -.dicttomark readonly def -/deviceinfo { % - deviceinfo - currentdevice //.deviceinfodict .getdeviceparams .dicttomark readonly -} odef - -% The current implementation allocates a 2-element array each time. -% Perhaps we should change this to 2 separate parameters for X and Y? -/.wtdict mark - /wtranslation null -.dicttomark readonly def -/wtranslation { % - wtranslation - currentdevice //.wtdict .getdeviceparams exch pop exch pop aload pop -} odef -currentdict /.wtdict .undef - -% ------ View clipping ------ % - -/rectviewclip { % rectviewclip - - % rectviewclip - - newpath .rectappend viewclip -} odef diff --git a/pstoraster/gs_dps1.ps b/pstoraster/gs_dps1.ps deleted file mode 100644 index 73e338d996..0000000000 --- a/pstoraster/gs_dps1.ps +++ /dev/null @@ -1,147 +0,0 @@ -% Copyright (C) 1997 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_dps1.ps,v 1.2 2000/03/08 23:14:28 mike Exp $ -% Initialization file for most of the Display PostScript functions -% that are also included in Level 2. - -level2dict begin - -% ------ Virtual memory ------ % - -/currentshared /.currentglobal load def -/scheck /.gcheck load def -%****** FOLLOWING IS WRONG ****** -/shareddict currentdict /globaldict .knownget not { 20 dict } if def - -% Global and LocalFontDirectory must remain in systemdict -% even if we temporarily exit Level 2 mode. - -end % level2dict -systemdict begin - -/SharedFontDirectory .FontDirectory .gcheck - { .currentglobal false .setglobal - /LocalFontDirectory .FontDirectory dup maxlength dict copy - .forcedef % LocalFontDirectory is local, systemdict is global - .setglobal .FontDirectory - } - { /LocalFontDirectory .FontDirectory - .forcedef % LocalFontDirectory is local, systemdict is global - 50 dict - } -ifelse def - -end % systemdict -level2dict begin - -% setshared must rebind FontDirectory to the appropriate one of -% Local or SharedFontDirectory. - -/.setglobal % .setglobal - - { dup .setglobal - //systemdict /FontDirectory .currentglobal - { //SharedFontDirectory } - { /LocalFontDirectory .systemvar } % can't embed ref to local VM - ifelse .forceput pop % LocalFontDirectory is local, systemdict is global - } .bind odef % must bind .forceput and .setglobal - % even if NOBIND in effect -/setshared /.setglobal load def -.currentglobal setshared - -% See below for changes in save and restore. - -% ------ Fonts ------ % - -/selectfont % selectfont - - { 1 index findfont - 1 index dup type /arraytype eq { makefont } { scalefont } ifelse - setfont pop pop - } odef -% undefinefont has to take local/global VM into account. -/undefinefont % undefinefont - - { .FontDirectory 1 index .undef - .currentglobal - { % Current mode is global; delete from local directory too. - //systemdict /LocalFontDirectory .knownget - { 1 index .undef } - if - } - { % Current mode is local; if there was a shadowed global - % definition, copy it into the local directory. - //systemdict /SharedFontDirectory .knownget - { 1 index .knownget - { .FontDirectory 2 index 3 -1 roll put } - if - } - if - } - ifelse pop - } odef - -% If we load a font into global VM within an inner save, the restore -% will delete it from FontDirectory but not from SharedFontDirectory. -% We have to handle this by making restore copy missing entries from -% SharedFontDirectory to FontDirectory. Since this could slow down restore -% considerably, we define a new operator .dictcopynew for this purpose. -% Furthermore, if FAKEFONTS is in effect, we want global real fonts to -% override fake local ones. We handle this by brute force. -/restore % restore - - { dup //restore % bind even if NOBIND - /LocalFontDirectory .systemvar - FAKEFONTS - { mark - % We want to delete a fake font from the local directory - % iff the global directory now has no definition for it, - % or a non-fake definition. - 1 index dup - { % Stack: lfd mark lfd key ... lfd key value - length 1 gt - { % This is a real local definition; don't do anything. - pop - } - { % This is a fake local definition, check for global. - //SharedFontDirectory 1 index .knownget - { % A global definition exists, check for fake. - length 1 eq { pop } { 1 index } ifelse - } - { % No global definition, delete the local one. - 1 index - } - ifelse - } - ifelse - } forall - pop counttomark 2 idiv { .undef } repeat pop - } - if - //SharedFontDirectory exch .dictcopynew pop - .currentglobal .setglobal % Rebind FontDirectory according to current VM. - pop - } bind odef - -% ------ Miscellaneous ------ % - -/undef /.undef load def - -end % level2dict diff --git a/pstoraster/gs_dps2.ps b/pstoraster/gs_dps2.ps deleted file mode 100644 index 4fa03d3d0f..0000000000 --- a/pstoraster/gs_dps2.ps +++ /dev/null @@ -1,200 +0,0 @@ -% Copyright (C) 1990, 1996, 1997 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_dps2.ps,v 1.1 2000/03/08 23:14:29 mike Exp $ -% Initialization file for basic Display PostScript functions -% that are also included in Level 2. - -level2dict begin - -% ------ Halftones ------ % - -/.makestackdict - { { counttomark -1 roll } forall .dicttomark - } bind def -/currenthalftone % - currenthalftone - { mark .currenthalftone - { { exch pop } % halftone - { /HalftoneType 1 % screen - { /Frequency /Angle /SpotFunction } - .makestackdict - } - { /HalftoneType 2 % colorscreen - { /RedFrequency /RedAngle /RedSpotFunction - /GreenFrequency /GreenAngle /GreenSpotFunction - /BlueFrequency /BlueAngle /BlueSpotFunction - /GrayFrequency /GrayAngle /GraySpotFunction - } - .makestackdict - } - } - exch get exec - } odef -% Define sethalftone so it converts all other types to type 5. -/.sethalftoneRGBV % - { 4 -1 roll exch { 1 index exch get exch } forall 15 1 roll - 14 -2 roll mark 15 1 roll { /Gray /Blue /Green /Red } - { % stack: v0 v1 v2 type keys comp - mark - 2 index 0 get 8 -1 roll - 4 index 1 get 9 -1 roll - 6 index 2 get 10 -1 roll - % stack: type keys comp mark k0 v0 k1 v1 k2 v2 - /HalftoneType 10 index .dicttomark - counttomark 2 roll - } - forall pop pop - /Default 1 index .dicttomark .sethalftone5 - } bind def -/sethalftone { % sethalftone - - % We must create the new dictionary in the same VM as the - % operand; otherwise, invalidaccess errors may occur. - .currentglobal 1 index dup gcheck .setglobal - dup /HalftoneType get 1 sub { - { mark /Default 2 index .dicttomark .sethalftone5 - } - { 1 { /Frequency /Angle /SpotFunction } - { /RedFrequency /RedAngle /RedSpotFunction - /GreenFrequency /GreenAngle /GreenSpotFunction - /BlueFrequency /BlueAngle /BlueSpotFunction - /GrayFrequency /GrayAngle /GraySpotFunction - } .sethalftoneRGBV - } - { mark /Default 2 index .dicttomark .sethalftone5 - } - { 3 { /Width /Height /Thresholds } - { /RedWidth /RedHeight /RedThresholds - /GreenWidth /GreenHeight /GreenThresholds - /BlueWidth /BlueHeight /BlueThresholds - /GrayWidth /GrayHeight /GrayThresholds - } .sethalftoneRGBV - } - { dup .sethalftone5 - } - } exch get exec .setglobal pop -} odef -% Redefine setscreen and setcolorscreen to recognize halftone dictionaries, -% and to insert the Frequency and Angle into Type 1 halftones, per -% Adobe TN 5085. -/.fixsethalftonescreen % .fix...screen - % - { dup dup /HalftoneType get 1 eq - { dup wcheck not { dup length .copydict } if - dup /Frequency 5 index put - dup /Angle 4 index put - } - if - } bind def -/setscreen % setscreen - - { dup type /dicttype eq - { .fixsethalftonescreen sethalftone pop pop pop } - { //setscreen } - ifelse - } odef -/setcolorscreen % setcolorscreen - - { dup type /dicttype eq - { .fixsethalftonescreen sethalftone 12 { pop } repeat } - { //setcolorscreen } - ifelse - } odef -% Redefine currentscreen and currentcolorscreen to extract the Frequency -% and Angle from Type 1 halftones, per Adobe TN 5085. -/.fixcurrenthalftonescreen % .fix... - { dup /HalftoneType get 1 eq - { dup /Frequency get 1 index /Angle get } - { 60 0 } - ifelse 3 2 roll - } bind def -/currentscreen % - currentscreen 60 0 - { .currenthalftone - { { .fixcurrenthalftonescreen } % halftone - { } % screen - { 12 3 roll 9 { pop } repeat % colorscreen - dup type /dicttype eq { .fixcurrenthalftonescreen } if - } - } - exch get exec - } odef -/currentcolorscreen % - currentcolorscreen (60 0 )*4 - { .currenthalftone - { { .fixcurrenthalftonescreen 3 copy 6 copy } % halftone - { 3 copy 6 copy } % screen - { } % colorscreen - } - exch get exec - } odef - -% ------ User objects ------ % - -/.localarray where { - pop -} { - /.localarray { - currentglobal false setglobal - exch array exch setglobal - } bind def -} ifelse -/.UserObjects { - .userdict /UserObjects -} odef -% In order to get proper error recovery behavior, we need to be careful -% not to pop any operands from the stack until we're done. -% The code below faithfully duplicates the apparent array-growing -% behavior of Adobe interpreters. -/defineuserobject { % defineuserobject - - .UserObjects .knownget { - length dup 3 index le { - % Stack: index value len - 2 index eq { 1 index 2 mul } { 1 index 1 add } ifelse - .localarray .UserObjects get - 1 index copy pop - .UserObjects 3 -1 roll put - } { - pop - } ifelse - } { - .UserObjects 3 index 1 add 10 .max .localarray put - } ifelse - .UserObjects get 2 index 2 index put pop pop -} odef -/execuserobject { % execuserobject - - .UserObjects get 1 index get exch pop exec -} odef -/undefineuserobject { % undefineuserobject - - .UserObjects get 1 index null put pop -} odef - -% ------ Cache control ------ % - -% Dummy definitions for cache control operators - -/ucachestatus { % - ucachestatus -mark- ? ? ? ? - mark 0 0 0 0 .userdict /.ucachesize .knownget not { 0 } if -} odef -/setucacheparams { % -mark- ... setucacheparams - - % Provoke an appropriate error if needed. - counttomark 1 lt { () 0 get } if - 0 or .userdict /.ucachesize 2 index 0 .max put cleartomark -} odef - -end % level2dict diff --git a/pstoraster/gs_epsf.ps b/pstoraster/gs_epsf.ps deleted file mode 100644 index 0d36e44bd0..0000000000 --- a/pstoraster/gs_epsf.ps +++ /dev/null @@ -1,67 +0,0 @@ -% Copyright (C) 1989, 1996 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_epsf.ps,v 1.1 2000/03/08 23:14:29 mike Exp $ -% Allow the interpreter to recognize MS-DOS EPSF file headers, and skip to -% the PostScript section of the file. - -/.runnoepsf /run load def -/.epsfheader def -/run - { dup type /filetype ne { (r) file } if - % Check for MS-DOS EPSF file (see Red Book p. 729). - true exch 0 1 3 - { % Stack: true file index - 1 index read dup { pop dup .epsfheader 3 index get eq } if - { pop pop } % if matched, don't need the character - { % unread characters (wasn't EPSF) - 2 index exch unread % unread mismatch character - dup { % loop unreading backwards in .epsfheader - 1 sub dup .epsfheader exch get 2 index exch unread - } repeat pop - exch not exch exit % change true to false - } - ifelse - } - for exch % Stack: file true/false - { % This block is executed if the file is MS-DOS EPSF. - % Build up the little-endian byte offset and length. - 2 - { 1 0 4 - { 2 index read not { pop exit } if % if EOF, let error happen - 2 index mul add exch 256 mul exch - } - repeat exch pop exch - } - repeat - % Stack: offset length file - % Use flushfile to skip quickly to the start of the - % PostScript section. - dup 4 -1 roll 12 sub () /SubFileDecode filter flushfile - % Now interpret the PostScript. - exch () /SubFileDecode filter cvx .runexec - } - { .runnoepsf - } - ifelse - } odef diff --git a/pstoraster/gs_fform.ps b/pstoraster/gs_fform.ps deleted file mode 100644 index f4739427e3..0000000000 --- a/pstoraster/gs_fform.ps +++ /dev/null @@ -1,100 +0,0 @@ -% Copyright (C) 1995, 1996, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_fform.ps,v 1.2 2000/03/08 23:14:29 mike Exp $ -% Form caching implemented in PostScript. - -% This implementation doesn't do the right thing about halftone or -% Pattern phase, but the Pattern cache doesn't either.... - -% The Form cache key is the Form dictionary; the value is an array -% of 2 elements [CTM pattern_instance]. -% -% In order to prevent restore from clearing the cache, we explicitly -% push the cache entries on the stack before a restore and reinstall them. -currentglobal false setglobal -/.formcachedict 20 dict def % must be local -true setglobal -/restore { - mark .formcachedict { } forall - counttomark 1 add index { restore } .internalstopped - { cleartomark restore } - { counttomark 2 idiv { .formcachedict 3 1 roll put } repeat pop pop } - ifelse -} bind odef - -/.execform1 { - dup /Implementation known not { - dup /FormType get 1 ne { /rangecheck signalerror } if - % The Implementation is a Pattern that will draw the form. - currentglobal 1 index gcheck setglobal - % Stack: form global - 10 dict begin - /PatternType 1 def - /PaintType 1 def % colored - /TilingType 1 def % irrelevant - % Copy the BBox to the correct VM. - /BBox 2 index /BBox get 4 array copy exch 1 index def - % Set XStep and YStep to very large numbers, - % so we won't get multiple copies of the form. - /XStep 1 index dup 2 get exch 0 get sub 100 mul def - /YStep exch dup 3 get exch 1 get sub 100 mul def - /PaintProc 2 index /PaintProc get def - currentdict end readonly - % Stack: form global impl - exch setglobal - 1 index /Implementation 3 -1 roll .forceput - } if - .formcachedict 1 index .knownget { - % Check whether we can use the cached value. - % Stack: form cachevalue - matrix currentmatrix true 0 1 3 { - % Stack: form cachevalue curmat true index - 3 index 0 get 1 index get exch 3 index exch get ne { - pop pop false exit - } if - } for exch pop - } { - false - } ifelse not - { % Make a new cache entry. - gsave - matrix currentmatrix dup 4 0 put dup 5 0 put dup setmatrix - % Stack: form mat - 1 index /Implementation get - 2 index /Matrix get - makepattern 2 array astore - .formcachedict 2 index 2 index put - grestore - } if - % Stack: form cachevalue - -1 0 0 transform - 2 { exch round cvi } repeat .setscreenphase - 1 get setpattern - /BBox get aload pop - exch 3 index sub exch 2 index sub rectfill -} .bind odef % must bind .forceput - -.formtypes 1 /.execform1 load put - -setglobal diff --git a/pstoraster/gs_fonts.ps b/pstoraster/gs_fonts.ps deleted file mode 100644 index 99664d904c..0000000000 --- a/pstoraster/gs_fonts.ps +++ /dev/null @@ -1,934 +0,0 @@ -% Copyright (C) 1990, 1995, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_fonts.ps,v 1.2.2.1 2001/05/13 18:38:31 mike Exp $ -% Font initialization and management code. - -% Define the default font. -/defaultfontname /Courier def - -% Define the name of the font map file. -/defaultfontmap (Fontmap) def - -% ------ End of editable parameters ------ % - -% If SUBSTFONT is defined, make it the default font. -/SUBSTFONT where { pop /defaultfontname /SUBSTFONT load def } if - -% Define a reliable way of accessing FontDirectory in systemdict. -/.FontDirectory -{ /FontDirectory .systemvar -} .bind odef - -% If DISKFONTS is true, we load individual CharStrings as they are needed. -% (This is intended primarily for machines with very small memories.) -% In this case, we define another dictionary, parallel to FontDirectory, -% that retains an open file for every font loaded. -/FontFileDirectory 10 dict def - -% Define a temporary string for local use, since using =string -% interferes with some PostScript programs. -/.fonttempstring 128 string def - -% Split up a search path into individual directories or files. -/.pathlist % .pathlist ... - { { dup length 0 eq { pop exit } if - .filenamelistseparator search not { exit } if - exch pop exch - } - loop - } bind def - -% Load a font name -> font file name map. -userdict /Fontmap .FontDirectory maxlength dict put -/.loadFontmap % .loadFontmap - - { % We would like to simply execute .definefontmap as we read, - % but we have to maintain backward compatibility with an older - % specification that makes later entries override earlier. - 50 dict exch - { dup token not { closefile exit } if - % stack: fontname - % This is a hack to get around the absurd habit of MS-DOS editors - % of adding an EOF character at the end of the file. - dup (\032) eq { pop closefile exit } if - 1 index token not - { (Fontmap entry for ) print dup =only - ( has no associated file or alias name! Giving up.\n) print flush - {.loadFontmap} 0 get 1 .quit - } if - dup type dup /stringtype eq exch /nametype eq or not - { (Fontmap entry for ) print 1 index =only - ( has an invalid file or alias name! Giving up.\n) print flush - {.loadFontmap} 0 get 1 .quit - } if - % stack: dict file fontname filename|aliasname - % Read and pop tokens until a semicolon. - { 2 index token not - { (Fontmap entry for ) print 1 index =only - ( ends prematurely! Giving up.\n) print flush - {.loadFontmap} 0 get 1 .quit - } if - dup /; eq { pop 3 index 3 1 roll .growput exit } if - pop - } loop - } loop - { .definefontmap } forall - } bind def -% Add an entry in Fontmap. We redefine this if the Level 2 -% resource machinery is loaded. -/.definefontmap % .definefontmap - - { % Since Fontmap is global, make sure the values are storable. - .currentglobal 3 1 roll true .setglobal - dup type /stringtype eq - { dup .gcheck not { dup length string copy } if - } - if - Fontmap 3 -1 roll 2 copy .knownget - { % Add an element to the end of the existing value, - % unless it's the same as the current last element. - mark exch aload pop counttomark 4 add -1 roll - 2 copy eq { cleartomark pop pop } { ] readonly .growput } ifelse - } - { % Make a new entry. - mark 4 -1 roll ] readonly .growput - } - ifelse .setglobal - } bind def - -% Parse a font file just enough to find the FontName or FontType. -/.findfontvalue % .findfontvalue true - % .findfontvalue false - % Closes the file in either case. - { exch dup read not { -1 } if - 2 copy unread 16#80 eq - { dup (xxxxxx) readstring pop pop } % skip .PFB header - if - % Stack: key file - { dup token not { false exit } if % end of file - dup /eexec eq { pop false exit } if % reached eexec section - dup /Subrs eq { pop false exit } if % Subrs without eexec - dup /CharStrings eq { pop false exit } if % CharStrings without eexec - dup 3 index eq - { xcheck not { dup token exit } if } % found key - { pop } - ifelse - } loop - % Stack: key file value true (or) - % Stack: key file false - dup { 4 } { 3 } ifelse -2 roll closefile pop - } bind def -/.findfontname - { /FontName .findfontvalue - } bind def - -% If there is no FONTPATH, try to get one from the environment. -NOFONTPATH { /FONTPATH () def } if -/FONTPATH where - { pop } - { /FONTPATH (GS_FONTPATH) getenv not { () } if def } -ifelse -FONTPATH length 0 eq { (%END FONTPATH) .skipeof } if -/FONTPATH [ FONTPATH .pathlist ] def - -% Scan directories looking for plausible fonts. "Plausible" means that -% the file begins with %!PS-AdobeFont or %!FontType1, or with \200\001 -% followed by four arbitrary bytes and then either of these strings. -% To speed up the search, we skip any file whose name appears in -% the Fontmap (with any extension and upper/lower case variation) already, -% and any file whose extension definitely indicates it is not a font. -% -% NOTE: The current implementation of this procedure is somewhat Unix/DOS- -% specific. It assumes that '/' and '\' are directory separators, and that -% the part of a file name following the last '.' is the extension. -% -/.lowerstring % .lowerstring - { 0 1 2 index length 1 sub - { 2 copy get dup 65 ge exch 90 le and - { 2 copy 2 copy get 32 add put } - if pop - } - for - } bind def -/.splitfilename % .basename - { { (/) search { true } { (\\) search } ifelse - { pop pop } - { exit } - ifelse - } - loop - dup { (.) search { pop pop } { exit } ifelse } loop - 2 copy eq - { pop () } - { exch dup length 2 index length 1 add sub 0 exch getinterval exch } - ifelse -% Following is debugging code. -% (*** Split => ) print 2 copy exch ==only ( ) print ==only -% ( ***\n) print flush - } bind def -/.scanfontdict 1 dict def % establish a binding -/.scanfontbegin - { % Construct the table of all file names already in Fontmap. - currentglobal true setglobal - .scanfontdict dup maxlength Fontmap length 2 add .max .setmaxlength - Fontmap - { exch pop - { dup type /stringtype eq - { .splitfilename pop .fonttempstring copy .lowerstring cvn - .scanfontdict exch true put - } - { pop - } - ifelse - } - forall - } - forall - setglobal - } bind def -/.scanfontskip mark - % Strings are converted to names anyway, so.... - /afm true - /bat true - /c true - /cmd true - /com true - /dir true - /dll true - /doc true - /drv true - /exe true - /fon true - /fot true - /h true - /o true - /obj true - /pfm true - /pss true % Adobe Multiple Master font instances - /txt true -.dicttomark def -/.scan1fontstring 128 string def -/.scanfontheaders [(%!PS-Adobe*) (%!FontType*)] def -0 .scanfontheaders { length max } forall 6 add % extra for PFB header -/.scan1fontfirst exch string def -/.scanfontdir % .scanfontdir - - { currentglobal exch true setglobal - QUIET not { (Scanning ) print dup print ( for fonts...) print flush } if - (*) 2 copy .filenamedirseparator - dup (\\) eq { pop (\\\\) } if % double \ for pattern match - exch concatstrings concatstrings - 0 0 0 4 -1 roll % found scanned files - { % stack: - exch 1 add exch % increment filecount - dup .splitfilename .lowerstring - % stack: - % - .scanfontskip exch known exch .scanfontdict exch known or - { pop - % stack: - } - { 3 -1 roll 1 add 3 1 roll - % stack: - dup (r) { file } .internalstopped - { pop pop null () - % stack: - % null () - } - { - % On some platforms, the file operator will open directories, - % but an error will occur if we try to read from one. - % Handle this possibility here. - dup .scan1fontfirst { readstring } .internalstopped - { pop pop () } - { pop } - ifelse - % stack: - %
- } - ifelse - % Check for PFB file header. - dup (\200\001????*) .stringmatch - { dup length 6 sub 6 exch getinterval } - if - % Check for font file headers. - false .scanfontheaders - { 2 index exch .stringmatch or - } - forall exch pop - { % stack: - % - dup 0 setfileposition .findfontname - { dup Fontmap exch known - { pop pop - } - { exch copystring exch - DEBUG { dup =only (\n) print flush } if - 1 index .definefontmap - .splitfilename pop true .scanfontdict 3 1 roll .growput - % Increment fontcount. - 3 -1 roll 1 add 3 1 roll - } - ifelse - } - { pop - } - ifelse - } - % .findfontname will have done a closefile in the above case. - { dup null eq { pop } { closefile } ifelse pop - } - ifelse - } - ifelse - } - .scan1fontstring filenameforall - QUIET - { pop pop pop } - { ( ) print =only ( files, ) print =only ( scanned, ) print - =only ( new fonts.\n) print flush - } - ifelse - setglobal - } bind def - -%END FONTPATH - -% Create the dictionary that registers the .buildfont procedure (called by -% definefont) for each FontType. -/buildfontdict 20 dict def - -% Register Type 3 fonts, which are always supported, for definefont. -buildfontdict 3 /.buildfont3 cvx put - -% Register Type 0 fonts if they are supported. Strictly speaking, -% we should do this in its own file (gs_type0.ps), but since this is -% the only thing that would be in that file, it's simpler to put it here. -/.buildfont0 where { pop buildfontdict 0 /.buildfont0 cvx put } if - -% Define definefont. This is a procedure built on a set of operators -% that do all the error checking and key insertion. -/.growfontdict - { % Grow the font dictionary, if necessary, to ensure room for an - % added entry, making sure there is at least one slot left for FID. - dup maxlength 1 index length sub 2 lt - { dup dup wcheck - { .growdict } - { .growdictlength dict .copydict } - ifelse - } - { dup wcheck not { dup maxlength dict .copydict } if - } - ifelse - } bind def -/.completefont { - { % Check for disabled platform fonts. - NOPLATFONTS - { % Make sure we leave room for FID. - .growfontdict dup /ExactSize 0 put - } - { % Hack: if the Encoding looks like it might be the - % Symbol or Dingbats encoding, load those now (for the - % benefit of platform font matching) just in case - % the font didn't actually reference them. - % Note that some types of font don't have an Encoding. - dup /Encoding .knownget { - dup length 65 ge { - 64 get - dup /congruent eq { SymbolEncoding pop } if - /a9 eq { DingbatsEncoding pop } if - } { - pop - } ifelse - } if - } - ifelse - true exch - dup /FontType known not { - % This might be a CIDFont. - dup /CIDFontType known { - /.buildcidfont where { - pop exch pop false exch - } if - } if - } if - exch { - dup /FontType get //buildfontdict exch get exec - } { - .buildcidfont - } ifelse - - DISKFONTS - { FontFileDirectory 2 index known - { dup /FontFile FontFileDirectory 4 index get .growput - } - if - } - if - readonly % stack: name fontdict - } stopped { /invalidfont signalerror } if -} bind odef -/definefont - { .completefont - % If the current allocation mode is global, also enter - % the font in LocalFontDirectory. - .currentglobal - { //systemdict /LocalFontDirectory .knownget - { 2 index 2 index .growput } - if - } - if - dup .FontDirectory 4 -2 roll .growput - } odef - -% Define a procedure for defining aliased fonts. -% We use this only for explicitly aliased fonts, not substituted fonts: -% we think this matches the observed behavior of Adobe interpreters. -/.aliasfont % .aliasfont - { .currentglobal 3 1 roll dup .gcheck .setglobal - dup length 2 add dict - dup 3 -1 roll { 1 index /FID eq { pop pop } { put dup } ifelse } forall - % Stack: global fontname newfont newfont. - % We might be defining a global font whose FontName - % is a local string. This is weird, but legal, - % and doesn't cause problems anywhere else: - % to avoid any possible problems in this case, do a cvn. - % We might also be defining (as an alias) a global font - % whose FontName is a local non-string, if someone passed a - % garbage value to findfont. In this case, just don't - % call definefont at all. - 2 index dup type /stringtype eq exch .gcheck or 1 index .gcheck not or - { /FontName 3 index dup type /stringtype eq { cvn } if put - % Don't bind in definefont, since Level 2 redefines it. - /definefont .systemvar exec - } - { .completefont pop exch pop - } - ifelse exch .setglobal - } odef % so findfont will bind it - -% Define .loadfontfile for loading a font. If we recognize Type 1 and/or -% TrueType fonts, gs_type1.ps and/or gs_ttf.ps will redefine this. -/.loadfontfile { - % According to Ed Taft, Adobe interpreters push userdict - % before loading a font, and pop it afterwards. - userdict begin - cvx exec - end -} bind def -/.loadfont - { % Some buggy fonts leave extra junk on the stack, - % so we have to make a closure that records the stack depth - % in a fail-safe way. - /.loadfontfile cvx count 1 sub 2 packedarray cvx exec - count exch sub { pop } repeat - } bind def - -% Find an alternate font to substitute for an unknown one. -% We go to some trouble to parse the font name and extract -% properties from it. Later entries take priority over earlier. -/.substitutefaces [ - % Guess at suitable substitutions for random unknown fonts. - [(Grot) /Times] - [(Roman) /Times] - [(Book) /NewCenturySchlbk] - % If the family name appears in the font name, - % use a font from that family. - [(Arial) /Helvetica] - [(Avant) /AvantGarde] - [(Bookman) /Bookman] - [(Century) /NewCenturySchlbk] - [(Cour) /Courier] - [(Frut) /Helvetica] - [(Geneva) /Helvetica] - [(Helv) /Helvetica] - [(NewYork) /Times] - [(Pala) /Palatino] - [(Sans) /Helvetica] - [(Schlbk) /NewCenturySchlbk] - [(Serif) /Times] - [(Swiss) /Helvetica] - [(Times) /Times] - [(Univers) /Helvetica] - % Substitute for Adobe Multiple Master fonts. - [(Minion) /Times] - [(Myriad) /Helvetica] - [(MyriadPkg) /Helvetica-Narrow] - % Condensed or narrow fonts map to the only narrow family we have. - [(Cond) /Helvetica-Narrow] - [(Narrow) /Helvetica-Narrow] - % If the font wants to be monospace, use Courier. - [(Monospace) /Courier] - [(Typewriter) /Courier] -] readonly def -/.substituteproperties [ - [(It) 1] [(Oblique) 1] - [(Bd) 2] [(Bold) 2] [(bold) 2] [(Demi) 2] [(Heavy) 2] [(Sb) 2] -] readonly def -/.substitutefamilies mark - /AvantGarde - {/AvantGarde-Book /AvantGarde-BookOblique - /AvantGarde-Demi /AvantGarde-DemiOblique} - /Bookman - {/Bookman-Demi /Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic} - /Courier - {/Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique} - /Helvetica - {/Helvetica /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique} - /Helvetica-Narrow - {/Helvetica-Narrow /Helvetica-Narrow-Oblique - /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique} - /NewCenturySchlbk - {/NewCenturySchlbk-Roman /NewCenturySchlbk-Italic - /NewCenturySchlbk-Bold /NewCenturySchlbk-BoldItalic} - /Palatino - {/Palatino-Roman /Palatino-Italic /Palatino-Bold /Palatino-BoldItalic} - /Times - {/Times-Roman /Times-Italic /Times-Bold /Times-BoldItalic} -.dicttomark readonly def -/.substitutefont % .substitutefont - { % Look for properties and/or a face name in the font name. - % If we find any, use Helvetica as the base font; - % otherwise, use the default font. - % Note that the "substituted" font name may be the same as - % the requested one; the caller must check this. - dup type dup /stringtype eq exch /nametype eq or - { dup length string cvs } { () } ifelse - {defaultfontname /Helvetica-Oblique /Helvetica-Bold /Helvetica-BoldOblique} - exch 0 exch % stack: fontname facelist properties fontname - % Look for a face name. - .substitutefaces - { 2 copy 0 get search - { pop pop pop 1 get .substitutefamilies exch get - 4 -1 roll pop 3 1 roll - } - { pop pop - } - ifelse - } - forall - .substituteproperties - { 2 copy 0 get search - { pop pop pop 1 get 3 -1 roll or exch } - { pop pop } - ifelse - } - forall pop get exec - % Only accept fonts known in the Fontmap. - Fontmap 1 index known not { pop defaultfontname } if - } bind def - -% If requested, make (and recognize) fake entries in FontDirectory for fonts -% present in Fontmap but not actually loaded. Thanks to Ray Johnston for -% the idea behind this code. -FAKEFONTS not { (%END FAKEFONTS) .skipeof } if - -% We use the presence or absence of the FontMatrix key to indicate whether -% a font is real or fake. We must pop the arguments at the very end, -% so that stack protection will be effective. - -/definefont { % definefont - dup /FontMatrix known { - //definefont - } { - 2 copy /FontName get findfont //definefont exch pop exch pop - } ifelse -} bind odef - -/scalefont { % scalefont - 1 index /FontMatrix known { - //scalefont - } { - 1 index /FontName get findfont 1 index //scalefont - exch pop exch pop - } ifelse -} bind odef - -/makefont { % makefont - 1 index /FontMatrix known { - //makefont - } { - 1 index /FontName get findfont 1 index //makefont - exch pop exch pop - } ifelse -} bind odef - -/setfont { % setfont - - dup /FontMatrix known { - //setfont - } { - dup /FontName get findfont //setfont pop - } ifelse -} bind odef - -%END FAKEFONTS - -% Define findfont so it tries to load a font if it's not found. -% The Red Book requires that findfont be a procedure, not an operator, -% but it still needs to restore the stacks reliably if it fails, -% so we do all the work in an operator. -/.findfont { - mark 1 index - //systemdict begin .dofindfont - % Define any needed aliases. - counttomark 1 sub { .aliasfont } repeat end - exch pop exch pop -} odef -/findfont { - .findfont -} bind def -% Check whether the font name we are about to look for is already on the list -% of aliases we're accumulating; if so, cause an error. -/.checkalias % -mark- ... .checkalias <> - { counttomark 1 sub -1 1 - { index 1 index eq - { pop QUIET not - { (Unable to substitute for font.\n) print flush - } if - /findfont cvx /invalidfont signalerror - } - if - } - for - } bind def -% Get a (non-fake) font if present in a FontDirectory. -/.fontknownget % .fontknownget true - % .fontknownget false - { .knownget - { FAKEFONTS - { dup /FontMatrix known { true } { pop false } ifelse } - { true } - ifelse - } - { false - } - ifelse - } bind def -% Do the work of findfont, including substitution, defaulting, and -% scanning of FONTPATH. -/.dofindfont % .dofindfont - { { .tryfindfont { exit } if - % We didn't find the font. If we haven't scanned - % all the directories in FONTPATH, scan the next one now, - % and look for the font again. - null 0 1 FONTPATH length 1 sub - { FONTPATH 1 index get null ne { exch pop exit } if pop - } - for dup null ne - { dup 0 eq { .scanfontbegin } if - FONTPATH 1 index get .scanfontdir - FONTPATH exch null put - % Start over with an empty alias list. - counttomark 1 sub { pop } repeat - .dofindfont exit - } - if pop - % No luck. Make sure we're not already - % looking for the default font. - dup defaultfontname eq - { QUIET not - { (Unable to load default font ) print - dup =only (! Giving up.\n) print flush - } - if /findfont cvx /invalidfont signalerror - } - if - % Substitute for the font. Don't alias. - /SUBSTFONT where { - pop QUIET not { - (Substituting for font ) print dup =only - (.\n) print flush - } if - cleartomark mark defaultfontname - } { - dup .substitutefont - 2 copy eq { pop defaultfontname } if - .checkalias - QUIET not { - (Substituting font ) print dup =only ( for ) print - 1 index =only (.\n) print flush - } if - % Remove all the accumulated aliases. - counttomark 1 add 1 roll cleartomark mark exch - } ifelse - } - loop - } bind def -% Try to find a font using only the present contents of Fontmap. -/.tryfindfont % .tryfindfont true - % .tryfindfont false - { .FontDirectory 1 index .fontknownget - { % Already loaded - exch pop true - } - { dup Fontmap exch .knownget not - { % Unknown font name. Look for a file with the - % same name as the requested font. - dup dup type /nametype eq { .namestring } if .loadfontloop - } - { % Try each element of the Fontmap in turn. - false exch % (in case we exhaust the list) - % Stack: fontname false fontmaplist - { exch pop - dup type /nametype eq - { % Font alias - .checkalias .tryfindfont exit - } - { dup dup type dup /arraytype eq exch /packedarraytype eq or exch xcheck and - { % Font with a procedural definition - exec % The procedure will load the font. - % Check to make sure this really happened. - .FontDirectory 1 index .knownget - { exch pop true exit } - if - } - { % Font file name - .loadfontloop { true exit } if - } - ifelse - } - ifelse false - } - forall - % Stack: font true -or- fontname false - { true - } - { % None of the Fontmap entries worked. - % Try loading a file with the same name - % as the requested font. - dup dup type /nametype eq { .namestring } if .loadfontloop - } - ifelse - } - ifelse - } - ifelse - } bind def -% Attempt to load a font from a file. -/.loadfontloop % .loadfontloop true - % .loadfontloop false - { % See above regarding the use of 'loop'. - - { - % Is the font name a string? - dup type /stringtype ne - { QUIET not - { (Can't find font with non-string name: ) print dup =only (.\n) print flush - } - if pop false exit - } - if - % Can we open the file? - findlibfile not - { QUIET not - { (Can't find \(or can't open\) font file ) print dup print - (.\n) print flush - } - if pop false exit - } - if - - % Stack: fontname fontfilename fontfile - DISKFONTS - { .currentglobal true .setglobal - 2 index (r) file - FontFileDirectory exch 5 index exch .growput - .setglobal - } - if - QUIET not - { (Loading ) print 2 index =only - ( font from ) print 1 index print (... ) print flush - } - if - % If LOCALFONTS isn't set, load the font into local or global - % VM according to FontType; if LOCALFONTS is set, load the font - % into the current VM, which is what Adobe printers (but not - % DPS or CPSI) do. - LOCALFONTS { false } { /setglobal where } ifelse - { pop /FontType .findfontvalue { 1 eq } { false } ifelse - % .setglobal, like setglobal, aliases FontDirectory to - % GlobalFontDirectory if appropriate. However, we mustn't - % allow the current version of .setglobal to be bound in, - % because it's different depending on language level. - .currentglobal exch /.setglobal .systemvar exec - % Remove the fake definition, if any. - .FontDirectory 3 index .undef - 1 index (r) file .loadfont .FontDirectory exch - /.setglobal .systemvar exec - } - { .loadfont .FontDirectory - } - ifelse - % Stack: fontname fontfilename fontdirectory - QUIET not - { //systemdict /level2dict known - { .currentglobal false .setglobal vmstatus - true .setglobal vmstatus 3 -1 roll pop - 6 -1 roll .setglobal 5 - } - { vmstatus 3 - } - ifelse { =only ( ) print } repeat - (done.\n) print flush - } if - - % Check to make sure the font was actually loaded. - dup 3 index .fontknownget - { 4 1 roll pop pop pop true exit } if - - % Maybe the file had a different FontName. - % See if we can get a FontName from the file, and if so, - % whether a font by that name exists now. - exch (r) file .findfontname - { 2 copy .fontknownget - { % Yes. Stack: origfontname fontdirectory filefontname fontdict - 3 -1 roll pop exch - QUIET - { pop - } - { (Using ) print =only - ( font for ) print 1 index =only - (.\n) print flush - } - ifelse true exit - } - if pop - } - if pop - - % The font definitely did not load correctly. - QUIET not - { (Loading ) print dup =only - ( font failed.\n) print flush - } if - false exit - - } loop % end of loop - - } bind def - -% Define a procedure to load all known fonts. -% This isn't likely to be very useful. -/loadallfonts - { Fontmap { pop findfont pop } forall - } bind def - -% If requested, load all the fonts defined in the Fontmap into FontDirectory -% as "fake" fonts i.e., font dicts with only FontName and FontType defined. -% (We define FontType only for the sake of some questionable code in the -% Apple Printer Utility 2.0 font inquiry code.) -% -% Note that this procedure only creates fake fonts in the FontDirectory -% associated with the current VM. This is because in multi-context systems, -% creating the fake fonts in local VM leads to undesirable complications. -/.definefakefonts - { - } - { - (gs_fonts FAKEFONTS) VMDEBUG - Fontmap { - pop dup type /stringtype eq { cvn } if - .FontDirectory 1 index known not { - 2 dict dup /FontName 3 index put - dup /FontType 1 put - .FontDirectory 3 1 roll put - } { - pop - } ifelse - } forall - } -FAKEFONTS { exch } if pop def % don't bind, .current/setglobal get redefined - -% Install initial fonts from Fontmap. -/.loadinitialfonts - { NOFONTMAP not - { /FONTMAP where - { pop [ FONTMAP .pathlist ] - { dup VMDEBUG findlibfile - { exch pop .loadFontmap } - { /undefinedfilename signalerror } - ifelse - } - } - { LIBPATH - { defaultfontmap 2 copy .filenamedirseparator - exch concatstrings concatstrings dup VMDEBUG - (r) { file } .internalstopped - { pop pop } { .loadFontmap } ifelse - } - } - ifelse forall - } - if - .definefakefonts % current VM is global - } def % don't bind, .current/setglobal get redefined - -% ---------------- Synthetic font support ---------------- % - -% Create a new font by modifying an existing one. paramdict contains -% entries with the same keys as the ones found in a Type 1 font; -% it should also contain enough empty entries to allow adding the -% corresponding non-overridden entries from the original font dictionary, -% including FID. If paramdict includes a FontInfo entry, this will -% also override the original font's FontInfo, entry by entry; -% again, it must contain enough empty entries. - -% Note that this procedure does not perform a definefont. - -/.makemodifiedfont % .makemodifiedfont - { exch - { % Stack: destdict key value - 1 index /FID ne - { 2 index 2 index known - { % Skip fontdict entry supplied in paramdict, but - % handle FontInfo specially. - 1 index /FontInfo eq - { 2 index 2 index get % new FontInfo - 1 index % old FontInfo - { % Stack: destdict key value destinfo key value - 2 index 2 index known - { pop pop } - { 2 index 3 1 roll put } - ifelse - } - forall pop - } - if - } - { % No override, copy the fontdict entry. - 2 index 3 1 roll put - dup dup % to match pop pop below - } - ifelse - } - if - pop pop - } forall - } bind def - -% Make a modified font and define it. Note that unlike definefont, -% this does not leave the font on the operand stack. - -/.definemodifiedfont % .definemodifiedfont - - { .makemodifiedfont - dup /FontName get exch definefont pop - } bind def diff --git a/pstoraster/gs_init.ps b/pstoraster/gs_init.ps deleted file mode 100644 index b7470b2ffe..0000000000 --- a/pstoraster/gs_init.ps +++ /dev/null @@ -1,1521 +0,0 @@ -% Copyright 1993-2001 by Easy Software Products. -% Copyright 1989, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_init.ps,v 1.7 2001/03/02 22:34:19 andy Exp $ -% Initialization file for the interpreter. -% When this is run, systemdict is still writable. - -% Comment lines of the form -% %% Replace -% indicate places where the next lines should be replaced by -% the contents of , when creating a single merged init file. - -% The interpreter can call out to PostScript code. All procedures -% called in this way, and no other procedures defined in these -% initialization files, have names that begin with %, e.g., -% (%Type1BuildChar) cvn. - -% Check the interpreter revision. NOTE: the interpreter code requires -% that the first non-comment token in this file be an integer. -550 -dup revision ne - { (pstoraster: Interpreter revision \() print revision 10 string cvs print - (\) does not match gs_init.ps revision \() print 10 string cvs print - (\).\n) print flush null 1 .quit - } -if pop - -% Acquire userdict, and set its length if necessary. -/userdict where - { pop userdict maxlength 0 eq } - { true } -ifelse -systemdict exch - { % userdict wasn't already set up by iinit.c. - dup /userdict - currentdict dup 200 .setmaxlength % userdict - .forceput % userdict is local, systemdict is global - } -if begin - -% Define dummy local/global operators if needed. -systemdict /.setglobal known - { true .setglobal - } - { /.setglobal { pop } .bind def - /.currentglobal { false } .bind def - /.gcheck { pop false } .bind def - } -ifelse - -% Define .languagelevel if needed. -systemdict /.languagelevel known not { /.languagelevel 1 def } if - -% Optionally choose a default paper size other than U.S. letter. -% (a4) /PAPERSIZE where { pop pop } { /PAPERSIZE exch def } ifelse - -% Turn on array packing for the rest of initialization. -true setpacking - -% Define the old MS-DOS EOF character as a no-op. -% This is a hack to get around the absurd habit of MS-DOS editors -% of adding an EOF character at the end of the file. -<1a> cvn { } def - -% Acquire the debugging flags. -/DEBUG true def - /VMDEBUG - DEBUG {{print mark - systemdict /level2dict known - { .currentglobal dup false .setglobal vmstatus - true .setglobal vmstatus 3 -1 roll pop - 6 -2 roll pop .setglobal - } - { vmstatus 3 -1 roll pop - } - ifelse usertime 16#fffff and counttomark - { ( ) print ( ) cvs print } - repeat pop - ( ) print systemdict length ( ) cvs print - ( ) print countdictstack ( ) cvs print - ( <) print count ( ) cvs print (>\n) print flush - }} - {{pop - }} - ifelse - def - -currentdict /BATCH known /BATCH exch def -currentdict /DELAYBIND known /DELAYBIND exch def -currentdict /DISKFONTS known /DISKFONTS exch def -currentdict /ESTACKPRINT known /ESTACKPRINT exch def -currentdict /FAKEFONTS known /FAKEFONTS exch def -currentdict /FIXEDMEDIA known /FIXEDMEDIA exch def -currentdict /FIXEDRESOLUTION known /FIXEDRESOLUTION exch def -currentdict /LOCALFONTS known /LOCALFONTS exch def -currentdict /NOBIND known /NOBIND exch def -/.bind /bind load def -NOBIND { /bind { } def } if -currentdict /NOCACHE known /NOCACHE exch def -currentdict /NOCIE known /NOCIE exch def -currentdict /NODISPLAY known not /DISPLAYING exch def -currentdict /NOFONTMAP known /NOFONTMAP exch def -currentdict /NOFONTPATH known /NOFONTPATH exch def -currentdict /NOGC known /NOGC exch def -currentdict /NOINTERPOLATE known /NOINTERPOLATE exch def -currentdict /NOPAGEPROMPT known /NOPAGEPROMPT exch def -currentdict /NOPAUSE known /NOPAUSE exch def -currentdict /NOPLATFONTS known /NOPLATFONTS exch def -currentdict /NOPROMPT known /NOPROMPT exch def -% The default value of ORIENT1 is true, not false. -currentdict /ORIENT1 known not { /ORIENT1 true def } if -currentdict /OSTACKPRINT known /OSTACKPRINT exch def -currentdict /OUTPUTFILE known % obsolete - { /OutputFile /OUTPUTFILE load def - currentdict /OUTPUTFILE .undef - } if -currentdict /QUIET known /QUIET exch def -currentdict /SAFER known /SAFER exch def -currentdict /SHORTERRORS known /SHORTERRORS exch def -currentdict /STRICT known /STRICT exch def -currentdict /WRITESYSTEMDICT known /WRITESYSTEMDICT exch def - -% Acquire environment variables. -currentdict /DEVICE known not - { (GS_DEVICE) getenv { /DEVICE exch def } if } if - -(START) VMDEBUG - -% Open the standard files, so they will be open at the outermost save level. -(%stdin) (r) file pop -(%stdout) (w) file pop -(%stderr) (w) file pop - -/.currentuserparams where { - pop mark - % The Adobe implementations appear to have very large maximum - % stack sizes. This turns out to actually make a difference, - % since some badly-behaved files include extremely long procedures, - % or construct huge arrays on the operand stack. - % We reset the stack sizes now so that we don't have to worry - % about overflowing the (rather small) built-in stack sizes - % during initialization. - /MaxDictStack 500 - /MaxExecStack 5000 - /MaxOpStack 50000 - .dicttomark .setuserparams -} if - -% Define a procedure for skipping over an unneeded section of code. -% This avoids allocating space for the skipped procedures. -% We can't use readline, because that imposes a line length limit. -/.skipeof % .skipeof - - { currentfile exch 1 exch .subfiledecode flushfile - } .bind def - -% Define procedures to assist users who don't read the documentation. -userdict begin -/help - { (Enter PostScript commands. '(filename) run' runs a file, 'quit' exits.\n) - print flush - } .bind def -/? /help load def -end - -% Define =string, which is used by some PostScript programs even though -% it isn't documented anywhere. -% Put it in userdict so that each context can have its own copy. -userdict /=string 256 string put - -% Print the greeting. - -/printgreeting - { mark - product (Ghostscript) search - { pop pop pop - (This software comes with NO WARRANTY: see the file COPYING for details.\n) - } - { pop - } - ifelse - (\n) copyright - (\)\n) revisiondate 100 mod (-) - revisiondate 100 idiv 100 mod (-) - revisiondate 10000 idiv ( \() - revision 10 mod - revision 100 mod dup 0 ne { 10 idiv } { pop } ifelse (.) - revision 100 idiv ( ) - product - counttomark - { (%stderr) (w) file exch false .writecvp - } repeat pop - } .bind def - -QUIET not { printgreeting flush } if - -% Define a special version of def for making operator procedures. -/obind { % obind - 1 index exch .makeoperator -} .bind def -/odef { % odef - - 1 index exch .makeoperator def -} .bind def - -% Define a special version of def for storing local objects into global -% dictionaries. Like .forceput, this exists only during initialization. -/.forcedef { % .forcedef - - currentdict 3 1 roll .forceput -} .bind odef - -% Define procedures for accessing variables in systemdict and userdict -% regardless of the contents of the dictionary stack. -/.systemvar { % .systemvar - //systemdict exch get -} .bind odef -/.userdict { % - .userdict - /userdict .systemvar -} .bind odef -/.uservar { % .uservar - .userdict exch get -} .bind odef - -% If we're delaying binding, remember everything that needs to be bound later. -DELAYBIND NOBIND not and - { .currentglobal false .setglobal - systemdict /.delaybind 1500 array .forceput - .setglobal - userdict /.delaycount 0 put - % When we've done the delayed bind, we want to stop saving. - % Detect this by the disappearance of .delaybind. - /bind - { /.delaybind .systemvar dup length 0 ne - { .delaycount 2 index put - .userdict /.delaycount .delaycount 1 add put - } - { pop .bind - } - ifelse - } .bind def - } if - -%**************** BACKWARD COMPATIBILITY -/hwsizedict mark /HWSize null .dicttomark readonly def -/copyscanlines { % copyscanlines - 0 3 1 roll 3 index //hwsizedict .getdeviceparams - exch pop exch pop aload pop 3 2 roll - 0 exch null exch .getbitsrect exch pop -} bind odef -currentdict /hwsizedict .undef -/getdeviceprops - { null .getdeviceparams - } bind odef -/.putdeviceprops - { null true counttomark 1 add 3 roll .putdeviceparams - dup type /booleantype ne - { dup mark eq { /unknown /rangecheck } if - counttomark 4 add 1 roll cleartomark pop pop pop - /.putdeviceprops load exch signalerror - } - if - } bind odef -/max { .max } bind def -/min { .min } bind def -/.currentfilladjust { .currentfilladjust2 pop } bind odef -/.setfilladjust { dup .setfilladjust2 } bind odef -/.writecvs { false .writecvp } bind odef - -% Define predefined procedures substituting for operators, -% in alphabetical order. - -userdict /#copies 1 put -% Adobe implementations don't accept /[ or /], so we don't either. -([) cvn - /mark load def -(]) cvn - {counttomark array astore exch pop} odef -/abs {dup 0 lt {neg} if} odef -% .beginpage is redefined if setpagedevice is present. -/.beginpage { } odef -% In LanguageLevel 3, copypage erases the page. -/copypage { - .languagelevel 3 ge - 1 .endpage { - .currentnumcopies 1 index .outputpage - (>>copypage, press to continue<<\n) .confirm - dup { erasepage } if - } if pop .beginpage -} odef -/currentmatrix { - .currentmatrix 6 index astore pop -} odef -% .currentnumcopies is redefined in Level 2. -/.currentnumcopies { #copies } odef -/setcolorscreen where { pop % not in all Level 1 configurations - /currentcolorscreen - { .currenthalftone - { { 60 exch 0 exch 3 copy 6 copy } % halftone - not possible - { 3 copy 6 copy } % screen - { } % colorscreen - } - exch get exec - } odef -} if -/currentscreen - { .currenthalftone - { { 60 exch 0 exch } % halftone - not possible - { } % screen - { 12 3 roll 9 { pop } repeat } % colorscreen - } - exch get exec - } odef -/.echo /echo load def -userdict /.echo.mode true put -/echo {dup /.echo.mode exch store .echo} odef -/eexec - { 55665 //filterdict /eexecDecode get exec - cvx //systemdict begin exec - % Only pop systemdict if it is still the top element, - % because this is apparently what Adobe interpreters do. - currentdict //systemdict eq { end } if - } odef -% .endpage is redefined if setpagedevice is present. -/.endpage { 2 ne } odef -% erasepage mustn't use gsave/grestore, because we call it before -% the graphics state stack has been fully initialized. -/erasepage - { /currentcolor where - { pop currentcolor currentcolorspace { setcolorspace setcolor } } - { /currentcmykcolor where - { pop currentcmykcolor { setcmykcolor } } - { currentrgbcolor { setrgbcolor } } - ifelse - } - ifelse 1 setgray .fillpage exec - } odef -% To satisfy the Genoa FTS, executive must be a procedure, not an operator. -/executive - { { NOPROMPT not { prompt } if - { (%statementedit) (r) file } stopped - { pop pop $error /errorname get /undefinedfilename eq - { .clearerror exit } if % EOF - handleerror null % ioerror?? - } - if - cvx { .runexec } execute - } loop - } bind def -/filter - { //filterdict 1 index .knownget - { exch pop exec } - { /filter load /undefined signalerror } - ifelse - } odef -/handleerror - { /errordict .systemvar /handleerror get exec } bind def -/identmatrix [1.0 0.0 0.0 1.0 0.0 0.0] readonly def -/identmatrix - { dup 0 //identmatrix putinterval } odef -/languagelevel 1 def % gs_lev2.ps may change this -/makeimagedevice { false makewordimagedevice } odef -/matrix { 6 array identmatrix } odef -/pathbbox - { false .pathbbox - } odef -/prompt { flush flushpage - (GS) print - count 0 ne { (<) print count =only } if - (>) print flush - } bind def -/pstack { 0 1 count 3 sub { index == } for } bind def -/putdeviceprops - { .putdeviceprops { erasepage } if } odef -/quit { /quit load 0 .quit } odef -/run { dup type /filetype ne { (r) file } if - % We must close the file when execution terminates, - % regardless of the state of the stack, - % and then propagate an error, if any. - cvx .runexec - } odef -% Execute a file. -% Level 2 uses 2 .stop to clear the e-stack for a successful startjob: -% we detect that here, since we need to handle this even if we start out -% without job control in effect. -% -% What we push on the e-stack is the following to be executed in this order: -% .runexec1 .runexec2 -/.runexec1 { % .runexec1 - - dup type /filetype ne { cvx exec } if - cvx null 2 .stopped - % If we got back here from a startjob, just keep going. - % startjob replaces the null on the o-stack with a procedure - % to be executed when we get back here. - dup null ne { exec true } { pop false } ifelse -} bind def -/.runexec2 { % .runexec2 - - exch { - .runexec - } { - dup type /filetype ne { cvx exec } if - closefile - } ifelse -} bind def -/.runexec { % .runexec - - cvlit /.runexec1 cvx 1 index /.runexec2 cvx 4 .execn -} bind def -% The following is only for compatibility with Adobe interpreters. -/setdash { - 1 index length 11 gt { /setdash load /limitcheck signalerror } if - //setdash -} odef -/setdevice - { .setdevice { erasepage } if } odef -/setlinecap { - dup 2 gt { /setlinecap load /rangecheck signalerror } if - .setlinecap -} odef -/setlinejoin { - dup 2 gt { /setlinejoin load /rangecheck signalerror } if - .setlinejoin -} odef -/setmatrix { - dup aload pop .setmatrix pop -} odef -/showpage { - 0 .endpage .doneshowpage { - .currentnumcopies true .outputpage - (>>showpage, press to continue<<\n) .confirm - erasepage - } if initgraphics .beginpage -} odef -% Code output by Adobe Illustrator relies on the fact that -% `stack' is a procedure, not an operator!!! -/stack { 0 1 count 3 sub { index = } for } bind def -/start { BATCH { null 0 .quit } { executive } ifelse } def -% Internal uses of stopped that aren't going to do a stop if an error occurs -% should use .internalstopped to avoid setting newerror et al. -/.internalstopped { null 1 .stopped null ne } bind def -/store { % Don't alter operands before completing. - 1 index where { 2 index 2 index put pop pop } { def } ifelse -} odef -% NOTE: the name typenames is known to (initialized by) the interpreter. -/type { - //typenames .type -} odef -% When running in Level 1 mode, this interpreter is supposed to be -% compatible with PostScript "version" 54.0 (I think). -/version (54.0) readonly def - -% internaldict is defined in systemdict, but is allocated in local VM. -% We make a procedure for creating it, since we must create a new one -% for each context with private local VM. -/.makeinternaldict { - .currentglobal false .setglobal - [ /dup .systemvar 1183615869 /eq .systemvar - [ /pop .systemvar 10 dict ] cvx - [ /internaldict /cvx .systemvar /invalidaccess /signalerror cvx ] cvx - /ifelse .systemvar - ] cvx executeonly - exch .setglobal -} odef -systemdict /internaldict dup .makeinternaldict .makeoperator -.forceput % proc is local, systemdict is global -% Move superexec to internaldict if superexec is defined. -currentdict /superexec .knownget { - 1183615869 internaldict /superexec 3 -1 roll put - currentdict /superexec .undef -} if - -% Define some additional built-in procedures (beyond the ones defined by -% the PostScript Language Reference Manual). -% Warning: these are not guaranteed to stay the same from one release -% to the next! -/concatstrings - { exch dup length 2 index length add string % str2 str1 new - dup dup 4 2 roll copy % str2 new new new1 - length 4 -1 roll putinterval - } bind def -/copyarray - { dup length array copy } bind def -% Copy a dictionary per the Level 2 spec even in Level 1. -/.copydict % .copydict - { dup 3 -1 roll { put dup } forall pop } bind def -/copystring - { dup length string copy } bind def -/finddevice - { /devicedict .systemvar exch get - dup 1 get null eq - { % This is the first request for this type of device. - % Create a default instance now. - % Stack: [proto null] - .currentglobal true .setglobal exch - dup dup 0 get copydevice 1 exch put - exch .setglobal - } - if 1 get - } bind def -/.growdictlength % get size for growing a dictionary - { length 3 mul 2 idiv 1 add - } bind def -/.growdict % grow a dictionary - { dup .growdictlength .setmaxlength - } bind def -/.growput % put, grow the dictionary if needed - { 2 index length 3 index maxlength eq - { 3 copy pop known not { 2 index .growdict } if - } if - put - } bind def -/.packtomark - { counttomark packedarray exch pop } bind def -/ppstack - { 0 1 count 3 sub { index === } for } bind def -/runlibfile - { % We don't want to bind 'run' into this procedure, - % since run may get redefined. - findlibfile - { exch pop /run .systemvar exec } - { /undefinedfilename signalerror } - ifelse - } bind def -/selectdevice - { finddevice setdevice .setdefaultscreen } bind def -/signalerror % signalerror - - { /errordict .systemvar exch get exec } bind def - -% Define the =[only] procedures. Also define =print, -% which is used by some PostScript programs even though -% it isn't documented anywhere. -/write=only { - .writecvs -} bind def -/write= { - 1 index exch write=only (\n) writestring -} bind def -%%%% MRS - Send = output to stderr, since stdout is for output. -/=only { (%stderr) (w) file exch write=only } bind def -/= { =only (\n) print } bind def -/=print /=only load def -% Temporarily define == as = for the sake of runlibfile0. -/== /= load def - -% Define procedures for getting and setting the current device resolution. - -/gsgetdeviceprop % gsgetdeviceprop - { 2 copy mark exch null .dicttomark .getdeviceparams - dup mark eq % if true, not found - { pop dup /undefined signalerror } - { 5 1 roll pop pop pop pop } - ifelse - } bind def -/gscurrentresolution % - gscurrentresolution <[xres yres]> - { currentdevice /HWResolution gsgetdeviceprop - } bind def -/gssetresolution % <[xres yres]> gssetresolution - - { 2 array astore mark exch /HWResolution exch - currentdevice copydevice putdeviceprops setdevice - } bind def - -% Define auxiliary procedures needed for the above. -/shellarguments % -> shell_arguments true (or) false - { /ARGUMENTS where - { /ARGUMENTS get dup type /arraytype eq - { aload pop /ARGUMENTS null store true } - { pop false } - ifelse } - { false } ifelse - } bind def -/.confirm - { DISPLAYING NOPAUSE not and - { % Print a message (unless NOPAGEPROMPT or NOPROMPT is true) - % and wait for the user to type something. - % If the user just types a newline, flush it. - NOPAGEPROMPT NOPROMPT or { pop } { print flush } ifelse - .echo.mode false echo - (%stdin) (r) file dup read - { dup (\n) 0 get eq { pop pop } { unread } ifelse } - { pop } - ifelse echo - } - { pop - } - ifelse - } bind def - -% Define the procedure used by .runfile, .runstdin and .runstring -% for executing user input. -% This is called with a procedure or executable file on the operand stack. -/.execute { % .execute - stopped $error /newerror get and - { handleerror flush true } { false } ifelse -} bind def -/execute { % execute - - .execute pop -} odef -% Define an execute analogue of runlibfile0. -/execute0 { % execute0 - - .execute { /execute0 cvx 1 .quit } if -} bind def -% Define the procedure that the C code uses for running files -% named on the command line. -/.runfile { - { runlibfile } execute -} def -% Define the procedure that the C code uses for running piped input. -% We don't use the obvious { (%stdin) run }, because we want the file to be -% reopened if a startjob does a restore. -/.runstdin { - { { (%stdin) (r) file cvx } .runexec } execute0 -} bind def -% Define the procedure that the C code uses for running commands -% given on the command line with -c. We turn the string into a file so that -% .runexec can do the right thing with a startjob. -/.runstring { - .currentglobal exch true .setglobal - 0 () .subfiledecode - exch .setglobal cvx { .runexec } execute -} bind def -% Define the procedure that the C code uses to set up for executing -% a string that may be received in pieces. -/.runstringbegin { - .currentglobal true .setglobal - { .needinput } bind 0 () .subfiledecode - exch .setglobal cvx .runexec -} bind def - -% Define a special version of runlibfile that aborts on errors. -/runlibfile0 - { cvlit dup /.currentfilename exch def - { findlibfile not { stop } if } - stopped - { (Can't find \(or open\) initialization file ) print - .currentfilename == flush /runlibfile0 cvx 1 .quit - } if - exch pop cvx stopped - { (While reading ) print .currentfilename print (:\n) print flush - handleerror /runlibfile0 1 .quit - } if - } bind def -% Temporarily substitute it for the real runlibfile. -/.runlibfile /runlibfile load def -/runlibfile /runlibfile0 load def - -% Create the error handling machinery. -% Define the standard error handlers. -% The interpreter has created the ErrorNames array. -/.unstoppederrorhandler % .unstoppederrorhandler - - { % This is the handler that gets used for recursive errors, - % or errors outside the scope of a 'stopped'. - 2 copy SHORTERRORS - { (%%[ Error: ) print =only flush - (; OffendingCommand: ) print =only ( ]%%\n) print - } - { (Unrecoverable error: ) print =only flush - ( in ) print = flush - count 2 gt - { (Operand stack:\n ) print - 2 1 count 3 sub { ( ) print index =only flush } for - (\n) print flush - } if - } - ifelse - -1 0 1 //ErrorNames length 1 sub - { dup //ErrorNames exch get 3 index eq - { not exch pop exit } { pop } ifelse - } - for exch pop .quit - } bind def -/.errorhandler % .errorhandler - - { % Detect an internal 'stopped'. - 1 .instopped { null eq { pop pop stop } if } if - $error /.inerror get 1 .instopped { pop } { pop true } ifelse - { .unstoppederrorhandler - } if % detect error recursion - $error /globalmode .currentglobal false .setglobal put - $error /.inerror true put - $error /newerror true put - $error exch /errorname exch put - $error exch /command exch put - $error /recordstacks get $error /errorname get /VMerror ne and - { % Attempt to store the stack contents atomically. - count array astore dup $error /ostack 4 -1 roll - countexecstack array execstack $error /estack 3 -1 roll - countdictstack array dictstack $error /dstack 3 -1 roll - put put put aload pop - } - { $error /dstack .undef - $error /estack .undef - $error /ostack .undef - } - ifelse - $error /position currentfile status - { currentfile { fileposition } .internalstopped { pop null } if - } - { % If this was a scanner error, the file is no longer current, - % but the command holds the file, which may still be open. - $error /command get dup type /filetype eq - { { fileposition } .internalstopped { pop null } if } - { pop null } - ifelse - } - ifelse put - % During initialization, we don't reset the allocation - % mode on errors. - $error /globalmode get $error /.nosetlocal get and .setglobal - $error /.inerror false put - stop - } bind def -% Define the standard handleerror. We break out the printing procedure -% (.printerror) so that it can be extended for binary output -% if the Level 2 facilities are present. - /.printerror - { $error begin - /command load errorname SHORTERRORS - { (%%[ Error: ) print =only flush - (; OffendingCommand: ) print =only - currentdict /errorinfo .knownget - { (;\nErrorInfo:) print - dup type /arraytype eq - { { ( ) print =only } forall } - { ( ) print =only } - ifelse - } if - ( ]%%\n) print flush - } - { (Error: ) print ==only flush - ( in ) print ==only flush - currentdict /errorinfo .knownget - { (\nAdditional information: ) print ==only flush - } if - .printerror_long - } - ifelse - .clearerror - end - flush - } bind def - /.printerror_long % long error printout, - % $error is on the dict stack - { % Push the (anonymous) stack printing procedure. - % <==flag> proc - { - currentdict exch .knownget % stackname defined in $error? - { - 4 1 roll % stack: <==flag> - errordict exch .knownget % overridename defined? - { - exch pop exch pop exec % call override with - } - { - exch print exch % print heading. stack <==flag> - 1 index not { (\n) print } if - { 1 index { (\n ) } { ( ) } ifelse print - dup type /dicttype eq - { - (--dict:) print - dup rcheck { - dup length =only (/) print dup maxlength =only - } if - /gcheck where { - pop gcheck { ((G)) } { ((L)) } ifelse print - } { - pop - } ifelse (--) print - } - { - dup type /stringtype eq 2 index or - { ==only } { =only } ifelse - } ifelse - } forall - pop - } - ifelse % overridden - } - { pop pop pop - } - ifelse % stack known - } - - (\nOperand stack:) OSTACKPRINT /.printostack /ostack 4 index exec - (\nExecution stack:) ESTACKPRINT /.printestack /estack 4 index exec - (\nBacktrace:) true /.printbacktrace /backtrace 4 index exec - (\nDictionary stack:) false /.printdstack /dstack 4 index exec - (\n) print - pop % printing procedure - - errorname /VMerror eq - { (VM status:) print mark vmstatus - counttomark { ( ) print counttomark -1 roll dup =only } repeat - cleartomark (\n) print - } if - - .languagelevel 2 ge - { (Current allocation mode is ) print - globalmode { (global\n) } { (local\n) } ifelse print - } if - - .oserrno dup 0 ne - { (Last OS error: ) print - errorname /VMerror ne - { dup .oserrorstring { = pop } { = } ifelse } - { = } - ifelse - } - { pop - } - ifelse - - position null ne - { (Current file position is ) print position = } - if - - } bind def -% Define a procedure for clearing the error indication. -/.clearerror - { $error /newerror false put - $error /errorname null put - $error /errorinfo .undef - 0 .setoserrno - } bind def - -% Define $error. This must be in local VM. -.currentglobal false .setglobal -/$error 40 dict .forcedef % $error is local, systemdict is global - % newerror, errorname, command, errorinfo, - % ostack, estack, dstack, recordstacks, - % binary, globalmode, - % .inerror, .nosetlocal, position, - % plus extra space for badly designed error handers. -$error begin - /newerror false def - /recordstacks true def - /binary false def - /globalmode .currentglobal def - /.inerror false def - /.nosetlocal true def - /position null def -end -% Define errordict similarly. It has one entry per error name, -% plus handleerror. -/errordict ErrorNames length 1 add dict -.forcedef % errordict is local, systemdict is global -.setglobal % contents of errordict are global -errordict begin - ErrorNames - { mark 1 index systemdict /.errorhandler get /exec load .packtomark cvx def - } forall -% The handlers for interrupt and timeout are special; there is no -% 'current object', so they push their own name. - { /interrupt /timeout } - { mark 1 index dup systemdict /.errorhandler get /exec load .packtomark cvx def - } forall -/handleerror - { /.printerror .systemvar exec - } bind def -end - -% Define the [write]==[only] procedures. -/.dict 26 dict dup -begin def - /.cvp {1 index exch .writecvs} bind def - /.nop {exch pop .p} bind def - /.p {1 index exch writestring} bind def - /.p1 {2 index exch writestring} bind def - /.p2 {3 index exch writestring} bind def - /.print - { dup type .dict exch .knownget - { dup type /stringtype eq { .nop } { exec } ifelse } - { (-) .p1 type .cvp (-) .p } - ifelse - } bind def - /.pstring - { { dup dup 32 lt exch 127 ge or - { (\\) .p1 2 copy -6 bitshift 48 add write - 2 copy -3 bitshift 7 and 48 add write - 7 and 48 add - } - { dup dup -2 and 40 eq exch 92 eq or {(\\) .p1} if - } - ifelse 1 index exch write - } - forall - } bind def - /booleantype /.cvp load def - /conditiontype (-condition-) def - /devicetype (-device-) def - /dicttype (-dict-) def - /filetype (-file-) def - /fonttype (-fontID-) def - /gstatetype (-gstate-) def - /integertype /.cvp load def - /locktype (-lock-) def - /marktype (-mark-) def - /nulltype (null) def - /realtype {1 index exch true .writecvp} bind def - /savetype (-save-) def - /nametype - {dup xcheck not {(/) .p1} if - 1 index exch .writecvs} bind def - /arraytype - {dup rcheck - {() exch dup xcheck - {({) .p2 - {exch .p1 - 1 index exch .print pop ( )} forall - (})} - {([) .p2 - {exch .p1 - 1 index exch .print pop ( )} forall - (])} - ifelse exch pop .p} - {(-array-) .nop} - ifelse} bind def - /operatortype - {(--) .p1 .cvp (--) .p} bind def - /packedarraytype - { dup rcheck - { arraytype } - { (-packedarray-) .nop } - ifelse - } bind def - /stringtype - { dup rcheck - { (\() .p1 dup length 200 le - { .pstring } - { 0 200 getinterval .pstring (...) .p } - ifelse (\)) .p - } - { (-string-) .nop - } - ifelse - } bind def -{//.dict begin .print pop end} - bind -end - -/write==only exch def -/write== {1 index exch write==only (\n) writestring} bind def -/==only { (%stderr) (w) file exch write==only } bind def -/== {==only (\n) print} bind def - -% Define [write]===[only], an extension that prints dictionaries -% in readable form and doesn't truncate strings. -/.dict /write==only load 0 get dup length dict .copydict dup -begin def - /dicttype - { dup rcheck - { (<< ) .p1 - { 2 index 3 -1 roll .print pop ( ) .p1 - 1 index exch .print pop ( ) .p - } - forall (>>) .p - } - { (-dict-) .nop - } - ifelse - } bind def - /stringtype - { dup rcheck - { (\() .p1 .pstring (\)) .p } - { (-string-) .nop } - ifelse - } bind def - -{//.dict begin .print pop end} - bind -end - -/write===only exch def -/write=== {1 index exch write===only (\n) writestring} bind def -/===only { (%stderr) (w) file exch write===only } bind def -/=== { ===only (\n) print } bind def - -(END PROCS) VMDEBUG - -% Define the font directory. -/FontDirectory false .setglobal 100 dict true .setglobal -.forcedef % FontDirectory is local, systemdict is global - -% Define the encoding dictionary. -/EncodingDirectory 10 dict def % enough for Level 2 + PDF standard encodings - -% Define .findencoding. (This is redefined in Level 2.) -/.findencoding - { //EncodingDirectory exch get exec - } bind def -/.defineencoding - { //EncodingDirectory 3 1 roll put - } bind def -% If we've got the composite font extensions, define findencoding. -% To satisfy the Genoa FTS, findencoding must be a procedure, not an operator. -/rootfont where { pop /findencoding { .findencoding } def } if - -% Define .registerencoding. -% NOTE: the name registeredencodings is known to (initialized by and shared -% with) the interpreter. -/.registerencoding { % .registerencoding - - % Check that the array is indexable. - % (It might still be a string, but then the .namestring will fail.) - dup 0 0 getinterval pop - % Check that all the elements of the array are names. - dup { .namestring pop } forall - % Do the store. - //registeredencodings 2 index 2 index readonly put pop pop -} bind odef -systemdict /registeredencodings .undef - -% Load StandardEncoding. -%% Replace 1 (gs_std_e.ps) -(gs_std_e.ps) dup runlibfile VMDEBUG - -% Load ISOLatin1Encoding. -%% Replace 1 (gs_iso_e.ps) -(gs_iso_e.ps) dup runlibfile VMDEBUG - -% Define stubs for the Symbol and Dingbats encodings. -% Note that the first element of the procedure must be the file name, -% since gs_lev2.ps extracts it to set up the Encoding resource category. - - /SymbolEncoding { /SymbolEncoding .findencoding } bind def -%% Replace 3 (gs_sym_e.ps) - EncodingDirectory /SymbolEncoding - { (gs_sym_e.ps) //systemdict begin runlibfile SymbolEncoding end } - bind put - - /DingbatsEncoding { /DingbatsEncoding .findencoding } bind def -%% Replace 3 (gs_dbt_e.ps) - EncodingDirectory /DingbatsEncoding - { (gs_dbt_e.ps) //systemdict begin runlibfile DingbatsEncoding end } - bind put - -(END FONTDIR/ENCS) VMDEBUG - -% Construct a dictionary of all available devices. -% These are (read-only) device prototypes that can't be -% installed or have their parameters changed. For this reason, -% the value in the dictionary is actually a 2-element writable array, -% to allow us to create a default instance of the prototype on demand. - - % Loop until the .getdevice gets a rangecheck. -errordict /rangecheck 2 copy get -errordict /rangecheck { pop stop } put % pop the command - 0 { {dup .getdevice exch 1 add} loop} .internalstopped pop - 1 add dict /devicedict 1 index def - begin % 2nd copy of count is on stack - { dup .devicename exch - dup wcheck { dup } { null } ifelse 2 array astore def - } repeat - end -put % errordict /rangecheck -.clearerror -/devicenames devicedict { pop } forall devicedict length packedarray def - -% Determine the default device. -/defaultdevice DISPLAYING - { systemdict /DEVICE .knownget - { devicedict 1 index known not - { (Unknown device: ) print = - flush /defaultdevice cvx 1 .quit - } - if - } - { 0 .getdevice .devicename - } - ifelse - } - { /nullpage - } -ifelse -/.defaultdevicename 1 index def -finddevice % make a copy -def -devicedict /Default devicedict .defaultdevicename get put - -(END DEVS) VMDEBUG - -% Define statusdict, for the benefit of programs -% that think they are running on a LaserWriter or similar printer. -%% Replace 1 (gs_statd.ps) -(gs_statd.ps) runlibfile - -(END STATD) VMDEBUG - -% Load the standard font environment. -%% Replace 1 (gs_fonts.ps) -(gs_fonts.ps) runlibfile - -(END GS_FONTS) VMDEBUG - -% Load the initialization files for optional features. -%% Replace 4 INITFILES -systemdict /INITFILES known - { INITFILES { dup runlibfile VMDEBUG } forall - } -if - -% If Level 2 (or higher) functionality is implemented, enable it now. -/.setlanguagelevel where { - pop 2 .setlanguagelevel - % If the resource machinery is loaded, fix up some things now. - /.fixresources where { pop .fixresources } if -} if -/ll3dict where { - pop 3 .setlanguagelevel -} if - -(END INITFILES) VMDEBUG - -% Create a null font. This is the initial font. -8 dict dup begin - /FontMatrix [ 1 0 0 1 0 0 ] readonly def - /FontType 3 def - /FontName () def - /Encoding StandardEncoding def - /FontBBox { 0 0 0 0 } readonly def % executable is bogus, but customary ... - /BuildChar { pop pop 0 0 setcharwidth } bind def - /PaintType 0 def % shouldn't be needed! -end -/NullFont exch definefont setfont - -% Define NullFont as the font. -/NullFont currentfont def - -% Load initial fonts from FONTPATH directories, Fontmap file, -% and/or .getccfont as appropriate. -.loadinitialfonts - -% Remove NullFont from FontDirectory, so it can't be accessed by mistake. -/undefinefont where { - pop /NullFont undefinefont -} { - FontDirectory /NullFont .undef -} ifelse - -(END FONTS) VMDEBUG - -% Restore the real definition of runlibfile. -/runlibfile /.runlibfile load def -currentdict /.runlibfile .undef - -% Bind all the operators defined as procedures. -/.bindoperators % binds operators in currentdict - { % Temporarily disable the typecheck error. - errordict /typecheck 2 copy get - errordict /typecheck { pop } put % pop the command - currentdict - { dup type /operatortype eq - { % This might be a real operator, so bind might cause a typecheck, - % but we've made the error a no-op temporarily. - .bind % do a real bind even if NOBIND is set - } - if pop pop - } forall - put - } def -NOBIND DELAYBIND or not { .bindoperators } if - -% Establish a default environment. - -defaultdevice -% The following line used to skip setting of page size and resolution if -% NODISPLAY was selected. We think this was only to save time and memory, -% and it is a bad idea because it prevents setting the resolution in this -% situation, which pstoedit (among other programs) relies on. -%DISPLAYING not { setdevice (%END DISPLAYING) .skipeof } if -systemdict /DEVICEWIDTH known -systemdict /DEVICEHEIGHT known or -systemdict /DEVICEWIDTHPOINTS known or -systemdict /DEVICEHEIGHTPOINTS known or -systemdict /DEVICEXRESOLUTION known or -systemdict /DEVICEYRESOLUTION known or -systemdict /PAPERSIZE known or -not { (%END DEVICE) .skipeof } if -% Let DEVICE{WIDTH,HEIGHT}[POINTS] override PAPERSIZE. -systemdict /PAPERSIZE known -systemdict /DEVICEWIDTH known not and -systemdict /DEVICEHEIGHT known not and -systemdict /DEVICEWIDTHPOINTS known not and -systemdict /DEVICEHEIGHTPOINTS known not and - { % Convert the paper size to device dimensions. - true statusdict /.pagetypenames get - { PAPERSIZE eq - { PAPERSIZE load - dup 0 get /DEVICEWIDTHPOINTS exch def - 1 get /DEVICEHEIGHTPOINTS exch def - pop false exit - } - if - } - forall - { (Unknown paper size: ) print PAPERSIZE ==only (.\n) print - } - if - } -if -% Adjust the device parameters per the command line. -% It is possible to specify resolution, pixel size, and page size; -% since any two of these determine the third, conflicts are possible. -% We simply pass them to .setdeviceparams and let it sort things out. - mark /HWResolution null /HWSize null /PageSize null .dicttomark - .getdeviceparams .dicttomark begin - mark - % Check for resolution. - /DEVICEXRESOLUTION where dup - { exch pop HWResolution 0 DEVICEXRESOLUTION put } - if - /DEVICEYRESOLUTION where dup - { exch pop HWResolution 1 DEVICEYRESOLUTION put } - if - or { /HWResolution HWResolution } if - % Check for device sizes specified in pixels. - /DEVICEWIDTH where dup - { exch pop HWSize 0 DEVICEWIDTH put } - if - /DEVICEHEIGHT where dup - { exch pop HWSize 1 DEVICEHEIGHT put } - if - or { /HWSize HWSize } if - % Check for device sizes specified in points. - /DEVICEWIDTHPOINTS where dup - { exch pop PageSize 0 DEVICEWIDTHPOINTS put } - if - /DEVICEHEIGHTPOINTS where dup - { exch pop PageSize 1 DEVICEHEIGHTPOINTS put } - if - or { /PageSize PageSize } if - % Check whether any parameters were set. - dup mark eq { pop } { defaultdevice putdeviceprops } ifelse - end -%END DEVICE -% Set any device properties defined on the command line. -% If BufferSpace is defined but not MaxBitmap, set MaxBitmap to BufferSpace. -systemdict /BufferSpace known -systemdict /MaxBitmap known not and - { systemdict /MaxBitmap BufferSpace put - } if -dup getdeviceprops -counttomark 2 idiv - { systemdict 2 index known - { pop dup load counttomark 2 roll } - { pop pop } - ifelse - } repeat -counttomark dup 0 ne - { 2 add -1 roll putdeviceprops } - { pop pop } -ifelse -setdevice % does an erasepage -% If the media size is fixed, update the current page device dictionary. -FIXEDMEDIA -dup { pop systemdict /.currentpagedevice known } if -dup { pop .currentpagedevice exch pop } if -not { (%END MEDIA) .skipeof } if -currentpagedevice dup length dict .copydict -dup /Policies - % Stack: /Policies -1 index /InputAttributes -2 copy get dup length dict .copydict - % Stack: /Policies - % /InputAttributes -dup 0 2 copy get dup length dict .copydict - % Stack: /Policies - % /InputAttributes 0 -dup /PageSize 7 index /PageSize get -put % PageSize in 0 -put % 0 in InputAttributes -put % InputAttributes in pagedevice -% Also change the page size policy so we don't get an error. - % Stack: /Policies -2 copy get dup length dict .copydict - % Stack: /Policies -dup /PageSize 7 put % PageSize in Policies -put % Policies in pagedevice -.setpagedevice -%END MEDIA -%END DISPLAYING - -(END DEVICE) VMDEBUG - -% Establish a default upper limit in the character cache, -% namely, enough room for a 18-point character at the resolution -% of the default device, or for a character consuming 1% of the -% maximum cache size, whichever is larger. -mark - % Compute limit based on character size. - 18 dup dtransform - exch abs cvi 31 add 32 idiv 4 mul % X raster - exch abs cvi mul % Y - % Compute limit based on allocated space. - cachestatus pop pop pop pop pop exch pop 0.01 mul cvi - .max dup 10 idiv exch -setcacheparams -% Conditionally disable the character cache. -NOCACHE { 0 setcachelimit } if - -(END CONFIG) VMDEBUG - -% Establish an appropriate halftone screen and BG/UCR functions. -% We make this a procedure so we can call it again when switching devices. - -%%%% MRS - Changed default to 16x16 Floyd dither, matching the CUPS -%%%% image RIP. Also, added missing standard transfer function, -%%%% which is needed by output from many apps... - -% Set the default screen and BG/UCR based on the device resolution and -% process color capability. -/.setdefaultbgucr systemdict /setblackgeneration known { { - processcolors 1 eq { { } } { { pop 0.0 } } ifelse - dup setblackgeneration setundercolorremoval -} } { { -} } ifelse bind def -% Set the default screen based on the device resolution. -/.setdefaultscreen -{ - << - /HalftoneType 3 - /Width 16 - /Height 16 - /Thresholds - < 00 80 20 A0 08 88 28 A8 02 82 22 A2 0A 8A 2A AA - C0 40 E0 60 C8 48 E8 68 C2 42 E2 62 CA 4A EA 6A - 30 B0 10 90 38 B8 18 98 32 B2 12 92 3A BA 1A 9A - F0 70 D0 50 F8 78 D8 58 F2 72 D2 52 FA 7A DA 5A - 0C 8C 2C AC 04 84 24 A4 0E 8E 2E AE 06 86 26 A6 - CC 4C EC 6C C4 44 E4 64 CE 4E EE 6E C6 46 E6 66 - 3C BC 1C 9C 34 B4 14 94 3E BE 1E 9E 36 B6 16 96 - FC 7C DC 5C F4 74 D4 54 FE 7E DE 5E F6 76 D6 56 - 03 83 23 A3 0B 8B 2B AB 01 81 21 A1 09 89 29 A9 - C3 43 E3 63 CB 4B EB 6B C1 41 E1 61 C9 49 E9 69 - 33 B3 13 93 3B BB 1B 9B 31 B1 11 91 39 B9 19 99 - F3 73 D3 53 FB 7B DB 5B F1 71 D1 51 F9 79 D9 59 - 0F 8F 2F AF 07 87 27 A7 0D 8D 2D AD 05 85 25 A5 - CF 4F EF 6F C7 47 E7 67 CD 4D ED 6D C5 45 E5 65 - 3F BF 1F 9F 37 B7 17 97 3D BD 1D 9D 35 B5 15 95 - FF 7F DF 5F F7 77 D7 57 FD 7D DD 5D F5 75 D5 55 > - >> sethalftone -} bind def -.setdefaultscreen -% Set a null transfer function... -{} bind settransfer -initgraphics - -% The interpreter relies on there being at least 2 entries -% on the graphics stack. Establish the second one now. -gsave - -% Define some control sequences as no-ops. -% This is a hack to get around problems -% in some common PostScript-generating applications. -<04> cvn { } def % Apple job separator -<0404> cvn { } def % two of the same -<1b> cvn { } def % MS Windows LaserJet 4 prologue - % (UEL = ESC %-12345X) -<1b45> cvn { } def % PJL reset prologue (ESC E) -<1b451b> cvn { } def % PJL reset epilogue (ESC E + UEL) -<041b> cvn { } def % MS Windows LaserJet 4 epilogue (^D + UEL) -(\001M) cvn % TBCP initiator - { currentfile /TBCPDecode filter cvx exec - } bind def -/@PJL % H-P job control - { currentfile //=string readline { pop } if - } bind def - -% If we want a "safer" system, disable some obvious ways to cause havoc. -SAFER not { (%END SAFER) .skipeof } if -/file - { dup (r) eq 2 index (%pipe*) .stringmatch not and - 2 index (%std*) .stringmatch or - { file } - { /invalidfileaccess signalerror } - ifelse - } .bind odef -/renamefile { /invalidfileaccess signalerror } odef -/deletefile { /invalidfileaccess signalerror } odef -/putdeviceprops - { counttomark - dup 2 mod 0 eq { pop /rangecheck signalerror } if - 3 2 3 2 roll - { dup index /OutputFile eq - { -2 roll - dup () ne { /putdeviceprops load /invalidfileaccess signalerror } if - 3 -1 roll - } - { pop - } - ifelse - } for - putdeviceprops - } .bind odef - -%END SAFER - -% If we delayed binding, make it possible to do it later. -/.bindnow { - //systemdict begin .bindoperators end - % Temporarily disable the typecheck error. - errordict /typecheck 2 copy get - errordict /typecheck { pop } put % pop the command - 0 1 .delaycount 1 sub { .delaybind exch get .bind pop } for - //systemdict /.delaybind {} .forceput % reclaim the space - //systemdict /.bindnow .forceundef % ditto - put - //systemdict /.forcedef .forceundef % remove temptation - //systemdict /.forceput .forceundef % ditto - //systemdict /.forceundef .forceundef % ditto -} .bind odef - -% Turn off array packing, since some PostScript code assumes that -% procedures are writable. -false setpacking - -(END INIT) VMDEBUG - -/.currentuserparams where { - pop - % Remove real user params from psuserparams. - mark .currentuserparams counttomark 2 idiv { - pop psuserparams exch undef - } repeat pop - % Update the copy of the user parameters. - mark .currentuserparams counttomark 2 idiv { - userparams 3 1 roll .forceput % userparams is read-only - } repeat pop - % Turn on idiom recognition, if available. - currentuserparams /IdiomRecognition known { - /IdiomRecognition true .definepsuserparam - } if - psuserparams readonly pop - systemdict /.definepsuserparam undef - % Save a copy of userparams for use with save/restore - % (and, if implemented, context switching). - .currentglobal false .setglobal - mark .currentuserparams psuserparams { } forall .dicttomark readonly - /userparams exch .forcedef % systemdict is read-only - .setglobal -} if -/.currentsystemparams where { - pop - % Remove real system params from pssystemparams. - mark .currentsystemparams counttomark 2 idiv { - pop pssystemparams exch .forceundef - } repeat pop -} if - -% Conditionally turn off image interpolation. -NOINTERPOLATE not { (%END NOINTERPOLATE) .skipeof } if -/.nointerpolate { - dup type /dicttype eq { - dup /Interpolate .knownget not { false } if { - dup gcheck .currentglobal exch .setglobal - exch dup length dict copy - dup /Interpolate .undef - exch .setglobal - } if - } if -} bind odef -/image { .nointerpolate image } bind odef -/imagemask { .nointerpolate imagemask } bind odef -%END NOINTERPOLATE - -% Establish local VM as the default. -false /setglobal where { pop setglobal } { .setglobal } ifelse -$error /.nosetlocal false put - -(END GLOBAL) VMDEBUG - -/.savelocalstate where { - % If we might create new contexts, save away copies of all dictionaries - % referenced from systemdict that are stored in local VM, - % and also save a copy of the initial gstate. - pop .savelocalstate -} { - % If we're *not* running in a multi-context system and FAKEFONTS is - % defined, add the fake fonts to LocalFontDirectory. - .definefakefonts % current VM is local -} ifelse - -% Close up systemdict. -currentdict /filterdict .undef % bound in where needed -currentdict /.cidfonttypes .undef % ditto -currentdict /.colorrenderingtypes .undef % ditto -currentdict /.formtypes .undef % ditto -currentdict /.imagetypes .undef % ditto -currentdict /.imagemasktypes .undef % ditto -currentdict /.patterntypes .undef % ditto -currentdict /.shadingtypes .undef % ditto -end - -% Clean up VM, and enable GC. -/vmreclaim where - { pop NOGC not { 2 vmreclaim 0 vmreclaim } if - } if -DELAYBIND not { - systemdict /.forcedef .undef % remove temptation - systemdict /.forceput .undef % ditto - systemdict /.forceundef .undef % ditto -} if -WRITESYSTEMDICT not { systemdict readonly pop } if - -(END GC) VMDEBUG - -% The interpreter will run the initial procedure (start). diff --git a/pstoraster/gs_iso_e.ps b/pstoraster/gs_iso_e.ps deleted file mode 100644 index ab85d293a5..0000000000 --- a/pstoraster/gs_iso_e.ps +++ /dev/null @@ -1,74 +0,0 @@ -% Copyright (C) 1993, 1994 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_iso_e.ps,v 1.2 2000/03/08 23:14:29 mike Exp $ -% Define the ISO Latin-1 encoding vector. -% The first half is the same as the standard encoding, -% except for minus instead of hyphen at code 055. -/ISOLatin1Encoding -StandardEncoding 0 45 getinterval aload pop - /minus -StandardEncoding 46 82 getinterval aload pop -% NOTE: the following are missing in the Adobe documentation, -% but appear in the displayed table: -% macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240. -% This is an error in the Red Book, corrected in Adobe TN 5085. -% \20x - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent - /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron -% \24x - /space /exclamdown /cent /sterling - /currency /yen /brokenbar /section - /dieresis /copyright /ordfeminine /guillemotleft - /logicalnot /minus /registered /macron - /degree /plusminus /twosuperior /threesuperior - /acute /mu /paragraph /periodcentered - /cedilla /onesuperior /ordmasculine /guillemotright - /onequarter /onehalf /threequarters /questiondown -% \30x - /Agrave /Aacute /Acircumflex /Atilde - /Adieresis /Aring /AE /Ccedilla - /Egrave /Eacute /Ecircumflex /Edieresis - /Igrave /Iacute /Icircumflex /Idieresis - /Eth /Ntilde /Ograve /Oacute - /Ocircumflex /Otilde /Odieresis /multiply - /Oslash /Ugrave /Uacute /Ucircumflex - /Udieresis /Yacute /Thorn /germandbls -% \34x - /agrave /aacute /acircumflex /atilde - /adieresis /aring /ae /ccedilla - /egrave /eacute /ecircumflex /edieresis - /igrave /iacute /icircumflex /idieresis - /eth /ntilde /ograve /oacute - /ocircumflex /otilde /odieresis /divide - /oslash /ugrave /uacute /ucircumflex - /udieresis /yacute /thorn /ydieresis -% Make an array on large systems, a packed array on small ones. -256 -vmstatus exch pop exch pop -100000 ge { array astore readonly } { packedarray } ifelse -def -1 ISOLatin1Encoding .registerencoding -/ISOLatin1Encoding ISOLatin1Encoding .defineencoding diff --git a/pstoraster/gs_kanji.ps b/pstoraster/gs_kanji.ps deleted file mode 100644 index 2091f61705..0000000000 --- a/pstoraster/gs_kanji.ps +++ /dev/null @@ -1,166 +0,0 @@ -% Copyright (C) 1994, 1995, 1996 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_kanji.ps,v 1.2 2000/03/08 23:14:30 mike Exp $ -% Scaffolding for Kanji fonts. This is based on the Wadalab free font -% from the University of Tokyo; it may not be appropriate for other -% Kanji fonts. - -/currentglobal where - { pop currentglobal { setglobal } true setglobal } - { { } } -ifelse - -% Define the encoding for the root font. - -/KanjiEncoding -% \x00 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 -% \x20 - 0 1 2 3 4 5 6 7 - 8 0 0 0 0 0 0 0 - 9 10 11 12 13 14 15 16 - 17 18 19 20 21 22 23 24 -% \x40 - 25 26 27 28 29 30 31 32 - 33 34 35 36 37 38 39 40 - 41 42 43 44 45 46 47 48 - 49 50 51 52 53 54 55 56 -% \x60 - 57 58 59 60 61 62 63 64 - 65 66 67 68 69 70 71 72 - 73 74 75 76 77 0 0 0 - 0 0 0 0 0 0 0 0 -% \x80 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 -% \xA0 - 0 1 2 3 4 5 6 7 - 8 0 0 0 0 0 0 0 - 9 10 11 12 13 14 15 16 - 17 18 19 20 21 22 23 24 -% \xC0 - 25 26 27 28 29 30 31 32 - 33 34 35 36 37 38 39 40 - 41 42 43 44 45 46 47 48 - 49 50 51 52 53 54 55 56 -% \xE0 - 57 58 59 60 61 62 63 64 - 65 66 67 68 69 70 71 72 - 73 74 75 76 77 0 0 0 - 0 0 0 0 0 0 0 0 -256 packedarray def - -% Define a stub for the base font encoding. - - /KanjiSubEncoding { /KanjiSubEncoding .findencoding } bind def -%% Replace 3 (gs_ksb_e.ps) - EncodingDirectory /KanjiSubEncoding - { (gs_ksb_e.ps) //systemdict begin runlibfile KanjiSubEncoding end } - bind put - -% Support procedures and data. - -/T1FontInfo 8 dict begin - /version (001.001) readonly def - /FullName (KanjiBase) readonly def - /FamilyName (KanjiBase) readonly def - /Weight (Medium) readonly def - /ItalicAngle 0 def - /isFixedPitch false def - /UnderlinePosition 0 def - /UnderlineThickness 0 def -currentdict end readonly def - -/T1NF % T1NF -{ -20 dict begin - /FontName exch def - /FontType 1 def - /FontInfo T1FontInfo def - /FontMatrix [.001 0 0 .001 0 0] def - /FontBBox [0 0 1000 1000] def - /Encoding KanjiSubEncoding def - /CharStrings 150 dict def - /PaintType 0 def - /Private 2 dict def - Private begin - /BlueValues [] def - /password 5839 def - end -FontName currentdict end definefont -} def - -/T0NF % T0NF -{ -20 dict begin - /FontName exch def - /FDepVector exch def - /FontType 0 def - /FontMatrix [1 0 0 1 0 0] def - /FMapType 2 def - /Encoding KanjiEncoding def -FontName currentdict end definefont -} def - -% Define the composite font and all the base fonts. - -/CompNF % CompNF -{ -/newname1 exch def -newname1 dup length string cvs /str exch def -str length /len exch def -/fdepvector 78 array def -/j 1 def -16#21 1 16#74 { -/i exch def -KanjiEncoding i get 0 gt { -len 4 add string /newstr exch def -newstr 0 str putinterval -newstr len (.r) putinterval -newstr len 2 add i 16 2 string cvrs putinterval -newstr cvn /newlit exch def -newlit T1NF /newfont exch def -fdepvector j newfont put -/j j 1 add def -} if -} for -fdepvector 0 fdepvector 1 get put -/j 0 def -fdepvector newname1 T0NF -} def - -% Define an individual character in a composite font. -/CompD % <(HL)> CompD - - { currentfont /Encoding get 1 index 0 get get % FDepVector index - currentfont /FDepVector get exch get % base font - dup /Encoding get 3 -1 roll 1 get get % base font character name - exch /CharStrings get exch 3 -1 roll put - } bind def - -exec diff --git a/pstoraster/gs_ksb_e.ps b/pstoraster/gs_ksb_e.ps deleted file mode 100644 index 40fb6ff0c2..0000000000 --- a/pstoraster/gs_ksb_e.ps +++ /dev/null @@ -1,72 +0,0 @@ -% Copyright (C) 1994 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_ksb_e.ps,v 1.2 2000/03/08 23:14:30 mike Exp $ -% Define the KanjiSub encoding vector. -/currentglobal where - { pop currentglobal { setglobal } true setglobal } - { { } } -ifelse -/KanjiSubEncoding -%\x00 - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -%\x20 - /.notdef /c21 /c22 /c23 /c24 /c25 /c26 /c27 - /c28 /c29 /c2A /c2B /c2C /c2D /c2E /c2F - /c30 /c31 /c32 /c33 /c34 /c35 /c36 /c37 - /c38 /c39 /c3A /c3B /c3C /c3D /c3E /c3F -%\x40 - /c40 /c41 /c42 /c43 /c44 /c45 /c46 /c47 - /c48 /c49 /c4A /c4B /c4C /c4D /c4E /c4F - /c50 /c51 /c52 /c53 /c54 /c55 /c56 /c57 - /c58 /c59 /c5A /c5B /c5C /c5D /c5E /c5F -%\x60 - /c60 /c61 /c62 /c63 /c64 /c65 /c66 /c67 - /c68 /c69 /c6A /c6B /c6C /c6D /c6E /c6F - /c70 /c71 /c72 /c73 /c74 /c75 /c76 /c77 - /c78 /c79 /c7A /c7B /c7C /c7D /c7E /.notdef -%\x80 - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -%\xA0 - /.notdef /c21 /c22 /c23 /c24 /c25 /c26 /c27 - /c28 /c29 /c2A /c2B /c2C /c2D /c2E /c2F - /c30 /c31 /c32 /c33 /c34 /c35 /c36 /c37 - /c38 /c39 /c3A /c3B /c3C /c3D /c3E /c3F -%\xC0 - /c40 /c41 /c42 /c43 /c44 /c45 /c46 /c47 - /c48 /c49 /c4A /c4B /c4C /c4D /c4E /c4F - /c50 /c51 /c52 /c53 /c54 /c55 /c56 /c57 - /c58 /c59 /c5A /c5B /c5C /c5D /c5E /c5F -%\xE0 - /c60 /c61 /c62 /c63 /c64 /c65 /c66 /c67 - /c68 /c69 /c6A /c6B /c6C /c6D /c6E /c6F - /c70 /c71 /c72 /c73 /c74 /c75 /c76 /c77 - /c78 /c79 /c7A /c7B /c7C /c7D /c7E /.notdef -256 packedarray .defineencoding -exec diff --git a/pstoraster/gs_lev2.ps b/pstoraster/gs_lev2.ps deleted file mode 100644 index 2cd95ae37c..0000000000 --- a/pstoraster/gs_lev2.ps +++ /dev/null @@ -1,717 +0,0 @@ -% Copyright (C) 1990, 1996, 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_lev2.ps,v 1.2 2000/03/08 23:14:30 mike Exp $ -% Initialization file for Level 2 functions. -% When this is run, systemdict is still writable, -% but (almost) everything defined here goes into level2dict. - -level2dict begin - -% ------ System and user parameters ------ % - -% User parameters must obey save/restore, and must also be maintained -% per-context. We implement the former, and some of the latter, here -% with PostScript code. NOTE: our implementation assumes that user -% parameters change only as a result of setuserparams -- that there are -% no user parameters that are ever changed dynamically by the interpreter -% (although the interpreter may adjust the value presented to setuserparams) -% -% There are two types of user parameters: those which are actually -% maintained in the interpreter, and those which exist only at the -% PostScript level. We maintain the current state of both types in -% a read-only local dictionary named userparams, defined in systemdict. -% In a multi-context system, each context has its own copy of this -% dictionary. In addition, there is a constant dictionary named -% psuserparams whose keys are the names of user parameters that exist -% only in PostScript and whose values are (currently) arbitrary values -% of the correct datatype: setuserparams uses this for type checking. -% setuserparams updates userparams explicitly, in addition to setting -% any user parameters in the interpreter; thus we can use userparams -% to reset those parameters after a restore or a context switch. -% NOTE: the name userparams is known to the interpreter, and in fact -% the interpreter creates the userparams dictionary. - -% Check parameters that are managed at the PostScript level. -% Currently we allow resetting them iff the new value is of the same type. -/.checksetparams { % - % .checksetparams - 2 index { - % Stack: newdict opname checkdict key newvalue - 3 copy pop .knownget - { type 1 index type ne - { pop pop pop load /typecheck signalerror } - if - dup type /stringtype eq - { dup rcheck not - { pop pop pop load /invalidaccess signalerror } - if - } - if - } - if pop pop - } forall pop pop -} .bind def % not odef, shouldn't reset stacks - -% currentuser/systemparams creates and returns a dictionary in the -% current VM. The easiest way to make this work is to copy any composite -% PostScript-level parameters to global VM. Currently, the only such -% parameters are strings. In fact, we always copy string parameters, -% so that we can be sure the contents won't be changed. -/.copyparam { % .copyparam - dup type /stringtype eq { - .currentglobal true .setglobal - 1 index length string exch .setglobal - copy readonly - } if -} .bind def - -% Some user parameters are managed entirely at the PostScript level. -% We take care of that here. -systemdict begin -/psuserparams 40 dict def -/getuserparam { % getuserparam - /userparams .systemvar 1 index get exch pop -} odef -% Fill in userparams (created by the interpreter) with current values. -mark .currentuserparams -counttomark 2 idiv { - userparams 3 1 roll put -} repeat pop -/.definepsuserparam { % .definepsuserparam - - psuserparams 3 copy pop put - userparams 3 1 roll put -} .bind def -end -/currentuserparams { % - currentuserparams - /userparams .systemvar dup length dict .copydict -} odef -/setuserparams { % setuserparams - - % Check that we will be able to set the PostScript-level - % user parameters. - /setuserparams /psuserparams .systemvar .checksetparams - % Set the C-level user params. If this succeeds, we know that - % the password check succeeded. - dup .setuserparams - % Now set the PostScript-level params. - % The interpreter may have adjusted the values of some of the - % parameters, so we have to read them back. - dup { - /userparams .systemvar 2 index known { - psuserparams 2 index known not { - pop dup .getuserparam - } if - .copyparam - /userparams .systemvar 3 1 roll .forceput % userparams is read-only - } { - pop pop - } ifelse - } forall - % A context switch might have occurred during the above loop, - % causing the interpreter-level parameters to be reset. - % Set them again to the new values. From here on, we are safe, - % since a context switch will consult userparams. - .setuserparams -} .bind odef -% Initialize user parameters managed here. -/JobName () .definepsuserparam - -% Restore must restore the user parameters. -% (Since userparams is in local VM, save takes care of saving them.) -/restore { % restore - - restore /userparams .systemvar .setuserparams -} .bind odef - -% The pssystemparams dictionary holds some system parameters that -% are managed entirely at the PostScript level. -systemdict begin -currentdict /pssystemparams known not { - /pssystemparams 40 dict readonly def -} if -/getsystemparam { % getsystemparam - //pssystemparams 1 index .knownget { exch pop } { .getsystemparam } ifelse -} odef -end -/currentsystemparams { % - currentsystemparams - mark .currentsystemparams //pssystemparams { } forall .dicttomark -} odef -/setsystemparams { % setsystemparams - - % Check that we will be able to set the PostScript-level - % system parameters. - /setsystemparams //pssystemparams .checksetparams - % Set the C-level system params. If this succeeds, we know that - % the password check succeeded. - dup .setsystemparams - % Now set the PostScript-level params. We must copy local strings - % into global VM. - dup - { //pssystemparams 2 index known - { % Stack: key newvalue - .copyparam - //pssystemparams 3 1 roll .forceput % pssystemparams is read-only - } - { pop pop - } - ifelse - } - forall pop -} .bind odef - -% Initialize the passwords. -% NOTE: the names StartJobPassword and SystemParamsPassword are known to -% the interpreter, and must be bound to noaccess strings. -% The length of these strings must be max_password (iutil2.h) + 1. -/StartJobPassword 65 string noaccess def -/SystemParamsPassword 65 string noaccess def - -% Redefine cache parameter setting to interact properly with userparams. -/setcachelimit { - mark /MaxFontItem 2 index .dicttomark setuserparams pop -} .bind odef -/setcacheparams { - % The MaxFontCache parameter is a system parameter, which we might - % not be able to set. Fortunately, this doesn't matter, because - % system parameters don't have to be synchronized between this code - % and the VM. - counttomark 1 add copy setcacheparams - currentcacheparams % mark size lower upper - 3 -1 roll pop - /MinFontCompress 3 1 roll - /MaxFontItem exch - .dicttomark setuserparams - cleartomark -} .bind odef - -% Add bogus user and system parameters to satisfy badly written PostScript -% programs that incorrectly assume the existence of all the parameters -% listed in Appendix C of the Red Book. Note that some of these may become -% real parameters later: code near the end of gs_init.ps takes care of -% removing any such parameters from ps{user,system}params. - -psuserparams begin - /MaxFormItem 100000 def - /MaxPatternItem 20000 def - /MaxScreenItem 48000 def - /MaxUPathItem 5000 def -end - -pssystemparams begin - /CurDisplayList 0 .forcedef - /CurFormCache 0 .forcedef - /CurOutlineCache 0 .forcedef - /CurPatternCache 0 .forcedef - /CurUPathCache 0 .forcedef - /CurScreenStorage 0 .forcedef - /CurSourceList 0 .forcedef - /DoPrintErrors false .forcedef - /MaxDisplayList 140000 .forcedef - /MaxFormCache 100000 .forcedef - /MaxOutlineCache 65000 .forcedef - /MaxPatternCache 100000 .forcedef - /MaxUPathCache 300000 .forcedef - /MaxScreenStorage 84000 .forcedef - /MaxSourceList 25000 .forcedef - /RamSize 4194304 .forcedef -end - -% ------ Miscellaneous ------ % - -(<<) cvn % - << -mark- - /mark load def -(>>) cvn % -mark- ... >> - /.dicttomark load def -/languagelevel 2 def -% When running in Level 2 mode, this interpreter is supposed to be -% compatible with Adobe version 2017. -/version (2017) readonly def - -% If binary tokens are supported by this interpreter, -% set an appropriate default binary object format. -/setobjectformat where - { pop - /RealFormat getsystemparam (IEEE) eq { 1 } { 3 } ifelse - /ByteOrder getsystemparam { 1 add } if - setobjectformat - } if - -% ------ Virtual memory ------ % - -/currentglobal % - currentglobal - /currentshared load def -/gcheck % gcheck - /scheck load def -/setglobal % setglobal - - /setshared load def -% We can make the global dictionaries very small, because they auto-expand. -/globaldict currentdict /shareddict .knownget not { 4 dict } if def -/GlobalFontDirectory SharedFontDirectory def - -% VMReclaim and VMThreshold are user parameters. -/setvmthreshold { % setvmthreshold - - mark /VMThreshold 2 index .dicttomark setuserparams pop -} odef -/vmreclaim { % vmreclaim - - dup 0 gt { - .vmreclaim - } { - mark /VMReclaim 2 index .dicttomark setuserparams pop - } ifelse -} odef --1 setvmthreshold - -% ------ IODevices ------ % - -/.getdevparams where { - pop /currentdevparams { % currentdevparams - .getdevparams .dicttomark - } odef -} if -/.putdevparams where { - pop /setdevparams { % setdevparams - - mark 1 index { } forall counttomark 2 add index - .putdevparams pop pop - } odef -} if - -% ------ Job control ------ % - -serverdict begin - -% We could protect the job information better, but we aren't attempting -% (currently) to protect ourselves against maliciousness. - -/.jobsave null def % top-level save object -/.jobsavelevel 0 def % save depth of job (0 if .jobsave is null, - % 1 otherwise) -/.adminjob true def % status of current unencapsulated job - -end % serverdict - -% Because there may be objects on the e-stack created since the job save, -% we have to clear the e-stack before doing the end-of-job restore. -% We do this by executing a 2 .stop, which is caught by the 2 .stopped -% in .runexec; we leave on the o-stack a procedure to execute aftewards. -% -%**************** The definition of startjob is not complete yet, since -% it doesn't reset stdin/stdout. -/.startnewjob { % - % .startnewjob - - serverdict /.jobsave get dup null eq { pop } { restore } ifelse - exch { - % Unencapsulated job - serverdict /.jobsave null put - serverdict /.jobsavelevel 0 put - serverdict /.adminjob 3 -1 roll 1 gt put - % The Adobe documentation doesn't say what happens to the - % graphics state stack in this case, but an experiment - % produced results suggesting that a grestoreall occurs. - grestoreall - } { - % Encapsulated job - pop - serverdict /.jobsave save put - serverdict /.jobsavelevel 1 put - .userdict /quit /stop load put - } ifelse - % Reset the interpreter state. - clear cleardictstack - initgraphics - false setglobal -} bind def -/.startjob { % - % .startjob - vmstatus pop pop serverdict /.jobsavelevel get eq - 2 index .checkpassword 0 gt and { - exch .checkpassword exch count 3 roll count 3 sub { pop } repeat - cleardictstack - % Reset the e-stack back to the 2 .stopped in .runexec, - % passing the finish_proc to be executed afterwards. - 2 .stop - } { % Password check failed - pop pop pop false - } ifelse -} odef -/startjob { % startjob - { .startnewjob true } .startjob -} odef - -systemdict begin -/quit { % - quit - - //systemdict begin serverdict /.jobsave get null eq - { end //quit } - { /quit load /invalidaccess /signalerror load end exec } - ifelse -} bind odef -end - -% We would like to define exitserver as a procedure, using the code -% that the Red Book says is equivalent to it. However, since startjob -% resets the exec stack, we can't do this, because control would never -% proceed past the call on startjob if the exitserver is successful. -% Instead, we need to construct exitserver out of pieces of startjob. - -serverdict begin - -/exitserver { % exitserver - - true exch { .startnewjob } .startjob not { - /exitserver /invalidaccess signalerror - } if -} bind def - -end % serverdict - -% ------ Compatibility ------ % - -% In Level 2 mode, the following replace the definitions that gs_statd.ps -% installs in statusdict and serverdict. -% Note that statusdict must be allocated in local VM. -% We don't bother with many of these yet. - -/.dict1 { exch mark 3 1 roll .dicttomark } bind def - -currentglobal false setglobal 25 dict exch setglobal begin -currentsystemparams - -% The following do not depend on the presence of setpagedevice. -/buildtime 1 index /BuildTime get def -/byteorder 1 index /ByteOrder get def -/checkpassword { .checkpassword 0 gt } bind def -dup /DoStartPage known - { /dostartpage { /DoStartPage getsystemparam } bind def - /setdostartpage { /DoStartPage .dict1 setsystemparams } bind def - } if -dup /StartupMode known - { /dosysstart { /StartupMode getsystemparam 0 ne } bind def - /setdosysstart { { 1 } { 0 } ifelse /StartupMode .dict1 setsystemparams } bind def - } if -%****** Setting jobname is supposed to set userparams.JobName, too. -/jobname { /JobName getuserparam } bind def -/jobtimeout { /JobTimeout getuserparam } bind def -/ramsize { /RamSize getsystemparam } bind def -/realformat 1 index /RealFormat get def -dup /PrinterName known - { /setprintername { /PrinterName .dict1 setsystemparams } bind def - } if -/printername - { currentsystemparams /PrinterName .knownget not { () } if exch copy - } bind def -currentuserparams /WaitTimeout known - { /waittimeout { /WaitTimeout getuserparam } bind def - } if - -% The following do require setpagedevice. -/.setpagedevice where { pop } { (%END PAGEDEVICE) .skipeof } ifelse -/defaulttimeouts - { currentsystemparams dup - /JobTimeout .knownget not { 0 } if - exch /WaitTimeout .knownget not { 0 } if - currentpagedevice /ManualFeedTimeout .knownget not { 0 } if - } bind def -/margins - { currentpagedevice /Margins .knownget { exch } { [0 0] } ifelse - } bind def -/pagemargin - { currentpagedevice /PageOffset .knownget { 0 get } { 0 } ifelse - } bind def -/pageparams - { currentpagedevice - dup /Orientation .knownget { 1 and ORIENT1 { 1 xor } if } { 0 } ifelse exch - dup /PageSize get aload pop 3 index 0 ne { exch } if 3 2 roll - /PageOffset .knownget { 0 get } { 0 } ifelse 4 -1 roll - } bind def -/setdefaulttimeouts - { exch mark /ManualFeedTimeout 3 -1 roll - /Policies mark /ManualFeedTimeout 1 .dicttomark - .dicttomark setpagedevice - /WaitTimeout exch mark /JobTimeout 5 2 roll .dicttomark setsystemparams - } bind def -/.setpagesize { 2 array astore /PageSize .dict1 setpagedevice } bind def -/setduplexmode { /Duplex .dict1 setpagedevice } bind def -/setmargins - { exch 2 array astore /Margins .dict1 setpagedevice - } bind def -/setpagemargin { 0 2 array astore /PageOffset .dict1 setpagedevice } bind def -/setpageparams - { mark /PageSize 6 -2 roll - 4 index 1 and ORIENT1 { 1 } { 0 } ifelse ne { exch } if 2 array astore - /Orientation 5 -1 roll ORIENT1 { 1 xor } if - /PageOffset counttomark 2 add -1 roll 0 2 array astore - .dicttomark setpagedevice - } bind def -/setresolution - { dup 2 array astore /HWResolution .dict1 setpagedevice - } bind def -%END PAGEDEVICE - -% The following are not implemented yet. -%manualfeed -%manualfeedtimeout -%pagecount -%pagestackorder -%setpagestackorder - -pop % currentsystemparams - -% Flag the current dictionary so it will be swapped when we -% change language levels. (See zmisc2.c for more information.) -/statusdict currentdict def - -currentdict end -/statusdict exch .forcedef % statusdict is local, systemdict is global - -% ------ Color spaces ------ % - -% Define the setcolorspace procedures: -% proc -/colorspacedict mark - /DeviceGray { pop 0 setgray null } bind - /DeviceRGB { pop 0 0 0 setrgbcolor null } bind - /setcmykcolor where - { pop /DeviceCMYK { pop 0 0 0 1 setcmykcolor null } bind - } if - /.setcieaspace where - { pop /CIEBasedA { NOCIE { pop 0 setgray null } { dup 1 get .setcieaspace } ifelse } bind - } if - /.setcieabcspace where - { pop /CIEBasedABC { NOCIE { pop 0 0 0 setrgbcolor null } { dup 1 get .setcieabcspace } ifelse } bind - } if - /.setciedefspace where - { pop /CIEBasedDEF { NOCIE { pop 0 0 0 setrgbcolor null } { dup 1 get .setciedefspace } ifelse } bind - } if - /.setciedefgspace where - { pop /CIEBasedDEFG { NOCIE { pop 0 0 0 1 setcmykcolor null } { dup 1 get .setciedefgspace } ifelse } bind - } if - /.setseparationspace where - { pop /Separation { dup 2 get setcolorspace dup .setseparationspace } bind - } if - /.setindexedspace where - { pop /Indexed { dup 1 get setcolorspace dup .setindexedspace } bind - } if - /.nullpatternspace [/Pattern] readonly def - /.setpatternspace where - { pop /Pattern - { dup type /nametype eq { pop //.nullpatternspace } if - dup length 1 gt { dup 1 get setcolorspace } if - dup .setpatternspace - } bind - } if - /.setdevicenspace where - { pop /DeviceN { dup 2 get setcolorspace dup .setdevicenspace } bind - } if - /.setdevicepixelspace where - { pop /DevicePixel { dup .setdevicepixelspace } bind - } if - currentdict /.nullpatternspace .undef -.dicttomark def - -/.devcs [ - /DeviceGray /DeviceRGB /DeviceCMYK /DevicePixel -] readonly def -/currentcolorspace { % - currentcolorspace - .currentcolorspace dup type /integertype eq { - //.devcs exch 1 getinterval - } if -} odef -currentdict /.devcs .undef - -/setcolorspace { % setcolorspace - - dup dup dup type /nametype ne { 0 get } if - //colorspacedict exch get exec - dup null eq { pop } { .setcolorspace } ifelse pop -} odef - -% ------ CIE color rendering ------ % - -% Define findcolorrendering and a default ColorRendering ProcSet. - -/findcolorrendering { % findcolorrendering - % - /ColorRendering /ProcSet findresource - 1 index .namestring (.) concatstrings - 1 index /GetPageDeviceName get exec .namestring (.) concatstrings - 2 index /GetHalftoneName get exec .namestring - concatstrings concatstrings - dup /ColorRendering resourcestatus { - pop pop exch pop exch pop true - } { - pop /GetSubstituteCRD get exec false - } ifelse -} odef - -5 dict dup begin - -/GetPageDeviceName { % - GetPageDeviceName - currentpagedevice dup /PageDeviceName .knownget { - exch pop - } { - pop /none - } ifelse -} bind def - -/GetHalftoneName { % - GetHalftoneName - currenthalftone /HalftoneName .knownget not { /none } if -} bind def - -/GetSubstituteCRD { % GetSubstituteCRD - pop /DefaultColorRendering -} bind def - -end -% The resource machinery hasn't been activated, so just save the ProcSet -% and let .fixresources finish the installation process. -/ColorRendering exch def - -% Define setcolorrendering. - -/.colorrenderingtypes 5 dict def - -/setcolorrendering { % setcolorrendering - - dup /ColorRenderingType get //.colorrenderingtypes exch get exec -} odef - -/.setcolorrendering1 where { pop } { (%END CRD) .skipeof } ifelse - -.colorrenderingtypes 1 { - dup .buildcolorrendering1 .setcolorrendering1 -} .bind put - -% Initialize the default CIE rendering dictionary. -% The most common CIE files seem to assume the "calibrated RGB color space" -% described on p. 189 of the PostScript Language Reference Manual, -% 2nd Edition; we simply invert this transformation back to RGB. -mark - /ColorRenderingType 1 -% We must make RangePQR and RangeLMN large enough so that values computed by -% the assumed encoding MatrixLMN don't get clamped. - /RangePQR [0 0.9505 0 1 0 1.0890] readonly - /TransformPQR - [ {exch pop exch pop exch pop exch pop} bind dup dup ] readonly - /RangeLMN [0 0.9505 0 1 0 1.0890] readonly - /MatrixABC - [ 3.24063 -0.96893 0.05571 - -1.53721 1.87576 -0.20402 - -0.49863 0.04152 1.05700 - ] readonly - /EncodeABC [ {0 .max 0.45 exp} bind dup dup] readonly - /WhitePoint [0.9505 1 1.0890] readonly - % Some Genoa tests seem to require the presence of BlackPoint. - /BlackPoint [0 0 0] readonly -.dicttomark setcolorrendering - -%END CRD - -% Initialize a CIEBased color space for sRGB. -/CIEsRGB [ /CIEBasedABC - mark - /DecodeLMN [ { - dup 0.03928 le { 12.92321 div } { 0.055 add 1.055 div 2.4 exp } ifelse - } bind dup dup ] readonly - /MatrixLMN [ - 0.412457 0.212673 0.019334 - 0.357576 0.715152 0.119192 - 0.180437 0.072175 0.950301 - ] readonly - /WhitePoint [0.9505 1.0 1.0890] readonly - .dicttomark readonly -] readonly def - -% ------ Painting ------ % - -% A straightforward definition of execform that doesn't actually -% do any caching. -/.execform1 { - % This is a separate operator so that the stacks will be restored - % properly if an error occurs. - dup /Matrix get concat - dup /BBox get aload pop - exch 3 index sub exch 2 index sub rectclip - dup /PaintProc get - 1 index /Implementation known not { - 1 index dup /Implementation null .forceput readonly pop - } if - exec -} .bind odef % must bind .forceput - -/.formtypes 5 dict - dup 1 /.execform1 load put -def - -/execform { %
execform - - gsave { - dup /FormType get //.formtypes exch get exec - } stopped grestore { stop } if -} odef - -/.patterntypes 5 dict - dup 1 /.buildpattern1 load put -def - -/makepattern { % makepattern - //.patterntypes 2 index /PatternType get get - .currentglobal false .setglobal exch - % Stack: proto matrix global buildproc - 3 index dup length 1 add dict .copydict - 3 index 3 -1 roll exec 3 -1 roll .setglobal - 1 index /Implementation 3 -1 roll put - readonly exch pop exch pop -} odef - -/setpattern { % [ ...] setpattern - - currentcolorspace 0 get /Pattern ne { - [ /Pattern currentcolorspace ] setcolorspace - } if setcolor -} odef - -% Extend image and imagemask to accept dictionaries. -% We must create .imagetypes and .imagemasktypes outside level2dict, -% and leave some extra space because we're still in Level 1 mode. -systemdict begin -/.imagetypes 5 dict - dup 1 /.image1 load put -def -/.imagemasktypes 5 dict - dup 1 /.imagemask1 load put -def -end - -/.image /image load def -/image { - dup type /dicttype eq { - dup /ImageType get //.imagetypes exch get exec - } { - //.image - } ifelse -} odef -currentdict /.image undef - -/.imagemask /imagemask load def -/imagemask { - dup type /dicttype eq { - dup /ImageType get //.imagemasktypes exch get exec - } { - //.imagemask - } ifelse -} odef -currentdict /.imagemask undef - -end % level2dict diff --git a/pstoraster/gs_ll3.ps b/pstoraster/gs_ll3.ps deleted file mode 100644 index b743d88d4d..0000000000 --- a/pstoraster/gs_ll3.ps +++ /dev/null @@ -1,387 +0,0 @@ -% Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved. -% -% This file is part of GNU Ghostscript. -% -% GNU Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the GNU General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute GNU -% Ghostscript, but only under the conditions described in the GNU General -% Public License. A copy of this license is supposed to have been given -% to you along with GNU Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. -% -% Aladdin Enterprises supports the work of the GNU Project, but is not -% affiliated with the Free Software Foundation or the GNU Project. GNU -% Ghostscript, as distributed by Aladdin Enterprises, does not require any -% GNU software to build or run it. - -% $Id: gs_ll3.ps,v 1.1 2000/03/08 23:14:30 mike Exp $ -% Initialization file for PostScript LanguageLevel 3 functions. -% Essentially all of these are stubs right now. -% This file must be loaded after gs_lev2.ps and gs_res.ps. -% These definitions go into ll3dict or various ProcSets. -% NOTE: the interpreter creates ll3dict. - -ll3dict begin - -% We need LanguageLevel 2 or higher in order to have setuserparams and -% defineresource. -languagelevel dup 2 max .setlanguagelevel - -% ------ Idiom recognition ------ % - -/IdiomRecognition false .definepsuserparam - -% Modify `bind' to apply idiom recognition afterwards. -/.bindscratch 128 string def -% Do the right thing if NOBIND or DELAYBIND is in effect. -% Note also that since this definition of `bind' may get bound in, -% it has to function properly even at lower language levels, -% where IdiomRecognition may not be defined. -/bind load /.bind load ne -/bind { % bind - //.bind currentuserparams /IdiomRecognition - .knownget not { false } if { - (*) { - /IdiomSet findresource - false exch { - % Stack: proc false dummykey [template substitute] - exch pop dup 1 get exch 0 get - % Stack: proc false substitute template - 3 index .eqproc { - 2 index gcheck 1 index gcheck not and { - pop - } { - 3 -1 roll pop exch not exit - } ifelse - } { - pop - } ifelse - } forall { exit } if - } //.bindscratch /IdiomSet resourceforall - } if -} odef -{ /.bind /bind load def - /bind { } def -} if -currentdict /.bindscratch .undef - -% ------ HalftoneTypes 6, 10, 16 ------ % - -% This code depends on one new operator: -% -% .setstriphalftone - -% -% is the dictionary that will be returned by .currenthalftone. -% The operator only looks at the TransferFunction entry. -% Width, Height: as for HalftoneType 3. -% Thresholds: a BigStringEncode filter holding the thresholds, -% Width x Height x BitsPerSample / 8 bytes. -% shift: the amount of X shift per Y repetition of the halftone, -% 0 <= Shift < Width. -% bits: bits per sample, 8 or 16. -% -% Eventually the code below will have to get hooked up to sethalftone -% and currenthalftone.... - -/.copybytes { % .copybytes - - { 1 index read not { /sethalftone load /rangecheck signalerror exit } if - 1 index exch write - } repeat pop pop -} bind def - -/.copythresholds { % .copythresholds - - dup 8 idiv 3 index mul 2 index mul - dup /BigStringEncode filter 3 1 roll - % Stack: dict width height dest bits nbytes - 5 index /Thresholds get 3 index 3 -1 roll .copybytes - 1 index closefile - 0 .setstriphalftone -} bind def - -/.sethalftone6 { % .sethalftone6 - - % Keys: Width, Height, Thresholds, T'Function - dup /Width get 1 index /Height get - 8 .copythresholds -} odef - -/.copythresholds2 { % - % .copythresholds2 - -% The block height B is gcd(Height, Height2). - 3 index 2 index { - 2 copy lt { exch } if dup 1 eq { pop exit } if exch 1 index mod - } loop -% The raster R is (Width * Height + Width2 * Height2) / B * bits/8. - 5 index 5 index mul 4 index 4 index mul add 1 index idiv - 2 index 8 idiv mul -% Currently I don't know how to compute the stride. -% ****** COMPUTE THE STRIDE SOMEHOW ****** -% Push additional arguments onto the stack. - 1 index 1 index mul /BigStringEncode filter 4 1 roll - 9 index /Thresholds get - % Stack: dict width height width2 height2 bits - % dest B R stride source -% For the first rectangle, the number of blocks is Height / B; -% the offset is 0. - 5 copy 14 index 5 1 roll - 14 index 5 index idiv 4 1 roll - 0 exch .copyshifted -% For the second rectangle, the number of blocks is Height2 / B; -% the offset is Width. - 5 copy 12 index 5 1 roll - 12 index 4 index idiv 4 1 roll - 16 index exch .copyshifted - % Stack: dict width height width2 height2 bits - % dest B R stride source - % We want: dict R/(bits/8) B dest bits stride - pop exch 4 index 8 idiv idiv 4 1 roll - % R/(bits/8) dest B stride - exch 3 1 roll 5 -1 roll exch - 9 -4 roll 4 { pop } repeat - .setstriphalftone -} bind def - -% Copy a shifted rectangular threshold array into a BigStringEncode filter. -% Note that the width and shift are in bytes, not samples. -/.copyshifted { % - % .copyshifted - -% Copy N blocks of x B bytes from . -% Row Y (0 <= Y < B) in group G (0 <= G < N) must get copied to byte position -% Y * R + (G * stride + offset) mod R -% in the destination. - 1 index % Stack: ... rowstart - 6 index { % iterate over rows within a block - 5 index { % iterate over blocks - 8 index 1 index setfileposition - 1 index 9 index 9 index .copybytes - 4 index add % + raster - } repeat % end block - 3 index add 4 index mod % + stride, mod raster - } repeat % end row in block - 9 { pop } repeat -} bind def - -/.sethalftone10 { % .sethalftone10 - - % Keys: XSquare, YSquare, Thresholds, T'Function -% ****** DOESN'T HANDLE STRING SOURCE ****** - dup /XSquare get dup 2 index /YSquare get dup - 8 .copythresholds2 -} odef - -/.sethalftone16 { % .sethalftone16 - - % Keys: Width, Height, Width2, Height2, - % Thresholds, T'Function - dup /Width get 1 index /Height get - 2 index /Width2 .knownget { % 2-rectangle case - 3 index /Height2 get - 16 .copythresholds2 - } { % 1-rectangle case - 16 .copythresholds - } ifelse -} odef - -{6 10 16} { dup /HalftoneType defineresource pop } forall - -% ------ ImageTypes 3 and 4 (masked images) ------ % - -.imagetypes - dup 3 /.image3 load put - 4 /.image4 load put - -% ------ Functions ------ % - -% Define the FunctionType resource category. -/Generic /Category findresource dup maxlength 3 add dict .copydict begin - /InstanceType /integertype def -/FunctionType currentdict end /Category defineresource pop - -{0 2 3} { dup /FunctionType defineresource pop } forall - -% ------ Smooth shading ------ % - -% Define the ShadingType resource category. -/Generic /Category findresource dup maxlength 3 add dict .copydict begin - /InstanceType /integertype def -/ShadingType currentdict end /Category defineresource pop - -systemdict /.shadingtypes mark % not ll3dict - 1 /.buildshading1 load - 2 /.buildshading2 load - 3 /.buildshading3 load - 4 /.buildshading4 load - 5 /.buildshading5 load - 6 /.buildshading6 load - 7 /.buildshading7 load -.dicttomark put - -/.buildshading { % .buildshading - % The .buildshading operators use the current color space - % for ColorSpace. - dup /ShadingType get //.shadingtypes exch get - 1 index /ColorSpace get gsave { setcolorspace exec } stopped - grestore { stop } if -} bind def -/.buildpattern2 { %