summaryrefslogtreecommitdiff
path: root/scheduler/cups-driverd.cxx
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-06-08 19:29:57 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-06-08 19:29:57 +0000
commit59fd9df98631e2ce391ddf1adb9034ae403c36fe (patch)
treebe882def886c35108201b121a4ab2286b5176289 /scheduler/cups-driverd.cxx
parent763a0aed1670a3db8f4a8a190d28ac126c238426 (diff)
downloadcups-59fd9df98631e2ce391ddf1adb9034ae403c36fe.tar.gz
Start of 3D printer support (infrastructure only)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12711 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/cups-driverd.cxx')
-rw-r--r--scheduler/cups-driverd.cxx38
1 files changed, 30 insertions, 8 deletions
diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx
index 573d2e1e2..73f3228d5 100644
--- a/scheduler/cups-driverd.cxx
+++ b/scheduler/cups-driverd.cxx
@@ -33,7 +33,7 @@
* Constants...
*/
-#define PPD_SYNC 0x50504437 /* Sync word for ppds.dat (PPD7) */
+#define PPD_SYNC 0x50504438 /* Sync word for ppds.dat (PPD8) */
#define PPD_MAX_LANG 32 /* Maximum languages */
#define PPD_MAX_PROD 32 /* Maximum products */
#define PPD_MAX_VERS 32 /* Maximum versions */
@@ -42,9 +42,12 @@
#define PPD_TYPE_PDF 1 /* PDF PPD */
#define PPD_TYPE_RASTER 2 /* CUPS raster PPD */
#define PPD_TYPE_FAX 3 /* Facsimile/MFD PPD */
-#define PPD_TYPE_UNKNOWN 4 /* Other/hybrid PPD */
-#define PPD_TYPE_DRV 5 /* Driver info file */
-#define PPD_TYPE_ARCHIVE 6 /* Archive file */
+#define PPD_TYPE_OBJECT_ANY 4 /* 3D (AMF/STL/g-code) PPD */
+#define PPD_TYPE_OBJECT_DIRECT 5 /* 3D (AMF/STL/g-code) PPD over any connection */
+#define PPD_TYPE_OBJECT_STORAGE 6 /* 3D (AMF/STL/g-code) PPD for storage to SD card, etc. */
+#define PPD_TYPE_UNKNOWN 7 /* Other/hybrid PPD */
+#define PPD_TYPE_DRV 8 /* Driver info file */
+#define PPD_TYPE_ARCHIVE 9 /* Archive file */
#define TAR_BLOCK 512 /* Number of bytes in a block */
#define TAR_BLOCKS 10 /* Blocking factor */
@@ -135,6 +138,9 @@ static const char * const PPDTypes[] = /* ppd-type values */
"pdf",
"raster",
"fax",
+ "object",
+ "object-direct",
+ "object-storage",
"unknown",
"drv",
"archive"
@@ -1172,11 +1178,11 @@ list_ppds(int request_id, /* I - Request ID */
load_drivers(include, exclude);
/*
- * Add the raw and IPP Everywhere drivers...
+ * Add the raw driver...
*/
- add_ppd("", "everywhere", "en", "Generic", "IPP Everywhere", "", "", "", 0, 0, 0, PPD_TYPE_UNKNOWN, "everywhere");
- add_ppd("", "raw", "en", "Raw", "Raw Queue", "", "", "", 0, 0, 0, PPD_TYPE_UNKNOWN, "raw");
+ add_ppd("", "raw", "en", "Raw", "Raw Queue", "", "", "", 0, 0, 0,
+ PPD_TYPE_UNKNOWN, "raw");
/*
* Send IPP attributes...
@@ -2095,12 +2101,28 @@ load_ppd(const char *filename, /* I - Real filename */
if (!_cups_strncasecmp(ptr, "true", 4))
type = PPD_TYPE_FAX;
}
- else if (!strncmp(line, "*cupsFilter:", 12) && type == PPD_TYPE_POSTSCRIPT)
+ else if ((!strncmp(line, "*cupsFilter:", 12) || !strncmp(line, "*cupsFilter2:", 13)) && type == PPD_TYPE_POSTSCRIPT)
{
if (strstr(line + 12, "application/vnd.cups-raster"))
type = PPD_TYPE_RASTER;
else if (strstr(line + 12, "application/vnd.cups-pdf"))
type = PPD_TYPE_PDF;
+ else if (strstr(line + 12, "application/amf") ||
+ strstr(line + 12, "application/g-code") ||
+ strstr(line + 12, "application/sla"))
+ type = PPD_TYPE_OBJECT_ANY;
+ }
+ else if (!strncmp(line, "*cups3DWorkflows:", 17))
+ {
+ int is_direct = strstr(line + 17, "direct") != NULL;
+ int is_storage = strstr(line + 17, "storage") != NULL;
+
+ if (is_direct && !is_storage)
+ type = PPD_TYPE_OBJECT_DIRECT;
+ if (!is_direct && is_storage)
+ type = PPD_TYPE_OBJECT_STORAGE;
+ else
+ type = PPD_TYPE_OBJECT_ANY;
}
else if (!strncmp(line, "*cupsModelNumber:", 17))
sscanf(line, "*cupsModelNumber:%d", &model_number);